public String getValue(Component cmp) { return ((HtmlBasedComponent) cmp).getHeight(); } });
/** * Sets vertical flexibility hint of this component. * <p>Number flex indicates how * this component's container distributes remaining empty space among its * children vertically. Flexible component grow and shrink to fit their * given space. Flexible components with larger flex values will be made * larger than components with lower flex values, at the ratio determined by * all flexible components. The actual flex value is not relevant unless * there are other flexible components within the same container. Once the * default sizes of components in a container are calculated, the remaining * space in the container is divided among the flexible components, * according to their flex ratios.</p> * <p>Specify a flex value of negative value, 0, * or "false" has the same effect as leaving the flex attribute out entirely. * Specify a flex value of "true" has the same effect as a flex value of 1.</p> * <p>Special flex hint, <b>"min"</b>, indicates that the minimum space shall be * given to this flexible component to enclose all of its children components. * That is, the flexible component grow and shrink to fit its children components.</p> * * @param flex the vertical flex hint. * @since 5.0.0 * @see #setHflex * @see #getVflex */ public void setVflex(String flex) { if (getHeight() != null && !(flex == null || "min".equals(flex))) { throw new UiException("Not allowed to set vflex and height at the same time except vflex=\"min\""); } setVflex0(flex); }
String heightStr = comp.getHeight(); if (heightStr == null || heightStr.length() <= 0) { heightStr = getMinheight() + "px";
final HtmlBasedComponent hbc = (HtmlBasedComponent) owner; hgh = hbc.getHeight(); //null if not set
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Menubar self = (Menubar)comp; final String uuid = self.getUuid(); wh.write("<div id=\"").write(uuid).write("\" z.type=\"zul.menu2.Menubar2\""); wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(">"); wh.write("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id=\"").write(uuid).writeln("!cave\">"); for (Iterator it = self.getChildren().iterator(); it.hasNext();) { final HtmlBasedComponent child = (HtmlBasedComponent)it.next(); wh.write("<tr id=\"").write(child.getUuid()).write("!chdextr\""); wh.writeAttr("height",child.getHeight()).writeln(">"); child.redraw(out); wh.writeln("</tr>"); } wh.write("</table></div>"); } }
public void minimize(boolean minimized) { if(!isMinimizable()){ throw new AgentException(target + " is not minimizable"); } HtmlBasedComponent comp = target.as(HtmlBasedComponent.class); String cmd = Events.ON_MINIMIZE; MinimizeEvent event = new MinimizeEvent(cmd, comp, "", "", comp.getWidth(), comp.getHeight(), minimized); Map<String, Object> data = EventDataManager.getInstance().build(event); String desktopId = target.getDesktop().getId(); ((ClientCtrl) getClient()).postUpdate(desktopId, target.getUuid(), cmd, data, false); ((ClientCtrl) getClient()).flush(desktopId); }
public void maximize(boolean maximized) { if(!isMaximizable()){ throw new AgentException(target + " is not maximizable"); } HtmlBasedComponent comp = target.as(HtmlBasedComponent.class); String cmd = Events.ON_MAXIMIZE; MaximizeEvent event = new MaximizeEvent(cmd, comp, "", "", comp.getWidth(), comp.getHeight(), maximized); Map<String, Object> data = EventDataManager.getInstance().build(event); String desktopId = target.getDesktop().getId(); ((ClientCtrl) getClient()).postUpdate(desktopId, target.getUuid(), cmd, data, false); ((ClientCtrl) getClient()).flush(desktopId); }