EspressReport 6.6

quadbase.datasourcemanager.manager
Class DefaultDataSourceNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by quadbase.datasourcemanager.manager.DefaultDataSourceNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class DefaultDataSourceNode
extends javax.swing.tree.DefaultMutableTreeNode

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.

 public class myDSMListener extends DataSourceManagerListener {
 
        public JTree modifyDataSourceTree(JTree tree) {
                DefaultDataSourceNode databaseNode = tree.getModel().getRoot().getFirstChild();
                databaseNode.setAddAllowed(false);
        }
 }
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
DefaultDataSourceNode()
          For internal use only
DefaultDataSourceNode(java.lang.Object userObject)
          For internal use only
 
Method Summary
 java.lang.String getDescription()
           
 java.lang.String getID()
          For internal use only
 java.lang.String getLastID()
          For internal use only
 java.lang.String getRegistryID()
          For internal use only
 boolean isAddEnabled()
          Determine if the 'Add' button is enabled when this node is selected.
 boolean isCopyEnabled()
          Determine if the 'Copy' button is enabled when this node is selected.
 boolean isEditEnabled()
          Determine if the 'Edit' button is enabled when this node is selected.
 boolean isNextEnabled()
          Determine if the 'Next' button is enabled when this node is selected.
 boolean isRemoveEnabled()
          Determine if the 'Remove' button is enabled when this node is selected.
 boolean isUpdateEnabled()
          Determine if the 'Update' button is enabled when this node is selected.
 void setAddEnabled(boolean state)
          Specify if the 'Add' button is enabled when this node is selected.
 void setCopyEnabled(boolean state)
          Specify if the 'Copy' button is enabled when this node is selected.
 void setDescription(java.lang.String description)
           
 void setEditEnabled(boolean state)
          Specify if the 'Edit' button is enabled when this node is selected.
 void setID(java.lang.String id)
          For internal use only
 void setLastID(java.lang.String lastID)
          For internal use only
 void setNextEnabled(boolean state)
          Specify if the 'Next' button is enabled when this node is selected.
 void setRegistryID(java.lang.String registryID)
          For internal use only
 void setRemoveEnabled(boolean state)
          Specify if the 'Remove' button is enabled when this node is selected.
 void setUpdateEnabled(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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultDataSourceNode

public DefaultDataSourceNode()
For internal use only


DefaultDataSourceNode

public DefaultDataSourceNode(java.lang.Object userObject)
For internal use only

Method Detail

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:
isEditEnabled()

setCopyEnabled

public void setCopyEnabled(boolean state)
Specify if the 'Copy' button is enabled when this node is selected.

See Also:
isCopyEnabled()

setUpdateEnabled

public void setUpdateEnabled(boolean state)
Specify if the 'Update' button is enabled when this node is selected.

See Also:
isCopyEnabled()

setAddEnabled

public void setAddEnabled(boolean state)
Specify if the 'Add' button is enabled when this node is selected.

See Also:
isAddEnabled()

setRemoveEnabled

public void setRemoveEnabled(boolean state)
Specify if the 'Remove' button is enabled when this node is selected.

See Also:
isRemoveEnabled()

setNextEnabled

public void setNextEnabled(boolean state)
Specify if the 'Next' button is enabled when this node is selected.

See Also:
isNextEnabled()

getID

public java.lang.String getID()
For internal use only


setID

public void setID(java.lang.String id)
For internal use only


getLastID

public java.lang.String getLastID()
For internal use only


setLastID

public void setLastID(java.lang.String lastID)
For internal use only


getRegistryID

public java.lang.String getRegistryID()
For internal use only


setRegistryID

public void setRegistryID(java.lang.String registryID)
For internal use only


getDescription

public java.lang.String getDescription()
Returns:
the description

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - the description to set

EspressReport 6.6