T - Type of child element.public abstract class PropertyEditorCustomTree<T extends UIElementBase> extends PropertyEditorCustom
bandbox, bandpopupcomponent| Constructor and Description |
|---|
PropertyEditorCustomTree(Class<T> childClass,
String labelProperty,
boolean hierarchical)
Create the editor instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.zkoss.zul.Treeitem |
addTreeitem(T child,
org.zkoss.zk.ui.Component parent,
org.zkoss.zul.Treeitem insertAfter)
Adds a tree item under the specified parent.
|
protected boolean |
canDemote(org.zkoss.zul.Treeitem item)
Override to enable promotion of items
|
protected boolean |
canPromote(org.zkoss.zul.Treeitem item)
Override to enable promotion of items
|
boolean |
commit()
Commits changes to all proxies.
|
void |
doClose()
Invoked when the associated bandbox is closed;
|
protected PluginDefinition |
getTargetDefinition()
Returns the plugin definition for the proxied object.
|
boolean |
hasChanged()
Returns true if changes have been made since the last commit.
|
protected void |
init(UIElementBase target,
PropertyInfo propInfo,
PropertyGrid propGrid)
Initializes the property editor by constructing the tree view based on the child elements of
the target element.
|
protected void |
initProxy(org.carewebframework.shell.designer.PropertyEditorCustomTree.Proxy proxy)
Subclasses may override to provide any special proxy initialization.
|
void |
onChange(org.zkoss.zk.ui.event.Event event)
Catches onChange events from the grid.
|
void |
onClick$btnAdd()
Add a new item.
|
void |
onClick$btnDelete()
Delete the selected item.
|
void |
onClick$btnDown()
Move the selected tree item down one level.
|
void |
onClick$btnLeft()
Promote the selected tree item.
|
void |
onClick$btnRight()
Demote the selected tree item.
|
void |
onClick$btnUp()
Move the selected tree item up one level.
|
void |
onClose(org.zkoss.zk.ui.event.Event event)
If the property grid is closed, instead close the bandbox.
|
void |
onDoubleClick$tree(org.zkoss.zk.ui.event.Event event)
Double-clicking a tree item allows in place editing.
|
void |
onLabelChange$tree() |
void |
onSelect$tree()
Occurs when the tree view selection changes.
|
protected void |
resequenceTargets(org.zkoss.zul.Treechildren tc,
UIElementBase parent)
Resequence all UI elements to match that of the tree view.
|
boolean |
revert()
Reverts all changes to the last committed state.
|
doOpen, getValue, onEvent, setFocus, setValuegetComponent, getPropInfo, getTarget, setWrongValueException, setWrongValueMessage, updateValuepublic PropertyEditorCustomTree(Class<T> childClass, String labelProperty, boolean hierarchical) throws Exception
childClass - This is the class of child elements managed by this editor. It is used to
create new instances of the UI element from within the editor and to restrict the
selection of child elements to that type only.
The owner class may be null. In this case, there is no restriction on the child type. The user is prompted for an element type when creating a new instance.
labelProperty - This is the name of the property on the child UI element that will be
synchronized with the label of the corresponding tree node. It may be null.hierarchical - If true, the editor assumes that child elements may contain other child
elements.Exception - Unspecified exception.protected PluginDefinition getTargetDefinition()
Note that if there is no specified plugin definition, the add component dialog will be presented, allowing the user to select which definition to use.
protected void initProxy(org.carewebframework.shell.designer.PropertyEditorCustomTree.Proxy proxy)
proxy - Proxy to be initialized.protected void init(UIElementBase target, PropertyInfo propInfo, PropertyGrid propGrid)
init in class PropertyEditorCustomtarget - Target element whose children will be represented in the tree view.propInfo - The property information associated with the child elements.propGrid - The parent property grid.public boolean commit()
commit in class PropertyEditorBasepublic boolean revert()
revert in class PropertyEditorBaseprotected org.zkoss.zul.Treeitem addTreeitem(T child, org.zkoss.zk.ui.Component parent, org.zkoss.zul.Treeitem insertAfter)
child - Child to be associated (via a proxy) with the newly created tree item.parent - The tree parent to receive the new tree item.insertAfter - Tree item after which new item will be added (may be null).protected void resequenceTargets(org.zkoss.zul.Treechildren tc,
UIElementBase parent)
tc - Root of subtree.parent - The parent UI element.public void onSelect$tree()
public void onDoubleClick$tree(org.zkoss.zk.ui.event.Event event)
event - The double click event.public void onLabelChange$tree()
public void doClose()
PropertyEditorCustomdoClose in class PropertyEditorCustompublic void onClose(org.zkoss.zk.ui.event.Event event)
event - The close event.public void onClick$btnAdd()
public void onClick$btnDelete()
public void onClick$btnUp()
public void onClick$btnDown()
public void onClick$btnLeft()
public void onClick$btnRight()
public void onChange(org.zkoss.zk.ui.event.Event event)
event - The onChange event.protected boolean canPromote(org.zkoss.zul.Treeitem item)
item - The item to test.protected boolean canDemote(org.zkoss.zul.Treeitem item)
item - The item to test.public boolean hasChanged()
hasChanged in class PropertyEditorBaseCopyright © 2016 Regenstrief Center for Biomedical Informatics. All rights reserved.