List of usage examples for org.apache.wicket.extensions.markup.html.repeater.tree.theme HumanTheme HumanTheme
HumanTheme
From source file:org.efaps.ui.wicket.components.classification.ClassificationTree.java
License:Apache License
/** * @param _wicketId wicketId of this component * @param _model model for this component * @throws CacheReloadException on error *//*w w w . ja v a 2 s . c o m*/ public ClassificationTree(final String _wicketId, final IModel<UIClassification> _model) throws CacheReloadException { super(_wicketId, new ClassificationTreeProvider(_model)); setOutputMarkupId(true); if ("human".equals(Configuration.getAttribute(ConfigAttribute.CLASSTREE_CLASS))) { add(new HumanTheme()); } else if ("windows".equals(Configuration.getAttribute(ConfigAttribute.CLASSTREE_CLASS))) { add(new WindowsTheme()); } Properties properties; try { properties = Configuration.getAttributeAsProperties(ConfigAttribute.CLASSTREE_EXPAND); } catch (final EFapsException e) { ClassificationTree.LOG.error("cannot read Properties from Configuration."); properties = new Properties(); } final Iterator<? extends UIClassification> iter = getProvider().getRoots(); while (iter.hasNext()) { final UIClassification clazz = iter.next(); final String expand = properties.getProperty(Type.get(clazz.getClassificationUUID()).getName(), "false"); addChildren(clazz, "true".equalsIgnoreCase(expand)); } }
From source file:org.efaps.ui.wicket.components.menutree.MenuTree.java
License:Apache License
/** * Constructor used for a new MenuTree.//from ww w . ja v a 2 s.co m * * @param _wicketId wicket id of the component * @param _commandUUID uuid of the command * @param _oid oid * @param _selectCmdUUID UUID of the selected Command * @throws CacheReloadException on error */ public MenuTree(final String _wicketId, final UUID _commandUUID, final String _oid, final UUID _selectCmdUUID) throws CacheReloadException { super(_wicketId, new TreeMenuModel(_commandUUID, _oid)); add(new HumanTheme()); add(AttributeModifier.append("class", "eFapsTreeMenu")); add(new MenuUpdateBehavior()); setDefault(_selectCmdUUID); }
From source file:org.efaps.ui.wicket.components.search.DimensionPanel.java
License:Apache License
/** * Instantiates a new taxonomy panel./* w ww. ja v a 2 s. com*/ * * @param _wicketId the _wicket id * @param _model the model */ public DimensionPanel(final String _wicketId, final IModel<IndexSearch> _model) { super(_wicketId, _model); setOutputMarkupId(true); final Form<Void> form = new Form<>("dimForm"); add(form); final DimensionProvider provider = _model.getObject().getDimensionProvider(); final NestedTree<DimTreeNode> dimTree = new NestedTree<DimTreeNode>("dimTree", provider) { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; @Override protected Component newContentComponent(final String _wicketId, final IModel<DimTreeNode> _model) { final Component ret; if (_model.getObject().getValue() instanceof Dimension) { ret = new Label(_wicketId, _model.getObject().getLabel()); } else { ret = new DimValuePanel(_wicketId, _model); } return ret; } }; form.add(dimTree); dimTree.getModelObject().addAll(provider.getRootList()); dimTree.add(new HumanTheme()); }
From source file:org.efaps.ui.wicket.components.tree.StructurBrowserTree.java
License:Apache License
/** * @param _wicketId WicketId of the Tree * @param _model Model for this Tree/* w w w.ja v a2s .co m*/ */ public StructurBrowserTree(final String _wicketId, final IModel<UIStructurBrowser> _model) { super(_wicketId, new StructurBrowserProvider(_model), new SetModel<UIStructurBrowser>(_model.getObject().getExpandedBrowsers())); if ("human".equals(Configuration.getAttribute(ConfigAttribute.STRUCTREE_CLASS))) { add(new HumanTheme()); } else if ("windows".equals(Configuration.getAttribute(ConfigAttribute.STRUCTREE_CLASS))) { add(new WindowsTheme()); } }
From source file:org.efaps.ui.wicket.components.tree.StructurBrowserTreeTable.java
License:Apache License
/** * Constructor.//from w ww. ja v a2s .c o m * * @param _wicketId wicket id for this component * @param _model model * @throws CacheReloadException on error */ public StructurBrowserTreeTable(final String _wicketId, final IModel<UIStructurBrowser> _model) throws CacheReloadException { super(_wicketId, new StructurBrowserProvider(_model), new SetModel<UIStructurBrowser>(_model.getObject().getExpandedBrowsers())); if (_model.getObject() instanceof UIFieldStructurBrowser) { final FieldTable field = FieldTable .get(((UIFieldStructurBrowser) _model.getObject()).getFieldTabelId()); this.topicName = field.getName(); } else { this.topicName = _model.getObject().getTable().getName(); } if ("human".equals(Configuration.getAttribute(ConfigAttribute.STRUCBRWSRTREE_CLASS))) { add(new HumanTheme()); } else if ("windows".equals(Configuration.getAttribute(ConfigAttribute.STRUCBRWSRTREE_CLASS))) { add(new WindowsTheme()); } }
From source file:org.onehippo.forge.exdocpicker.impl.field.tree.ExternalTreeItemFieldBrowserDialog.java
License:Apache License
/** * Constructs external document(s) picker dialog. * @param titleModel title model// ww w . ja va2s.co m * @param extDocServiceContext {@link ExternalDocumentServiceContext} instance * @param exdocService {@link ExternalDocumentServiceFacade} instance * @param model the model containing the currently selected external documents in the document node data */ public ExternalTreeItemFieldBrowserDialog(IModel<String> titleModel, final ExternalDocumentServiceContext extDocServiceContext, final ExternalDocumentServiceFacade<Serializable> exdocService, IModel<ExternalDocumentCollection<Serializable>> model) { super(titleModel, extDocServiceContext, exdocService, model); final String themeName = extDocServiceContext.getPluginConfig().getString( PluginConstants.PARAM_EXTERNAL_TREE_VIEW_THEME, PluginConstants.DEFAULT_EXTERNAL_TREE_VIEW_THEME); if (StringUtils.startsWithIgnoreCase(themeName, "window")) { theme = new WindowsTheme(); } else { theme = new HumanTheme(); } expandSelectedButton = new AjaxButton("expand-selected-button") { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { expandPickedExternalTreeItemNodes(getExternalDocumentServiceFacade()); target.add(ExternalTreeItemFieldBrowserDialog.this); } }; add(expandSelectedButton); expandAllButton = new AjaxButton("expand-all-button") { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { treeExpansionSet.expandAll(); target.add(ExternalTreeItemFieldBrowserDialog.this); } }; add(expandAllButton); collapseAllButton = new AjaxButton("collapse-all-button") { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { treeExpansionSet.collapseAll(); target.add(ExternalTreeItemFieldBrowserDialog.this); } }; add(collapseAllButton); }