1 13 package info.magnolia.cms.gui.dialog; 14 15 import info.magnolia.cms.gui.control.Button; 16 import info.magnolia.cms.gui.misc.CssConstants; 17 import info.magnolia.cms.i18n.TemplateMessagesUtil; 18 19 import java.io.IOException ; 20 import java.io.Writer ; 21 22 import org.apache.commons.lang.StringUtils; 23 24 25 29 public class DialogTab extends DialogSuper { 30 31 34 protected DialogTab() { 35 } 36 37 public void drawHtmlPreSubs(Writer out) throws IOException { 38 String parentId = this.getParent().getId(); 39 String id = this.getId(); 40 if (StringUtils.isNotEmpty(this.getLabel())) { 42 Button control = new Button(); 43 control.setLabel(TemplateMessagesUtil.get(this.getRequest(), this.getLabel())); 44 control.setOnclick("mgnlDialogShiftTab('" + parentId + "','" + id + "');"); this.getParent().addOption(control); 46 } 47 out.write("<script type=\"text/javascript\">"); out.write("mgnlControlSets['" + parentId + "'].items[mgnlControlSets['" + parentId + "'].items.length]='" + id + "';"); out.write("</script>"); out.write("<div id=\"" + id + "_div\" class=\"" + CssConstants.CSSCLASS_TAB + "\">"); out.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">"); out.write("<tr><td class=\"" + CssConstants.CSSCLASS_TAB + "\">"); out 59 .write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"table-layout:fixed\">"); out.write("<col width=\"200\" /><col />"); } 62 63 public void drawHtmlPostSubs(Writer out) throws IOException { 64 out.write("</table>"); out.write("</td></tr></table></div>"); } 67 } 68 | Popular Tags |