public void onSelect$tree(){ cntDiv.getChildren().clear(); Treeitem item = tree.getSelectedItem(); Map map = (Map)item.getValue(); showImages(map); }
final Treeitem ti1 = (Treeitem) o1, ti2 = (Treeitem) o2; if (index < 0) { v1 = handleCase((Comparable) ti1.getValue()); v2 = handleCase((Comparable) ti2.getValue()); } else { List tcs1 = ti1.getTreerow().getChildren(); else { final Treecell tc = (Treecell) tcs1.get(index); v1 = handleCase(_byval ? ti1.getValue() : tc.getLabel()); else { final Treecell lc = (Treecell) lcs2.get(index); v2 = handleCase(_byval ? ti1.getValue() : lc.getLabel());
Object bean = ti.getValue(); if (vals.contains(bean)) { items.add(ti);
@SuppressWarnings("unchecked") public Object coerceToBean(Object val, Component comp, BindContext ctx) { Set<Object> vals = new LinkedHashSet<Object>(); if (val != null) { final Tree tree = (Tree) comp; final TreeModel<?> model = tree.getModel(); if (model != null && !(model instanceof TreeSelectableModel)) { throw new UiException("model doesn't implement TreeSelectableModel"); } if (model != null) { int[][] paths = ((TreeSelectableModel) model).getSelectionPaths(); if (paths != null && paths.length > 0) { for (int[] path : paths) { vals.add(model.getChild(path)); } } } else { final Set<Treeitem> items = (Set<Treeitem>) Classes.coerce(LinkedHashSet.class, val); for (Treeitem item : items) { vals.add(item.getValue()); } } } return vals; } }
public Object coerceToBean(Object val, Component comp, BindContext ctx) { if (val != null) { final Tree tree = (Tree) comp; final TreeModel<?> model = tree.getModel(); if (model != null && !(model instanceof TreeSelectableModel)) { throw new UiException("model doesn't implement TreeSelectableModel"); } if (model != null) { int[] path = ((TreeSelectableModel) model).getSelectionPath(); if (path == null) return null; return model.getChild(path); } else { return ((Treeitem) val).getValue(); } } return null; } }
Object bean = ti.getValue(); if (val.equals(bean)) { return ti;
TreeNode<?> treeNode = item == null ? null : (TreeNode<?>) item.getValue(); Object data = treeNode == null ? null : treeNode.getData();
if (nti.getValue() == null) //template might set it nti.setValue(node); ti.setAttribute(Attributes.MODEL_RENDERAS, nti);
if (ti.getValue() == null) //template might set it ti.setValue(data);