Class DefaultDataSourceNode

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

public class DefaultDataSourceNode extends 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:
  • Constructor Details

    • DefaultDataSourceNode

      public DefaultDataSourceNode()
      For internal use only
    • DefaultDataSourceNode

      public DefaultDataSourceNode(Object userObject)
      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

      public String getID()
      For internal use only
    • setID

      public void setID(String id)
      For internal use only
    • getLastID

      public String getLastID()
      For internal use only
    • setLastID

      public void setLastID(String lastID)
      For internal use only
    • getRegistryID

      public String getRegistryID()
      For internal use only
    • setRegistryID

      public void setRegistryID(String registryID)
      For internal use only
    • getDescription

      public String getDescription()
      Returns:
      the description
    • setDescription

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