added capability for the User Agreement text dialog to have a subtitle

This commit is contained in:
Eric J. Bowersox 2001-12-14 19:43:06 +00:00
parent 0bbd01e385
commit a0a78059bc
2 changed files with 18 additions and 1 deletions

View File

@ -204,6 +204,7 @@ public class Account extends VeniceServlet
choices[1] = "top"; choices[1] = "top";
return new TextMessageDialog(TextMessageDialog.TYPE_ACCEPT_DECLINE, return new TextMessageDialog(TextMessageDialog.TYPE_ACCEPT_DECLINE,
rdat.getStockMessage("user-agreement-title"), rdat.getStockMessage("user-agreement-title"),
rdat.getStockMessage("user-agreement-subtitle"),
rdat.getStockMessage("user-agreement"),choices); rdat.getStockMessage("user-agreement"),choices);
} // end else } // end else

View File

@ -42,6 +42,7 @@ public class TextMessageDialog implements ContentRender, ColorSelectors
private int type; private int type;
private String title; private String title;
private String subtitle;
private String text; private String text;
private String[] choices; private String[] choices;
@ -54,6 +55,21 @@ public class TextMessageDialog implements ContentRender, ColorSelectors
{ {
this.type = type; this.type = type;
this.title = title; this.title = title;
this.subtitle = null;
this.text = text;
this.choices = choices;
int nbutton = getNumButtons(type);
if (choices.length<nbutton)
throw new InternalStateError("insufficient elements in choices array");
} // end constructor
public TextMessageDialog(int type, String title, String subtitle, String text, String[] choices)
{
this.type = type;
this.title = title;
this.subtitle = subtitle;
this.text = text; this.text = text;
this.choices = choices; this.choices = choices;
@ -134,7 +150,7 @@ public class TextMessageDialog implements ContentRender, ColorSelectors
public void renderHere(Writer out, RenderData rdat) throws IOException public void renderHere(Writer out, RenderData rdat) throws IOException
{ {
rdat.writeContentHeader(out,title,null); rdat.writeContentHeader(out,title,subtitle);
out.write(rdat.getStdFontTag(CONTENT_FOREGROUND,2)); out.write(rdat.getStdFontTag(CONTENT_FOREGROUND,2));
out.write("\n"); out.write("\n");
out.write(text); out.write(text);