Class TreeEditor
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.Container
overit.geocall.basic.ui.container.TreeEditor
- All Implemented Interfaces:
Serializable,overit.geocall.clipboard.XClip,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,AjaxableComponent,Badgeable,Hideable,Identified,Tool,overit.geocall.ux.configurability.UIConfigurable,overit.geocall.ux.edm.ModelConfigurable
- Direct Known Subclasses:
TemplateJsonTreeEditor,TEProjectTreeView,TreeSelector
@Component
public class TreeEditor
extends Container
implements Hideable, AjaxableComponent, overit.geocall.clipboard.XClip
The class implements the user interface element, that extends
To use this container it is necessary to extend this class implementing the
Container, and allows the hierarchical
display of data through a tree structure, also allowing to compress / expand sub-branches or to modify the structure by adding new nodes,
or, again, moving the nodes from one branch to another. To use this container it is necessary to extend this class implementing the
fillNode
method, which will contains the logic for generating the html code necessary to render the contents of each node.- See Also:
- GCApi:
- component
-
Nested Class Summary
Nested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected Treeprotected Treeprotected Treeprotected charDefines the editing policies on the individual tree node.protected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected booleanprotected Treeprotected Treeprotected TaskMessageprotected SetPredicateprotected StringFilter attribute used in copy and paste and drag and drop actions.protected static StringFields inherited from class overit.geocall.basic.ui.Container
_rofields, _rules, DALINK_NO, DALINK_YES, DATE_MAX, DATE_MIN, TIME_MAX, TIME_MIN, TYPE_ACTION, TYPE_BOOLEAN, TYPE_DATE, TYPE_DOUBLE, TYPE_DTZ, TYPE_EURO, TYPE_FILE, TYPE_FILES, TYPE_INTEGER, TYPE_LONG, TYPE_LONGARRAY, TYPE_MAP, TYPE_MAXDATE, TYPE_MAXTIME, TYPE_MEASURE, TYPE_MINDATE, TYPE_MINTIME, TYPE_NEWACTION, TYPE_STRING, TYPE_STRINGARRAY, TYPE_SUBSET, TYPE_SUBSETRANGE, TYPE_SUPPORT, TYPE_TIMERANGEFields inherited from class overit.geocall.ui.Control
_blank, _cleaner, _dblink, _enabled, _ro, _title, altEventIconsList, altIcon, ariaDescription, ariaLabel, badge, badgeformat, FILTER_PREFIXES, LABEL_ATTRIBUTE, LABEL_IN_LINE_ATTRIBUTE, STATE_BLANK, STATE_NORMAL, STATE_RO, STATE_ROBLANKFields inherited from class overit.geocall.ui.Component
_basic, _childrenContainers, _currentId, _gridalign, _gridcols, _gridrows, _gridvalign, _iconElement, _id, _keylabel, _label, _layoutName, _name, _parentContainer, _registryName, _shortcut, _tabindex, _transformations, _valuesContainer, aliasField, BR, configHidden, configuredLabel, configuredLabelInLine, defaultHidden, ELEMENT_BR, ELEMENT_NULL, entityContainer, entityName, extendedField, fullHeight, important, labelInLine, layoutLabel, PIXEL_IMG, safeInlineServiceFields inherited from interface overit.geocall.ui.AjaxableComponent
FRAME_ID_PREFIX, NOTRANSITION, TRANSITION_BODY_MORPH, TRANSITION_BODY_RESIZE, TRANSITION_BORDER_RESIZE, TRANSITION_DOWN, TRANSITION_UP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanExtends the method, making it returnstrue, to enable the evaluation of the methodTree.isFiltered()during the html code generation of the sub-treeprotected StringCalculates the frame id.protected Stringvoidchanged(overit.geocall.ux.servlet.processor.Change change) Defines the morphing of the TreeEditor element that occurs when there is an Ajax interaction
Implements theAjaxableComponentinterface.protected voidprotected voidchangedSubTree(Tree from, Tree to) protected voidprotected MenucreateMenu(Tree t) protected booleanprotected booleanprotected booleanprotected booleanprotected voidprotected voidevidence21(String[] ss, String s0, String s1, String s2, boolean breakfirst, boolean boldfirst) protected voidfillArcDescription(org.apache.ecs.ConcreteElement dUp, org.apache.ecs.ConcreteElement dDown, Tree tg) protected final voidfillArcDescription(org.apache.ecs.html.Div dUp, org.apache.ecs.html.Div dDown, Tree t) protected voidvoidfreeClip(boolean delete) protected Stringprotected Stringprotected String[]protected org.apache.ecs.ElementgetCountInfo(Tree t) Gets the cutting node of the Treeoverit.geocall.ux.servlet.processor.ChangeDefines the defaultChangeobject for the TreeEditor.protected org.apache.ecs.html.TRDeprecated.protected org.apache.ecs.html.TablegetDropDownMenu(Tree tt) Deprecated.ImplementscreateMenu(tree)protected org.apache.ecs.ElementgetDropDownT(Tree t) Deprecated.UsecreateMenu(tree)org.apache.ecs.ElementgetFrameHtml(overit.geocall.ux.servlet.processor.Change change, EntitySet es) Defines the html part of the TreeEditor that changes when an Ajax interaction occurs.org.apache.ecs.ElementReturns the html code of the TreeEditorprotected org.apache.ecs.html.DivDeprecated.ImplementscreateMenu(tree)protected org.apache.ecs.html.DivDeprecated.The opening of the menu is managed in response to the Ajax OpenMenu event
ImplementscreateMenu(tree)protected org.apache.ecs.ElementReturns a new nodeReturns a new treeprotected org.apache.ecs.html.TDgetTDAlert(Tree t) protected org.apache.ecs.html.TDgetTree()Returns theTreeof the TreeEditorgetTreeAlert(Tree tg) Returns the string used in the Alert (seeonAccept()) when the node has a not valid definitionprotected org.apache.ecs.html.DivbooleanChecks if the TreeEditor is rendered for the user currently logged in the application, or not (seegetBoolean(visible,id,true))booleanNode acceptance event; if the node ad a not valid definition, it shows an Alert (seegetTreeAlert())booleanSwitches the value for the border attributebooleanbooleanPops the TreeEditor page and returns null to the restored pagebooleanDeprecated.booleanMakes a copy of a node of the TreebooleanDeprecated.UseonCut(UIMessage)booleanCuts of a node of the TreebooleanDeprecated.booleanDeletes a node from the TreebooleanExpands the parents of the node previously compressedbooleanAdds a new node (seegetNewNode()) after the target onebooleanAdds a new node (seegetNewNode()) before the target onebooleanAdds a new node (seegetNewNode()) as a child of the target onebooleanAdds a new node (seegetNewNode()) as parent of the target onebooleanCompresses the childs of the node so that in visualization the node appears with no childsvoidMethod called when is executed theWindowManager.push(overit.geocall.basic.ui.Window, java.lang.Object)of theWindowthat contains the Container.booleanonOpenMenu(HashGetter hg) Opens the contextual menu for the nodebooleanDeprecated.booleanPastes a node into the TreebooleanExpands the childs of the node prviously compressedbooleanSwitches the value for showing the short versione of the contextual node's menubooleanCompresses the parents of the node so that in visualization the node is positioned as rootprotected SerializablepasteContent(Tree dest, Serializable s, boolean local) protected TreeresolveTree(Object o, String field) voidSets the editing policies on the individual tree node.voidSets wheter to bring up the contextual menu of individual nodes when the user presses the right or left mouse button.protected voidsetOnClickAction(Tree t, org.apache.ecs.html.Div d) voidSets a parameter for the events associated to the TreeEditor (like Edit, Delete, Copy, etc)voidSets aTreeto the TreeEditorprotected voidsetup()Setup the ComponentvoidsetVISIBLE(String s) Defines if the TreeEditor should be rendered or notvoidSets a particularxclassto the TreeEditor; this string is used to limit the operations of copy / cut / paste / drag / drop that can be executed only between objects that have the samexclassattribute.protected voidspan2OnTitle(org.apache.ecs.ConcreteElement e1, org.apache.ecs.ConcreteElement e2, String s1, String s2, int maxsize, boolean boldfirst) protected voidspanOnTitle(org.apache.ecs.ConcreteElement e, String s, int maxsize) protected org.apache.ecs.ElementMethods inherited from class overit.geocall.basic.ui.Container
alert, applyRule, getBASIC, getBLANK, getRO, getROField, onClose, onOpenChildContainer, onRestore, onRule, prepareName, rulesNewValues, setROField, setValues, setValuesMethods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getCleaner, getConfigurableProperties, getDAValues, getDBLINK, getKEYLABEL, getLABEL, getState, getTITLE, getValues, getWM, isEnabled, isEnabledBasedOnFunction, isFunctionEnabled, isImportant, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setConfiguredProperty, setDBLINK, setENABLED, setFUNCTION, setModelProperties, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, ajaxQuery, appendAttribute, buildDisplayScript, buildSetupScript, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, connect, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, getBoolean, getBoolean, getChildrenComponents, getChildrenContainers, getDefaultLabel, getDefaultLayoutLabel, getEntityContainer, getEntityName, getFullHeight, getGridAlign, getGridCols, getGridRows, getGridVAlign, getHtmlLabel, getHtmlLabel, getIcon, getId, getIdentity, getint, getLayoutLabel, getLayoutName, getNAME, getParentComponent, getParentContainer, getPublishedChildrenList, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isLabelInLine, onInit, setActivable, setActive, setAliasField, setBASIC, setConfigHidden, setDEFAULTHIDDEN, setEntityName, setExtendedField, setFULLHEIGHT, setGRIDALIGN, setGRIDCOLS, setGRIDROWS, setGRIDVALIGN, setICON, setIdentity, setIMPORTANT, setLabel, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setNAME, setREGISTRYNAME, setTooltip, setValuesContainer, stringForJs, tabIndexerMethods inherited from class overit.geocall.platform.ui.UINode
addChild, addChildText, getChildren, getNodeId, getParent, getRoot, getSchema, setNodeId, setParent, setSchemaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.ui.Badgeable
badgeFormat, makeBadgedIconMethods inherited from interface overit.geocall.ui.Hideable
getVISIBLEMethods inherited from interface overit.geocall.clipboard.XClip
getWM
-
Field Details
-
breakChars
-
_visible
-
_mode
protected char _modeDefines the editing policies on the individual tree node. e: editing mode, allows to make those operations that changes the tree's structure (cut, paste, delete, etc.) p: preview mode, allow to make operations that doesen't changes the tree's structure 8copy, edit, view, etc.) -
_changedFrom
-
_changedTo
-
_t
-
_tInedit
-
_cutting
-
_canpaste
protected boolean _canpaste -
_xclass
Filter attribute used in copy and paste and drag and drop actions. We can paste / drop the content only if the origin object has the same xclass of the destination object -
_border
protected boolean _border -
_param
-
_short
protected boolean _short -
_mousebutton
-
_tmShort
-
_msgNodeExpand
-
_msgNodeCollapse
-
_msgEditTitle
-
_msgDeleteTitle
-
_msgDeleteMessage
-
_msgCopyTitle
-
_msgCutTitle
-
_msgPasteTitle
-
_msgPasteMessage
-
_msgInsertBeforeTitle
-
_msgInsertAfterTitle
-
_msgInsertChildTitle
-
_msgInsertParentTitle
-
-
Constructor Details
-
TreeEditor
public TreeEditor()
-
-
Method Details
-
setup
protected void setup()Description copied from class:ComponentSetup the Component -
setXCLASS
Sets a particularxclassto the TreeEditor; this string is used to limit the operations of copy / cut / paste / drag / drop that can be executed only between objects that have the samexclassattribute. If no value is specified, there aren't restriction imposed; otherwise a value can be pasted / dropped on the TreeEditor only if the source component has the samexclassvalue- Parameters:
xclass- The string that defines thexclassfor the element
-
setMOUSEBUTTON
Sets wheter to bring up the contextual menu of individual nodes when the user presses the right or left mouse button.- Parameters:
s- Possible values are:
"l": (default value) the contextual menu appears on left click
"r": the contextual menu appears on right click
-
setMODE
Sets the editing policies on the individual tree node.- Parameters:
s- Possible values are:
"e": (default value) editing mode, allows to make those operations that changes the tree's structure (cut, paste, delete, etc.)
"p": preview mode, allow to make operations that doesen't changes the tree's structure 8copy, edit, view, etc.)
-
setPARAM
Sets a parameter for the events associated to the TreeEditor (like Edit, Delete, Copy, etc)- Parameters:
s- A string that represents the param attribute of the events
-
onOpen
Description copied from class:ContainerMethod called when is executed theWindowManager.push(overit.geocall.basic.ui.Window, java.lang.Object)of theWindowthat contains the Container. It calls the onOpen(o) method of all the Container's childrens.
If a page is opened through the process of a route, it is possible that the route was called with params to pass to the page.
The route params could be passed specifying them like query string's param on the url, using commas or the '=' character, to separate the keys and the values. Valid syntaxs are: "¶ms=KEY1,VAL1,KEY2,VAL2" or "¶ms=KEY1=VAL1,KEY2=VAL2"
In that case it is possible to retrieve those params via theWindowManager.getRouteParams()method that returns anHashGetterwith the params passed as parameters.
For example it's possible to retrieve and use the params in this way:HashGetter hg = getWM().getRouteParams();
String val1 = hg.getString("key1",null);
String val2 = hg.getString("key2",null); -
configureShortMenu
protected void configureShortMenu() -
setTree
Sets aTreeto the TreeEditor- Parameters:
t- The Tree to set
-
getNewNode
Returns a new node- Returns:
- A new node, i.e. an empty
Tree
-
getNewTree
Returns a new tree- Returns:
- An empty
Tree
-
getArcDescription
-
getDropDownItem
@Deprecated protected org.apache.ecs.html.TR getDropDownItem(String event, String param, String icon, String title, String msg, Tree t) Deprecated.ImplementscreateMenu(tree)- Parameters:
event- ImplementscreateMenu(tree)param- ImplementscreateMenu(tree)icon- ImplementscreateMenu(tree)title- ImplementscreateMenu(tree)msg- ImplementscreateMenu(tree)t- ImplementscreateMenu(tree)- Returns:
- Implements
createMenu(tree)
-
getMenuItem
@Deprecated protected org.apache.ecs.html.Div getMenuItem(String event, String param, String icon, String title, String msg, Tree t) Deprecated.The opening of the menu is managed in response to the Ajax OpenMenu event
ImplementscreateMenu(tree)- Parameters:
event- ImplementscreateMenu(tree)param- ImplementscreateMenu(tree)icon- ImplementscreateMenu(tree)title- ImplementscreateMenu(tree)msg- ImplementscreateMenu(tree)t- ImplementscreateMenu(tree)- Returns:
- Implements
createMenu(tree)
-
getMinusPlusButton
-
getUpDownButton
-
getDropDownT
Deprecated.UsecreateMenu(tree)- Parameters:
t- UsecreateMenu(tree)- Returns:
- Use
createMenu(tree)
-
getDropDownMenu
Deprecated.ImplementscreateMenu(tree)- Parameters:
tt- ImplementscreateMenu(tree)- Returns:
- Implements
createMenu(tree)
-
getMenu
Deprecated.ImplementscreateMenu(tree)- Parameters:
t- ImplementscreateMenu(tree)- Returns:
- Implements
createMenu(tree)
-
onOpenMenu
Opens the contextual menu for the node- Parameters:
hg- TheHashGetterused to extract the correct node- Returns:
true
-
createMenu
-
subTree
protected org.apache.ecs.Element subTree(Tree tree, boolean editable, boolean isFirst, boolean isLast) -
getCountInfo
-
setOnClickAction
-
fillNode
-
getTDNodeType
-
getTDAlert
-
fillArcDescription
protected final void fillArcDescription(org.apache.ecs.html.Div dUp, org.apache.ecs.html.Div dDown, Tree t) -
fillArcDescription
protected void fillArcDescription(org.apache.ecs.ConcreteElement dUp, org.apache.ecs.ConcreteElement dDown, Tree tg) -
getChunks
-
spanOnTitle
-
span2OnTitle
-
calcTitle
-
evidence2
-
evidence21
-
bold
-
resolveTree
-
onDelete
Deprecated.- Parameters:
o- UseonDelete(UIMessage)- Returns:
- Use
onDelete(UIMessage)
-
onDelete
Deletes a node from the Tree- Parameters:
uim- TheUIMessageused to extract the correct node to delete- Returns:
falseif something is been deleted,trueotherwise (if the Tree is null or we try to delete the root)
-
doDelete
-
onCopy
Deprecated.- Parameters:
o- UseonCopy(UIMessage)- Returns:
- Use
onCopy(UIMessage)
-
onCopy
Makes a copy of a node of the Tree- Parameters:
uim- TheUIMessageused to extract the correct node to delete- Returns:
falseif something is been copied,trueotherwise (if the Tree is null)
-
doCopy
-
onCut
Deprecated.UseonCut(UIMessage)- Parameters:
o- UseonCut(UIMessage)- Returns:
- Use
onCut(UIMessage)
-
onCut
Cuts of a node of the Tree- Parameters:
uim- TheUIMessageused to extract the correct node to cut- Returns:
falseif something is been cutted,trueotherwise (if the Tree is null or we try to cut the root)
-
doCut
-
onPaste
Deprecated.- Parameters:
o- UseonPaste(UIMessage)- Returns:
- Use
onPaste(UIMessage)
-
onPaste
Pastes a node into the Tree- Parameters:
uim- TheUIMessageused to extract the correct node to cut- Returns:
falseif something is been pasted,trueotherwise
-
doPaste
-
pasteContent
-
getCutting
Gets the cutting node of the Tree- Returns:
- The
Tree
-
freeClip
public void freeClip(boolean delete) - Specified by:
freeClipin interfaceoverit.geocall.clipboard.XClip
-
onInsertBefore
Adds a new node (seegetNewNode()) before the target one- Parameters:
o- TheHashGetterused to extract the correctTreetarget- Returns:
true
-
onInsertAfter
Adds a new node (seegetNewNode()) after the target one- Parameters:
o- TheHashGetterused to extract the correctTreetarget- Returns:
true
-
onInsertChild
Adds a new node (seegetNewNode()) as a child of the target one- Parameters:
o- TheHashGetterused to extract the correctTreetarget- Returns:
true
-
onInsertParent
Adds a new node (seegetNewNode()) as parent of the target one- Parameters:
o- TheHashGetterused to extract the correctTreetarget- Returns:
true
-
onCancel
-
onMinus
Compresses the childs of the node so that in visualization the node appears with no childs- Parameters:
o- TheHashGetterused to extract the correct node- Returns:
true
-
onPlus
Expands the childs of the node prviously compressed- Parameters:
o- TheHashGetterused to extract the correct node- Returns:
true
-
onUp
Compresses the parents of the node so that in visualization the node is positioned as root- Parameters:
o- TheHashGetterused to extract the correct node- Returns:
true
-
onDown
Expands the parents of the node previously compressed- Parameters:
o- TheHashGetterused to extract the correct node- Returns:
true
-
getAlert
-
onClose
Pops the TreeEditor page and returns null to the restored page- Parameters:
o- Not used- Returns:
true
-
onAccept
Node acceptance event; if the node ad a not valid definition, it shows an Alert (seegetTreeAlert())- Parameters:
o- Not used- Returns:
- true
-
getTreeAlert
Returns the string used in the Alert (seeonAccept()) when the node has a not valid definition- Parameters:
tg- The Tree- Returns:
- The string or null
-
getTree
Returns theTreeof the TreeEditor- Returns:
- The Tree managed by the TreeEditor
-
onBorder
Switches the value for the border attribute- Parameters:
o- Not used- Returns:
true
-
onShort
Switches the value for showing the short versione of the contextual node's menu- Parameters:
o- Not used- Returns:
- true
-
isVisible
public boolean isVisible()Checks if the TreeEditor is rendered for the user currently logged in the application, or not (seegetBoolean(visible,id,true)) -
setVISIBLE
Defines if the TreeEditor should be rendered or not- Specified by:
setVISIBLEin interfaceHideable- Parameters:
s- A string that represents a boolean value ("true" or "1", "false" or "0") or a function.
If the string is not recognized as a boolean value, it is considered as a user function with this meaning: if the user currently logged in the application has the function, the table will be rendered, otherwise it will not
-
changedSubTree
-
changedSubTree
-
calcFrameId
Calculates the frame id.- Returns:
- String containing the frame id
-
changed
public void changed(overit.geocall.ux.servlet.processor.Change change) Defines the morphing of the TreeEditor element that occurs when there is an Ajax interaction
Implements theAjaxableComponentinterface.- Specified by:
changedin interfaceAjaxableComponent- Parameters:
change- TheChangeobject that defines the specific morphing type for the TreeEditor
-
getDefaultChange
public overit.geocall.ux.servlet.processor.Change getDefaultChange()- Specified by:
getDefaultChangein interfaceAjaxableComponent- Returns:
- The default
Changeobject that defines the default morphing type of the TreeEditor
-
getHtml
Returns the html code of the TreeEditor -
getFrameHtml
public org.apache.ecs.Element getFrameHtml(overit.geocall.ux.servlet.processor.Change change, EntitySet es) Defines the html part of the TreeEditor that changes when an Ajax interaction occurs.
Implements theAjaxableComponentinterface.- Specified by:
getFrameHtmlin interfaceAjaxableComponent- Parameters:
change- TheChangeobject that defines the specific morphing type for the TreeEditores- Not used - TheEntitySetto which the element belongs- Returns:
- The html part of the TreeEditor that changes when an Ajax interaction occurs
-
applyFilterToChildren
protected boolean applyFilterToChildren()Extends the method, making it returnstrue, to enable the evaluation of the methodTree.isFiltered()during the html code generation of the sub-tree- Returns:
false
-
createMenu(tree)