public class MyController implements Initializable { @FXML public Combobox myCombobox; @Override public void initialize(URL url, ResourceBundle rb) { } public void setData(){ myCombobox.getItems().clear(); myCombobox.getItems().addAll( "jacob.smith@example.com", "isabella.johnson@example.com", "ethan.williams@example.com", "emma.jones@example.com", "michael.brown@example.com"); } }
String[][] data = getData(); Arrays.sort(data, new ArrayComparator(0, true));
public void onPageAttached(Page newpage, Page oldpage) { super.onPageAttached(newpage, oldpage); if (_model != null) { postOnInitRender(null); if (_dataListener != null) { _model.removeListDataListener(_dataListener); _model.addListDataListener(_dataListener); } } }
public int getTotalSize() { final Rows rows = _grid.getRows(); final ListModel model = _grid.getModel(); return model != null ? model.getSize() : rows != null ? rows.getVisibleItemCount() : 0; }
private Listcell autoFirstCell() { Listcell cell = (Listcell) getFirstChild(); if (cell == null) { cell = new Listcell(); cell.applyProperties(); cell.setParent(this); } return cell; } }
/*package*/ void addVisibleItemCount(int count) { if (count == 0) return; Component parent = getParent(); if (parent instanceof Treeitem) { if (((Treeitem) parent).isOpen()) ((Treeitem) parent).addVisibleItemCount(count); } else if (parent instanceof Tree) ((Tree) parent).addVisibleItemCount(count); _visibleItemCount += count; }
/** @param parent either a Tree or Treeitem instance. */ private static Treechildren treechildrenOf(Component parent) { Treechildren tc = (parent instanceof Tree) ? ((Tree) parent).getTreechildren() : ((Treeitem) parent).getTreechildren(); if (tc == null) { tc = new Treechildren(); tc.setParent(parent); } return tc; }
/** Returns the {@link Treerow} that is associated with * this treechildren, or null if no such treerow. * In other words, it is {@link Treeitem#getTreerow} of * {@link #getParent}. * * @since 2.4.1 * @see Treerow#getLinkedTreechildren */ public Treerow getLinkedTreerow() { final Component parent = getParent(); return parent instanceof Treeitem ? ((Treeitem) parent).getTreerow() : null; }
@SuppressWarnings("unchecked") public Object clone() { final DefaultTreeModel clone = (DefaultTreeModel) super.clone(); final TreeNode cloneRoot = (TreeNode) getRoot().clone(); cloneRoot.setModel(this); clone.setRootDirectly(cloneRoot); return clone; } }
public void onPageAttached(Page newpage, Page oldpage) { super.onPageAttached(newpage, oldpage); if (_model != null) { smartDrawChart(); if (_dataListener != null) { _model.removeChartDataListener(_dataListener); _model.addChartDataListener(_dataListener); } } }
/** Returns the maximal length for this cell, which is decided by * the corresponding {@link #getTreecol}'s {@link Treecol#getMaxlength}. */ public int getMaxlength() { final Tree tree = getTree(); if (tree == null) return 0; final Treecol lc = getTreecol(); return lc != null ? lc.getMaxlength() : 0; }
/** Called by {@link Treechildren} when is added to a tree. */ /*package*/ void onTreechildrenAdded(Treechildren tchs) { if (tchs == null || tchs.getParent() == this) return; //already being processed by insertBefore //main the selected status for (Treeitem item : tchs.getItems()) fixNewChild(item); }
/** Called when a radio is removed from this group. */ /*package*/ void fixOnRemove(Radio child) { if (child.isSelected()) { _jsel = -1; } else if (_jsel > 0) { //excluding 0 fixSelectedIndex(); } }
public void onChildRemoved(Component child) { super.onChildRemoved(child); _syncItemIndicesLater = true; if (child == _selItem) { // Bug B60-ZK-1202.zul _selItem = null; schedSyncValueToSelection(); } smartUpdate("repos", true); }
/** 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(); }
public void onPageDetached(Page page) { super.onPageDetached(page); if (_model != null && _dataListener != null) _model.removeChartDataListener(_dataListener); } }
/** * Sets a list of constraints separated by comma. * Example: "between 20071012 and 20071223", "before 20080103". * @param constr a list of constraints separated by comma. */ public void setConstraint(String constr) { if (constr != null) { setConstraint(new SimpleDateConstraint(constr)); } }