Class DefaultDataSourceNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
quadbase.datasourcemanager.manager.DefaultDataSourceNode
- All Implemented Interfaces:
Serializable,Cloneable,MutableTreeNode,TreeNode
All tree nodes used by the datasource manager should extend this class. This class gives the
developer control over specific permissions for a tree node. These permissions are only used to
determine which buttons should be enabled or disabled in the datasource manager window.
Permissions for each node should be set in the 'DataSourceManagerListener.modifyDataSourceTree'
method.
For example, the following sample code will cause the 'Add' button to be disabled whenever the database node is selected. This will effectively prevent the user from adding any new databases.
For example, the following sample code will cause the 'Add' button to be disabled whenever the database node is selected. This will effectively prevent the user from adding any new databases.
public class myDSMListener extends DataSourceManagerListener {
public JTree modifyDataSourceTree(JTree tree) {
DefaultDataSourceNode databaseNode = tree.getModel().getRoot().getFirstChild();
databaseNode.setAddAllowed(false);
}
}
- See Also:
-
Field Summary
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject -
Constructor Summary
ConstructorsConstructorDescriptionFor internal use onlyDefaultDataSourceNode(Object userObject) For internal use only -
Method Summary
Modifier and TypeMethodDescriptiongetID()For internal use onlyFor internal use onlyFor internal use onlybooleanDetermine if the 'Add' button is enabled when this node is selected.booleanDetermine if the 'Copy' button is enabled when this node is selected.booleanDetermine if the 'Edit' button is enabled when this node is selected.booleanDetermine if the 'Next' button is enabled when this node is selected.booleanDetermine if the 'Remove' button is enabled when this node is selected.booleanDetermine if the 'Update' button is enabled when this node is selected.voidsetAddEnabled(boolean state) Specify if the 'Add' button is enabled when this node is selected.voidsetCopyEnabled(boolean state) Specify if the 'Copy' button is enabled when this node is selected.voidsetDescription(String description) voidsetEditEnabled(boolean state) Specify if the 'Edit' button is enabled when this node is selected.voidFor internal use onlyvoidFor internal use onlyvoidsetNextEnabled(boolean state) Specify if the 'Next' button is enabled when this node is selected.voidsetRegistryID(String registryID) For internal use onlyvoidsetRemoveEnabled(boolean state) Specify if the 'Remove' button is enabled when this node is selected.voidsetUpdateEnabled(boolean state) Specify if the 'Update' button is enabled when this node is selected.Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
-
Constructor Details
-
DefaultDataSourceNode
public DefaultDataSourceNode()For internal use only -
DefaultDataSourceNode
For internal use only
-
-
Method Details
-
isEditEnabled
public boolean isEditEnabled()Determine if the 'Edit' button is enabled when this node is selected. The default value is true. However, this method is just one of the many conditions that are used to determine if the button is enabled. Therefore, even 'edit enabled' is set to true, the button will not be enabled unless all conditions are true. In contrast, setting 'edit enabled' to false will guarantee that edit is disabled. Nodes that are editable by default include query nodes, dataview nodes, dataview query nodes, etc. -
isCopyEnabled
public boolean isCopyEnabled()Determine if the 'Copy' button is enabled when this node is selected. The default value is true. However, this method is just one of the many conditions that are used to determine if the button is enabled. Therefore, even 'copy enabled' is set to true, the button will not be enabled unless all conditions are true. In contrast, setting 'edit enabled' to false will guarantee that copy is disabled. Nodes that are copyable by default include query nodes, dataview nodes, dataview query nodes, etc. -
isUpdateEnabled
public boolean isUpdateEnabled()Determine if the 'Update' button is enabled when this node is selected. The default value is true. However, this method is just one of the many conditions that are used to determine if the button is enabled. Therefore, even 'update enabled' is set to true, the button will not be enabled unless all conditions are true. In contrast, setting 'update enabled' to false will guarantee that copy is disabled. Nodes that are updatable by default include dataview nodes, dataview query nodes, etc. -
isAddEnabled
public boolean isAddEnabled()Determine if the 'Add' button is enabled when this node is selected. The default value is true. However, this method is just one of the many conditions that are used to determine if the button is enabled. Therefore, even 'add enabled' is set to true, the button will not be enabled unless all conditions are true. In contrast, setting 'add enabled' to false will guarantee that add is disabled. Making add disabled will prevent a user from adding any children to this node. -
isRemoveEnabled
public boolean isRemoveEnabled()Determine if the 'Remove' button is enabled when this node is selected. The default value is true. However, this method is just one of the many conditions that are used to determine if the button is enabled. Therefore, even 'remove enabled' is set to true, the button will not be enabled unless all conditions are true. In contrast, setting 'remove enabled' to false will guarantee that remove is disabled. -
isNextEnabled
public boolean isNextEnabled()Determine if the 'Next' button is enabled when this node is selected. The default value is true. However, this method is just one of the many conditions that are used to determine if the button is enabled. Therefore, even 'next enabled' is set to true, the button will not be enabled unless all conditions are true. In contrast, setting 'next enabled' to false will guarantee that next is disabled. Making next disabled will prevent a user from using this node to create a report. -
setEditEnabled
public void setEditEnabled(boolean state) Specify if the 'Edit' button is enabled when this node is selected.- See Also:
-
setCopyEnabled
public void setCopyEnabled(boolean state) Specify if the 'Copy' button is enabled when this node is selected.- See Also:
-
setUpdateEnabled
public void setUpdateEnabled(boolean state) Specify if the 'Update' button is enabled when this node is selected.- See Also:
-
setAddEnabled
public void setAddEnabled(boolean state) Specify if the 'Add' button is enabled when this node is selected.- See Also:
-
setRemoveEnabled
public void setRemoveEnabled(boolean state) Specify if the 'Remove' button is enabled when this node is selected.- See Also:
-
setNextEnabled
public void setNextEnabled(boolean state) Specify if the 'Next' button is enabled when this node is selected.- See Also:
-
getID
For internal use only -
setID
For internal use only -
getLastID
For internal use only -
setLastID
For internal use only -
getRegistryID
For internal use only -
setRegistryID
For internal use only -
getDescription
- Returns:
- the description
-
setDescription
- Parameters:
description- the description to set
-