Details
-
Improvement
-
Resolution: Won't Fix
-
Major
-
None
-
2.1 Final
-
None
-
all
Description
I splitted the methods drawHtmlPostSubs(Writer) and drawHtmlPreSubs(Writer) into several methods and made them protected. Before, when extending DialogDialog.java a lot of unnecessary redundant code got spread all over the subclasses which is hard to maintain.
Patch for revision 1139:
— originals/magnolia-2.1-SNAPSHOT/src/main/info/magnolia/cms/gui/dialog/DialogDialog.java 2005-07-13 17:15:01.000000000 +0200
+++ patched/magnolia-2.1-SNAPSHOT/src/main/info/magnolia/cms/gui/dialog/DialogDialog.java 2005-07-28 13:49:02.000000000 +0200
@@ -136,6 +136,13 @@
// out.write(" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
out.write("<html>"); //$NON-NLS-1$
+ this.drawHtmlPreSubsHead(out);
+ out.write("<body class=\"mgnlDialogBody\" onload=\"mgnlDialogInit();\">"); //$NON-NLS-1$
+ this.drawHtmlPreSubsForm(out);
+ this.drawHtmlPreSubsTabSet(out);
+ }
+
+ protected void drawHtmlPreSubsHead(Writer out) throws IOException
+
+ protected void drawHtmlPreSubsForm(Writer out) throws IOException {
out.write("<form action=\"" //$NON-NLS-1$
+ this.getAction() + "\" name=\"mgnlFormMain\" method=\"post\" enctype=\"multipart/form-data\">"); //$NON-NLS-1$
out.write(new Hidden("mgnlDialog", this.getConfigValue("dialog"), false).getHtml()); //$NON-NLS-1$ //$NON-NLS-2$
@@ -173,19 +182,25 @@
if (this.getConfigValue("paragraph").indexOf(",") == -1)
// else multiple paragraph selection -> radios for selection
- // TabSet stuff
+ }
+
+ protected void drawHtmlPreSubsTabSet(Writer out) throws IOException { String id = this.getId(); out.write("<script type=\"text/javascript\">"); //$NON-NLS-1$ out.write("mgnlControlSets['" + id + "']=new Object();"); //$NON-NLS-1$ //$NON-NLS-2$ out.write("mgnlControlSets['" + id + "'].items=new Array();"); //$NON-NLS-1$ //$NON-NLS-2$ out.write("mgnlControlSets['" + id + "'].resize=true;"); //$NON-NLS-1$ //$NON-NLS-2$ out.write("</script>"); //$NON-NLS-1$ - // end TabSet stuff }
public void drawHtmlPostSubs(Writer out) throws IOException
{ - Messages msgs = MessagesManager.getMessages(getRequest()); + this.drawHtmlPostSubsTabSet(out); + this.drawHtmlPostSubsButtons(out); + out.write("</form></body></html>"); //$NON-NLS-1$ + }+
+ protected void drawHtmlPostSubsTabSet(Writer out) throws IOException
+
+ protected void drawHtmlPostSubsButtons(Writer out) throws IOException
}