コード例 #1
0
 @Override
 public ListItems getDictItems(final ComponentParameter cParameter, final ListboxBean listbox) {
   final Dict dict = getDict(cParameter);
   if (dict == null) {
     return null;
   }
   final IDictItemManager dictItemMgr = context.getDictItemManager();
   final ListItems items = ListItems.of();
   final IDataQuery<DictItem> dq = dictItemMgr.queryItems(dict);
   DictItem dictItem;
   while ((dictItem = dq.next()) != null) {
     final ListItem item = createItem(listbox, dictItem);
     if (item != null) {
       items.add(item);
     }
   }
   return items;
 }
コード例 #2
0
 @Override
 public TreeNodes getCategoryTreenodes(
     final ComponentParameter cParameter, final TreeBean treeBean, final TreeNode parent) {
   Object dataObject = parent != null ? parent.getDataObject() : null;
   if (dataObject instanceof IIdBeanAware) {
     dataObject = ((IIdBeanAware) dataObject).getId();
   }
   final IDataQuery<?> query = categoryBeans(cParameter, dataObject);
   if (query != null && query.getCount() > 0) {
     final boolean draggable = (Boolean) cParameter.getBeanProperty("draggable");
     final TreeNodes nodes = TreeNodes.of();
     Object bean;
     while ((bean = query.next()) != null) {
       final TreeNode treeNode = new TreeNode(treeBean, parent, bean);
       treeNode.setDraggable(draggable);
       treeNode.setAcceptdrop(draggable);
       nodes.add(treeNode);
     }
     return nodes;
   }
   return null;
 }