Class TreeNode
java.lang.Object
org.eclipse.core.runtime.PlatformObject
com.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase
com.ibm.mq.explorer.ui.extensions.TreeNode
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable,org.eclipse.ui.IActionFilter
public abstract class TreeNode
extends com.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase
implements org.eclipse.ui.IActionFilter
Abstract class for classes defining nodes in the TreeViewer in the MQ Navigator View.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMinimum complexity value for a TreeNode to be shown under an Advanced TreeNodestatic final intComplexity value for a complex TreeNodes (under Advanced)static final StringCommon copyright noticestatic final intComplexity value for a QSG TreeNodes (not under Advanced)static final StringCMVC descriptors - expanded during extractionstatic final intComplexity value for a simple TreeNodes (not under Advanced)Fields inherited from class com.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase
ENCODING_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildToNode(TreeNode child, int complex) This method adds the given child to this TreeNode.voidappendToContextMenu(org.eclipse.swt.widgets.Shell shell, org.eclipse.jface.action.IMenuManager manager) appends to the context menu for this TreeNodeabstract intcompares two TreeNodes that are children to this one, and returns their sort order Typically the comparison will based on either the "sequence" or the "title".static intcompareByName(TreeNode child1, TreeNode child2) Compares two child TreeNodes based on their Namesstatic intcompareBySequence(TreeNode child1, TreeNode child2) Compares two child TreeNodes based on their Sequence valuesCreate a File representing this TreeNode, for use when the TreeNode is drag-dropped in FileTransfer format.TreeNode[]Returns an array containing the actual child TreeNodes of this TreeNode (visible and invisible)intReturns the complexity value of this TreeNodeabstract StringReturn the id of the content page to be shown when this TreeNode is selected.abstract StringReturn the id of the infopop to be shown when this TreeNode is selected.abstract org.eclipse.swt.graphics.ImagegetIcon()Return the icon to use for this TreeNodeabstract StringgetId()Return the id of this TreeNode This is called by a class implementing ITreeNodeFactory to identify the a parent TreeNode, so the extension can decide whether to insert additional child treeNodes under this parent.Returns the object associated with this TreeNode.Returns the parent of this TreeNodeGet the id of the owning Plug-in for this TreeNodeReturns the real parent of this TreeNode, i.e.abstract StringReturn the sequence id of this TreeNode This is called by parent TreeNode which chooses to order their child TreeNodes based on their sequence number.Get the Id of this TreeNodeTreeNode[]Returns an array containing the visible child TreeNodes of this TreeNodebooleanReturns whether this TreeNode has childrenabstract booleanGets whether children should only be added to this TreeNode when the TreeNode is expanded, rather than when the Tree is first createdbooleanGets whether this TreeNode is an Advanced TreeNodebooleanisChildExist(String childId) Check whether a child TreeNode with the specified id existsabstract booleanGets whether the context menu for this TreeNode should be created from the associated object rather than from the TreeNodebooleanGet whether this TreeNode is currently expandedstatic booleanisPluginEnabled(String plugin_id) Returns whether the specified plug-in is currently enabled (on the Preferences dialog)booleanReturns whether this TreeNode is currently visiblevoidremoveChildFromNode(TreeNode child) This method removes the given child to this TreeNodevoidRemoves this TreeNode from the MQ Navigator viewvoidsetChildrenVisibility(boolean visible) Set the visibility flag for all children of this TreeNode.voidsetComplexity(int complex) Sets the complexity value of this TreeNodevoidSets the parent of this TreeNodevoidsetPlugin_id(String string) Set the id of the owning Plug-in for this TreeNodevoidsetVisible(boolean isVis) Sets whether this TreeNode is currently visiblebooleantestAttribute(Object target, String name, String value) Returns whether the specific attribute matches the state of the target object.abstract StringtoString()Return the name of this TreeNodevoidupdate()Update the icon and label of this TreeNode, and all its offspringvoidUpdate the icon and label of this TreeNode onlyMethods inherited from class com.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase
addCommonChoicesToContextMenu, addStandardInfoForDragDropFile, createDragDropFile, createImportExportChild, createXMLMementoForDragDropFile, createXMLMementoForExportDragDropFile, getLoadingChildTreeNode, getMqNavigatorView, getNewObjectProvider, getNLSString, getRealChildren, getRealParent, getTreeNodeComparator, getUiStatusProvider, getUniqueIdentifier, hasChildren, isChildrenAdded, isLoadingAChildTreeNode, isLoadingTreeNode, isRealChildrenAdded, openChild, refresh, refreshVisibleChildren, resetTreeNodeId, setChildren, setChildrenAdded, setChildrenVisibility, setExpanded, setLoadingTreeNode, setMqNavigatorView, setNewObjectProvider, setObject, setOwningTreeNode, setRealChildrenAdded, setTreeNodeComparator, setUiStatusProvider, showStatusMethods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
-
Field Details
-
COPYRIGHT_NOTICE
Common copyright notice- See Also:
-
SCCSID
CMVC descriptors - expanded during extraction- See Also:
-
ADVANCED_COMPLEXITY_THRESHOLD
public static final int ADVANCED_COMPLEXITY_THRESHOLDMinimum complexity value for a TreeNode to be shown under an Advanced TreeNode- See Also:
-
SIMPLE_COMPLEXITY
public static final int SIMPLE_COMPLEXITYComplexity value for a simple TreeNodes (not under Advanced)- See Also:
-
QSG_COMPLEXITY
public static final int QSG_COMPLEXITYComplexity value for a QSG TreeNodes (not under Advanced)- See Also:
-
COMPLEX_COMPLEXITY
public static final int COMPLEX_COMPLEXITYComplexity value for a complex TreeNodes (under Advanced)- See Also:
-
-
Constructor Details
-
TreeNode
Constructor- Parameters:
parent- parent TreeNodeobject- object associated with this TreeNodeplugin_id- the id of the owning plug-in
-
-
Method Details
-
toString
Return the name of this TreeNode -
getId
Return the id of this TreeNode This is called by a class implementing ITreeNodeFactory to identify the a parent TreeNode, so the extension can decide whether to insert additional child treeNodes under this parent.- Returns:
- returns the id of this TreeNode
-
getSequence
Return the sequence id of this TreeNode This is called by parent TreeNode which chooses to order their child TreeNodes based on their sequence number.- Returns:
- returns the sequence id of this TreeNode
-
getContentPageId
Return the id of the content page to be shown when this TreeNode is selected.- Returns:
- returns the content page id associated with this TreeNode
-
getHelpId
Return the id of the infopop to be shown when this TreeNode is selected.- Returns:
- returns the help id associated with this TreeNode
-
getIcon
public abstract org.eclipse.swt.graphics.Image getIcon()Return the icon to use for this TreeNode- Returns:
- returns the icon to use for this TreeNode, or null if the stanard folder icon is to be used
-
compare
compares two TreeNodes that are children to this one, and returns their sort order Typically the comparison will based on either the "sequence" or the "title".- Parameters:
child1- first child for comparisonchild2- second child for comparison- Returns:
- how child1 compares to child2
-
isContextMenuFromUiObject
public abstract boolean isContextMenuFromUiObject()Gets whether the context menu for this TreeNode should be created from the associated object rather than from the TreeNode- Returns:
- returns true if the context menu should be created from the associated object
-
appendToContextMenu
public void appendToContextMenu(org.eclipse.swt.widgets.Shell shell, org.eclipse.jface.action.IMenuManager manager) appends to the context menu for this TreeNode- Parameters:
shell- the Shell to usemanager- the Menu Manager
-
isAddChildrenWhenExpanded
public abstract boolean isAddChildrenWhenExpanded()Gets whether children should only be added to this TreeNode when the TreeNode is expanded, rather than when the Tree is first created- Returns:
- returns true if children should only be added to this TreeNode when the TreeNode is expanded
-
testAttribute
Returns whether the specific attribute matches the state of the target object.- Specified by:
testAttributein interfaceorg.eclipse.ui.IActionFilter- Parameters:
target- the target objectname- the attribute namevalue- the attribute value- Returns:
- boolean true if the attribute matches; false otherwise
-
isPluginEnabled
Returns whether the specified plug-in is currently enabled (on the Preferences dialog)- Parameters:
plugin_id- the id of the plug-in to test- Returns:
- boolean true if currently enabled, false otherwise
-
addChildToNode
This method adds the given child to this TreeNode."complexity" is a hint that the extension gives to explorer, ranging from 0 (easiest) to 10 (hardest). A value of 0 will interpreted by explorer as "easy" and 10 will be interpreted as "hard",
In the current implementation of explorer a "complexity" up and including 5 the TreeNode will be added immediately under the parent TreeNode. Otherwise an "Advanced" folder will be added under the parent and the child TreeNode added under the Advanced TreeNode.
- Overrides:
addChildToNodein classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Parameters:
child- the childTreeNode to addcomplex- the complexity value for the child being added
-
removeChildFromNode
This method removes the given child to this TreeNode- Overrides:
removeChildFromNodein classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Parameters:
child- the child TreeNode to remove
-
getParent
Returns the parent of this TreeNode- Overrides:
getParentin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- TreeNode the parent TreeNode
-
getRealParent
Returns the real parent of this TreeNode, i.e. not an advanced TreeNode- Returns:
- TreeNode the real parent TreeNode
-
setParent
Sets the parent of this TreeNode- Overrides:
setParentin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Parameters:
newParent- the new parent for this TreeNode
-
getVisibleChildren
Returns an array containing the visible child TreeNodes of this TreeNode- Returns:
- TreeNode[] an array of child TreeNodes
-
getChildren
Returns an array containing the actual child TreeNodes of this TreeNode (visible and invisible)- Overrides:
getChildrenin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- TreeNode[] an array of child TreeNodes
-
hasChildren
public boolean hasChildren()Returns whether this TreeNode has children- Overrides:
hasChildrenin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- boolean true if this TreeNode has any children, false otherwise
-
getObject
Returns the object associated with this TreeNode.- Overrides:
getObjectin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- Object the associated object
-
setComplexity
public void setComplexity(int complex) Sets the complexity value of this TreeNode- Overrides:
setComplexityin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Parameters:
complex- the complexity value for this TreeNode
-
getComplexity
public int getComplexity()Returns the complexity value of this TreeNode- Overrides:
getComplexityin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- int the complexity value for this TreeNode
-
compareBySequence
Compares two child TreeNodes based on their Sequence values- Parameters:
child1- the first child TreeNode for comparisonchild2- the second child TreeNode for comparison- Returns:
- int how child1 compares to child2
-
compareByName
Compares two child TreeNodes based on their Names- Parameters:
child1- the first child TreeNode for comparisonchild2- the second child TreeNode for comparison- Returns:
- int how child1 compares to child2
-
setVisible
public void setVisible(boolean isVis) Sets whether this TreeNode is currently visible- Overrides:
setVisiblein classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Parameters:
isVis- true if the TreeNode is to be made visible, false otherwise
-
setChildrenVisibility
public void setChildrenVisibility(boolean visible) Set the visibility flag for all children of this TreeNode.- Parameters:
visible- true if all children of the TreeNode are to be visible, false otherwise
-
isVisible
public boolean isVisible()Returns whether this TreeNode is currently visible- Overrides:
isVisiblein classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- boolean true if this TreeNode is currently visible, false otherwise
-
isChildExist
Check whether a child TreeNode with the specified id exists- Overrides:
isChildExistin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Parameters:
childId- child id to test- Returns:
- boolean true if a child TreeNode with the specified id exists, false otherwise
-
getTreeNodeId
Get the Id of this TreeNode- Overrides:
getTreeNodeIdin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- String the Id of this TreeNode
-
getPlugin_id
Get the id of the owning Plug-in for this TreeNode- Overrides:
getPlugin_idin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- String the id of the owning Plug-in
-
setPlugin_id
Set the id of the owning Plug-in for this TreeNode- Overrides:
setPlugin_idin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Parameters:
string- the id of the owning Plug-in for this TreeNode
-
isExpanded
public boolean isExpanded()Get whether this TreeNode is currently expanded- Overrides:
isExpandedin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- boolean true if the TreeNode is currently expanded, false otherwise
-
isAdvancedTreeNode
public boolean isAdvancedTreeNode()Gets whether this TreeNode is an Advanced TreeNode- Overrides:
isAdvancedTreeNodein classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- boolean returns true if this is an advanced TreeNode.
-
update
public void update()Update the icon and label of this TreeNode, and all its offspring- Overrides:
updatein classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase
-
updateItem
public void updateItem()Update the icon and label of this TreeNode only- Overrides:
updateItemin classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase
-
createDragDropFile
Create a File representing this TreeNode, for use when the TreeNode is drag-dropped in FileTransfer format. This default implementation creates an XML file with the following keys defined:- Name
- Id
- PluginId
-
Parent
- Name
- Id
- PluginId
These keys are defined in the class DragDropFile.java. Override this method as required.
- Overrides:
createDragDropFilein classcom.ibm.mq.explorer.ui.internal.navigator.TreeNodeBase- Returns:
- File the created file
-