/** * Saves natural column width if it hasn't been saved already. * * @param columnIndex * @since 7.3.9 */ protected void saveNaturalColumnWidthIfNotSaved(int columnIndex) { if (naturalWidth < 0) { // This is recently revealed column. Try to detect a proper // value (greater of header and data cols) final int hw = ((Element) getElement().getLastChild()) .getOffsetWidth() + getHeaderPadding(); if (columnIndex < 0) { columnIndex = 0; for (Widget widget : tHead) { if (widget == this) { break; } columnIndex++; } } final int cw = scrollBody.getColWidth(columnIndex); naturalWidth = (hw > cw ? hw : cw); } }
public CubaScrollTableHead() { Element iconElement = presentationsEditIcon.getElement(); iconElement.setClassName("c-table-prefs-icon"); iconElement.getStyle().setDisplay(Style.Display.NONE); Element columnSelector = (Element) getElement().getLastChild(); DOM.insertChild(getElement(), iconElement, DOM.getChildIndex(getElement(), columnSelector)); DOM.sinkEvents(iconElement, Event.ONCLICK); }
public CubaTreeTableTableHead() { Element iconElement = presentationsEditIcon.getElement(); iconElement.setClassName("c-table-prefs-icon"); iconElement.getStyle().setDisplay(Style.Display.NONE); Element columnSelector = (Element) getElement().getLastChild(); DOM.insertChild(getElement(), iconElement, DOM.getChildIndex(getElement(), columnSelector)); DOM.sinkEvents(iconElement, Event.ONCLICK); }
/** * Adds the new radio button to the group. * * @param label radio button's label * @param title radio button's tooltip * @param icon radio button's icon * @param clickHandler click handler */ public void addButton( String label, String title, @Nullable SVGResource icon, ClickHandler clickHandler) { final RadioButton radioButton = new RadioButton(GROUP_NAME, label); radioButton.setTitle(title); radioButton.setStyleName(resources.getCSS().button()); radioButton.addClickHandler(clickHandler); final Element radioButtonElement = radioButton.getElement(); final Node labelNode = radioButtonElement.getLastChild(); if (icon != null) { labelNode.insertFirst(new SVGImage(icon).getElement()); } else { radioButtonElement.getStyle().setWidth(90, PX); as(labelNode).getStyle().setWidth(90, PX); } mainPanel.add(radioButton); buttons.add(radioButton); }
TableCellElement td = getElement().getLastChild().cast(); int colSpan = visibleColOrder.length - groupColIndex; td.setColSpan(colSpan);
/** * Returns the height in pixels of the framing elements of this panel * (including any top and bottom bars and header and footer elements, but not * including the body height). To retrieve the body height see * {@link #getInnerHeight}. * * @return the frame height */ public int getFrameHeight() { int h = el().getFrameWidth("tb") + bwrap.getFrameWidth("tb"); if (frame) { Element hd = el().dom.getFirstChildElement().cast(); Element ft = bwrap.dom.getLastChild().cast(); h += (fly(hd).getHeight() + fly(ft).getHeight()); Element mc = bwrap.subChild(3).dom; h += fly(mc).getFrameWidth("tb"); } else { if (head != null) { h += head.getOffsetHeight(); } if (foot != null) { h += foot.getHeight(); } } h += (tbar != null ? tbar.getHeight() : 0) + (bbar != null ? bbar.getHeight() : 0); return h; }
Node lastChild = consoleLines.getElement().getLastChild(); if (lastChild != null) { lastChild.removeFromParent();
protected boolean addTreeSpacer(UIDL rowUidl) { if (cellShowsTreeHierarchy(getElement().getChildCount() - 1)) { Element container = (Element) getElement().getLastChild() .getFirstChild(); if (rowUidl.hasAttribute("icon")) { Icon icon = client .getIcon(rowUidl.getStringAttribute("icon")); icon.setAlternateText("icon"); container.insertFirst(icon.getElement()); } String classname = "v-treetable-treespacer"; if (rowUidl.getBooleanAttribute("ca")) { canHaveChildren = true; open = rowUidl.getBooleanAttribute("open"); classname += open ? " v-treetable-node-open" : " v-treetable-node-closed"; } treeSpacer = Document.get().createSpanElement(); treeSpacer.setClassName(classname); container.insertFirst(treeSpacer); depth = rowUidl.hasAttribute("depth") ? rowUidl.getIntAttribute("depth") : 0; setIndent(); isTreeCellAdded = true; return true; } return false; }
@Override protected boolean addTreeSpacer(UIDL rowUidl) { if (cellShowsTreeHierarchy(getElement().getChildCount() - 1)) { Element container = (Element) getElement().getLastChild().getChild(0); if (rowUidl.hasAttribute("icon")) { // icons are in first content cell in TreeTable ImageElement icon = Document.get().createImageElement(); icon.setClassName("v-icon"); icon.setAlt("icon"); icon.setSrc(client.translateVaadinUri(rowUidl.getStringAttribute("icon"))); container.insertFirst(icon); } String classname = "v-treetable-treespacer-patched"; if (rowUidl.getBooleanAttribute("ca")) { canHaveChildren = true; open = rowUidl.getBooleanAttribute("open"); classname += open ? " v-treetable-node-open" : " v-treetable-node-closed"; classname += open ? " icon-arrow1_s" : " icon-arrow1_e"; } treeSpacer = Document.get().createDivElement(); treeSpacer.getStyle().setDisplay(Display.INLINE_BLOCK); treeSpacer.setClassName(classname); container.insertAfter(treeSpacer, container.getFirstChild()); depth = rowUidl.hasAttribute("depth") ? rowUidl.getIntAttribute("depth") : 0; setIndent(); isTreeCellAdded = true; return true; } return false; }
if (frame) { Element hd = el().dom.getFirstChildElement().cast(); Element ft = bwrap.dom.getLastChild().cast(); h += (fly(hd).getHeight() + fly(ft).getHeight()); h += mcFrameSize.height;