@Override protected boolean isMaximizable() { return getComponent().isMaximizable(); }
@Override protected boolean isMinimizable() { return getComponent().isMinimizable(); }
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Panel self = (Panel)comp; final String uuid = self.getUuid(); final String zcls = self.getZclass(); final String title = self.getTitle(); final String border = self.getBorder(); final boolean hasBorder = "normal".equals(border); final boolean noTitle = Strings.isBlank(title); final Caption caption = self.getCaption(); final boolean noHeader = noTitle && caption == null; wh.write("<div id=\"").write(self.getUuid()).write("\" z.type=\"zul.panel.Panel\" z.autoz=\"true\"") .write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(">"); if (self.isFramable()) { wh.write("<div class=\"").write(zcls).write("-tl").write("\"><div class=\"") .write(zcls).write("-tr\"></div></div><div class=\"").write(zcls) if (!self.isFramable() && !hasBorder) wh.write(' ').write(zcls).write("-header-noborder"); wh.write("\">"); if (caption == null) { if (self.isClosable()) wh.write("<div id=\"").write(uuid).write("!close\" class=\"") .write(zcls).write("-icon ").write(zcls).write("-close\"></div>"); if (self.isMaximizable()) { wh.write("<div id=\"").write(uuid).write("!maximize\" class=\"") .write(zcls).write("-icon ").write(zcls).write("-max"); if (self.isMaximized())
public void setVflex(String flex) { super.setVflex(flex); Panelchildren pc = getPanelchildren(); if (pc != null) pc.smartUpdate("vflex", flex); }
public boolean insertBefore(Component newChild, Component refChild) { if (newChild instanceof Caption) { refChild = getFirstChild(); if (super.insertBefore(newChild, refChild)) { if (refChild instanceof Panelchildren || (refChild == null && (getChildren().size() == (_caption != null ? 2 : 1)))) { _tbar = (Toolbar) newChild; } else if (refChild == null || refChild == _fbar) {
private void afterUnmarshal() { if (_caption != null) _caption = (Caption) getChildren().get(_caption.getParent().getChildren().indexOf(_caption)); if (_tbar != null) _tbar = (Toolbar) getChildren().get(_tbar.getParent().getChildren().indexOf(_tbar)); if (_panelchildren != null) _panelchildren = (Panelchildren) getChildren() .get(_panelchildren.getParent().getChildren().indexOf(_panelchildren)); if (_bbar != null) _bbar = (Toolbar) getChildren().get(_bbar.getParent().getChildren().indexOf(_bbar)); if (_fbar != null) _fbar = (Toolbar) getChildren().get(_fbar.getParent().getChildren().indexOf(_fbar)); }
/** Process the onClose event sent when the close button is pressed. * <p>Default: detach itself. */ public void onClose() { detach(); }
public Object clone() { final Panel clone = (Panel) super.clone(); clone.afterUnmarshal(); return clone; }
public void setHflex(String flex) { super.setHflex(flex); Panelchildren pc = getPanelchildren(); if (pc != null) pc.smartUpdate("hflex", flex); }
public void beforeChildAdded(Component newChild, Component refChild) { if (newChild instanceof Caption) { if (_caption != null && _caption != newChild) throw new UiException("Only one caption is allowed: " + this); } else if (refChild instanceof Caption) { throw new UiException("caption must be the first child"); } else if (newChild instanceof Panelchildren) { if (_panelchildren != null && _panelchildren != newChild) throw new UiException("Only one panelchildren child is allowed: " + this); } else if (newChild instanceof Toolbar) { if (refChild instanceof Panelchildren || (refChild == null && (getChildren().isEmpty()))) { if (_tbar != null && _tbar != newChild) throw new UiException("Only one top toolbar child is allowed: " + this); } else if (refChild == null || refChild == _fbar) { if (_bbar != null && _bbar != newChild) { if (refChild != null && refChild == _fbar) throw new UiException("Only one bottom toolbar child is allowed: " + this); if (_fbar != null && _fbar != newChild) throw new UiException("Only one foot toolbar child is allowed: " + this); } } else { throw new UiException("Only three toolbars child is allowed: " + this); } } else { throw new UiException("Unsupported child for Panel: " + newChild); } super.beforeChildAdded(newChild, refChild); }