private void expandOrCollapse(BaseComponent parent, boolean collapse) { for (BaseComponent child : parent.getChildren()) { ((Treenode) child).setCollapsed(collapse); expandOrCollapse(child, collapse); } }
/** * If the added column is marked as sorted, set it as the sort column. * * @see org.fujion.component.BaseComponent#afterAddChild(org.fujion.component.BaseComponent) */ @Override protected void afterAddChild(BaseComponent child) { super.afterAddChild(child); if (((Column) child).isSortColumn()) { setSortColumn((Column) child); } }
@Override public void afterInitialized(BaseComponent root) { window = (Window) root; window.setTitle(root.getAttribute("title", "")); btnPrint.setVisible(root.getAttribute("allowPrint", false)); String text = root.getAttribute("text", ""); if (text.startsWith("<html>")) { cmpHtml.setContent(text); } else { cmpText.setLabel(text); } }
/** * Returns the model from the associated grid rows. * * @return The model backing the associated grid rows. May be null. */ private IListModel<Object> getRowsModel() { Grid grid = getAncestor(Grid.class); Rows rows = grid == null ? null : grid.getRows(); return rows == null ? null : rows.getModel(Object.class); }
/** * Ensures that this node is visible (i.e., all of its parent tree nodes are expanded. */ public void makeVisible() { BaseComponent node = getParent(); while (node instanceof Treenode) { ((Treenode) node).setCollapsed(false); node = node.getParent(); } scrollIntoView(); }
/** * Update control states. */ private void updateControls() { btnSave.setDisabled(!modified); btnRestore.setDisabled(!modified); txtData.setBalloon(null); }
private void _setTreeSelected(Treenode selectedNode) { Treeview treeview = getTreeview(); if (treeview != null) { treeview.setSelectedNode(selectedNode); } }
private Treenode findSelected(Treenode node, Treenode selnode) { if (node.isSelected()) { if (selnode != null) { selnode._setSelected(false, true, false); } selnode = node; } for (BaseComponent child : node.getChildren()) { selnode = findSelected((Treenode) child, selnode); } return selnode; }
/** * If popup specified as a child, set it as the associated popup component. * * @see org.fujion.component.BaseComponent#onAttach(org.fujion.component.Page) */ @Override protected void onAttach(Page page) { super.onAttach(page); if (getChildCount() > 0) { setPopup((Popup) getFirstChild()); } }
/** * Sets the tabs selected status. * * @param selected The new selected status. * @param notifyParent If true, notify the parent tab view of the status change. */ protected void _setSelected(boolean selected, boolean notifyParent) { if (propertyChange("selected", this.selected, this.selected = selected, true)) { if (notifyParent && getParent() != null) { getTabview().setSelectedTab(selected ? this : null); } } }
protected void _setSelected(boolean selected, boolean notifyClient, boolean notifyParent) { if (propertyChange("selected", this.selected, this.selected = selected, notifyClient)) { if (notifyParent && getParent() != null) { ((Rows) getParent())._updateSelected(this); } } }
/** * If popup specified as a child, set it as the associated popup component. * * @see org.fujion.component.BaseComponent#afterAddChild(org.fujion.component.BaseComponent) */ @Override protected void afterAddChild(BaseComponent child) { super.afterAddChild(child); if (getPage() != null) { setPopup((Popup) child); } }
/** * If the child being removed is the popup, set the popup to null. * * @see org.fujion.component.BaseComponent#afterRemoveChild(org.fujion.component.BaseComponent) */ @Override protected void afterRemoveChild(BaseComponent child) { super.afterRemoveChild(child); if (child == popup.getReference()) { setPopup(null); } }
/** * Sets the currently selected item. * * @param item The combo item to select, or null for no selection. */ public void setSelectedItem(Comboitem item) { validateIsChild(item); if (item == null) { _updateSelected(item); } else { item.setSelected(true); } }
/** * Returns the child at the specified index. If the index is out of bounds, returns null. * * @param index The index of the child sought. * @return Child at the specified index or null if the index is out of bounds. */ public BaseComponent getChildAt(int index) { return index < 0 || index >= getChildCount() ? null : children.get(index); }
/** * If the added item is marked as selected, set it as the selected item. * * @see org.fujion.component.BaseComponent#afterAddChild(org.fujion.component.BaseComponent) */ @Override protected void afterAddChild(BaseComponent child) { Comboitem item = (Comboitem) child; if (item.isSelected()) { _updateSelected(item); } }