/** Returns if the orientation of this splitter is horizontal. * @since 5.0.0 */ public boolean isHorizontal() { final Box box = (Box) getParent(); return box != null && box.isHorizontal(); }
/** Opens or collapses the splitter. * Meaningful only if {@link #getCollapse} is not "none". */ public void setOpen(boolean open) { if (_open != open) { _open = open; smartUpdate("open", open); } }
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Splitter self = (Splitter)comp; wh.write("<div id=\"").write(self.getUuid()).write("\" z.type=\"zul.box.Splt\""); wh.write(self.getOuterAttrs()).write(self.getInnerAttrs()).write(">"); wh.write("<span id=\"").write(self.getUuid()).write("!btn\" style=\"display:none\""); wh.write("></span>"); wh.write("</div>"); }
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException { super.renderProperties(renderer); if (!_open) renderer.render("open", false); if (!"none".equals(_collapse)) render(renderer, "collapse", _collapse); }
/** * Create a new status pane and associated label. * * @param pane Name of pane (becomes the id of the label). * @return The newly created label. */ private Label createLabel(String pane) { boolean first = root.getFirstChild() == null; if (!first) { root.appendChild(new Splitter()); } Cell cell = new Cell(); if (first) { cell.setHflex("1"); } else { cell.setAlign("center"); } cell.setVflex("1"); cell.setSclass("cwf-header-cell"); root.appendChild(cell); Label lbl = new Label(); lbl.setId(pane); cell.appendChild(lbl); return lbl; } }
/** Returns if the orientation of this splitter is vertical. * @since 5.0.0 */ public boolean isVertical() { final Box box = (Box) getParent(); return box == null || box.isVertical(); }
/** Sets which side of the splitter is collapsed when its grippy * is clicked. If this attribute is not specified, the splitter will * not cause a collapse. * * @param collapse one of none, before and after. * If null or empty is specified, none is assumed. * @see #getCollapse */ public void setCollapse(String collapse) throws WrongValueException { if (collapse == null || collapse.length() == 0) collapse = "none"; else if (!"none".equals(collapse) && !"before".equals(collapse) && !"after".equals(collapse)) throw new WrongValueException("Unknown collpase: " + collapse); if (!Objects.equals(_collapse, collapse)) { _collapse = collapse; smartUpdate("collapse", collapse); } }
/** Returns the orientation of the splitter. * It is the same as the parent's orientation ({@link Box#getOrient}. */ public String getOrient() { final Box box = (Box) getParent(); return box != null ? box.getOrient() : "vertical"; }