org.netbeans.modules.db/1 1.44.1 30

org.netbeans.api.db.explorer.node
Class BaseNode

java.lang.Object
  extended by java.beans.FeatureDescriptor
      extended by org.openide.nodes.Node
          extended by org.openide.nodes.AbstractNode
              extended by org.netbeans.api.db.explorer.node.BaseNode
All Implemented Interfaces:
HelpCtx.Provider, Lookup.Provider

public abstract class BaseNode
extends AbstractNode

This is the base class for all database explorer nodes. It takes care of setting up its Lookup and registering the child factory.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.openide.nodes.Node
Node.Cookie, Node.Handle, Node.IndexedProperty<T,E>, Node.Property<T>, Node.PropertySet
 
Field Summary
protected static String CATALOG
           
protected static String CATALOGDESC
           
protected static String COLUMNSIZE
           
protected static String COLUMNSIZEDESC
           
protected static String DATABASEURL
           
protected static String DATABASEURLDESC
           
protected static String DATATYPE
           
protected static String DATATYPEDESC
           
protected static String DIGITS
           
protected static String DIGITSDESC
           
protected static String DISPLAYNAME
           
protected static String DISPLAYNAMEDESC
           
protected static String DRIVER
           
protected static String DRIVERDESC
           
protected static String FKPOSITION
           
protected static String FKPOSITIONDESC
           
protected static String FKREFERREDCOLUMN
           
protected static String FKREFERREDCOLUMNDESC
           
protected static String FKREFERREDSCHEMA
           
protected static String FKREFERREDSCHEMADESC
           
protected static String FKREFERREDTABLE
           
protected static String FKREFERREDTABLEDESC
           
protected static String FKREFERRINGCOLUMN
           
protected static String FKREFERRINGCOLUMNDESC
           
protected static String FKREFERRINGSCHEMA
           
protected static String FKREFERRINGSCHEMADESC
           
protected static String FKREFERRINGTABLE
           
protected static String FKREFERRINGTABLEDESC
           
 boolean isRemoved
           
protected static String NULL
           
protected static String NULLDESC
           
protected static String POSITION
           
protected static String POSITIONDESC
           
protected static String PROP_DEFCATALOG
           
protected static String PROP_DEFCATALOGDESC
           
protected static String PROP_DEFSCHEMA
           
protected static String PROP_DEFSCHEMADESC
           
protected static String REMEMBERPW
           
protected static String REMEMBERPWDESC
           
protected static String SCHEMA
           
protected static String SCHEMADESC
           
protected static String TYPE
           
protected static String TYPEDESC
           
protected static String UNIQUE
           
protected static String UNIQUEDESC
           
protected static String USER
           
protected static String USERDESC
           
 
Fields inherited from class org.openide.nodes.AbstractNode
displayFormat, systemActions
 
Fields inherited from class org.openide.nodes.Node
EMPTY, PROP_COOKIE, PROP_DISPLAY_NAME, PROP_ICON, PROP_LEAF, PROP_NAME, PROP_OPENED_ICON, PROP_PARENT_NODE, PROP_PROPERTY_SETS, PROP_SHORT_DESCRIPTION
 
Constructor Summary
BaseNode(ChildNodeFactory childFactory, org.netbeans.modules.db.explorer.node.NodeDataLookup dataLookup, String layerEntry, NodeProvider provider)
          Constructor for nodes with children.
BaseNode(org.netbeans.modules.db.explorer.node.NodeDataLookup dataLookup, String layerEntry, NodeProvider provider)
          Constructor for nodes without children.
 
Method Summary
protected  void addProperty(Node.Property nps)
           
protected  void addProperty(String name, String desc, Class clazz, boolean writeable, Object value)
           
 boolean canCopy()
           
 boolean canCut()
           
 boolean canDestroy()
          Determine if this node can be destroyed.
 boolean canRename()
           
protected  void clearProperties()
           
protected  Sheet createSheet()
           
 void destroy()
          Destroy the node.
 Action[] getActions(boolean context)
          Gets the actions associated with this node.
 Collection<? extends Node> getChildNodes()
           
 Collection<? extends Node> getChildNodesSync()
          Get the list of child nodes.
abstract  String getIconBase()
          Get the icon base for the current state of the node.
abstract  String getName()
          Get the name for the current state of the node.
 org.netbeans.modules.db.explorer.node.NodeRegistry getNodeRegistry()
           
 Collection<Node.Property> getProperties()
           
 Object getPropertyValue(String key)
           
protected abstract  void initialize()
          Initialize the node.
 void refresh()
           
protected  void remove()
           
protected  void remove(boolean refreshProvider)
           
 void setPropertyValue(Node.Property nps, Object val)
           
protected  void setup()
          Set up the node
 void update()
          Updates the node.
protected  void updateProperties()
          Updates the basic node properties.
 
Methods inherited from class org.openide.nodes.AbstractNode
clipboardCopy, clipboardCut, cloneNode, createActions, createPasteTypes, drag, getActions, getCookie, getCookieSet, getCustomizer, getDefaultAction, getDropType, getHandle, getHelpCtx, getIcon, getNewTypes, getOpenedIcon, getPasteTypes, getPreferredAction, getPropertySets, getSheet, hasCustomizer, setCookieSet, setDefaultAction, setIconBase, setIconBaseWithExtension, setName, setSheet
 
Methods inherited from class org.openide.nodes.Node
addNodeListener, addPropertyChangeListener, clone, equals, fireCookieChange, fireDisplayNameChange, fireIconChange, fireNameChange, fireNodeDestroyed, fireOpenedIconChange, firePropertyChange, firePropertySetsChange, fireShortDescriptionChange, getChildren, getContextActions, getContextMenu, getHtmlDisplayName, getLookup, getParentNode, hashCode, hasPropertyChangeListener, isLeaf, removeNodeListener, removePropertyChangeListener, setChildren, setDisplayName, setHidden, setShortDescription, toString
 
Methods inherited from class java.beans.FeatureDescriptor
attributeNames, getDisplayName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setExpert, setPreferred, setValue
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DATABASEURL

protected static final String DATABASEURL
See Also:
Constant Field Values

DATABASEURLDESC

protected static final String DATABASEURLDESC
See Also:
Constant Field Values

DRIVER

protected static final String DRIVER
See Also:
Constant Field Values

DRIVERDESC

protected static final String DRIVERDESC
See Also:
Constant Field Values

SCHEMA

protected static final String SCHEMA
See Also:
Constant Field Values

SCHEMADESC

protected static final String SCHEMADESC
See Also:
Constant Field Values

PROP_DEFSCHEMA

protected static final String PROP_DEFSCHEMA
See Also:
Constant Field Values

PROP_DEFSCHEMADESC

protected static final String PROP_DEFSCHEMADESC
See Also:
Constant Field Values

PROP_DEFCATALOG

protected static final String PROP_DEFCATALOG
See Also:
Constant Field Values

PROP_DEFCATALOGDESC

protected static final String PROP_DEFCATALOGDESC
See Also:
Constant Field Values

USER

protected static final String USER
See Also:
Constant Field Values

USERDESC

protected static final String USERDESC
See Also:
Constant Field Values

REMEMBERPW

protected static final String REMEMBERPW
See Also:
Constant Field Values

REMEMBERPWDESC

protected static final String REMEMBERPWDESC
See Also:
Constant Field Values

CATALOG

protected static final String CATALOG
See Also:
Constant Field Values

CATALOGDESC

protected static final String CATALOGDESC
See Also:
Constant Field Values

DISPLAYNAME

protected static final String DISPLAYNAME
See Also:
Constant Field Values

DISPLAYNAMEDESC

protected static final String DISPLAYNAMEDESC
See Also:
Constant Field Values

UNIQUE

protected static final String UNIQUE
See Also:
Constant Field Values

UNIQUEDESC

protected static final String UNIQUEDESC
See Also:
Constant Field Values

NULL

protected static final String NULL
See Also:
Constant Field Values

NULLDESC

protected static final String NULLDESC
See Also:
Constant Field Values

TYPE

protected static final String TYPE
See Also:
Constant Field Values

TYPEDESC

protected static final String TYPEDESC
See Also:
Constant Field Values

DATATYPE

protected static final String DATATYPE
See Also:
Constant Field Values

DATATYPEDESC

protected static final String DATATYPEDESC
See Also:
Constant Field Values

COLUMNSIZE

protected static final String COLUMNSIZE
See Also:
Constant Field Values

COLUMNSIZEDESC

protected static final String COLUMNSIZEDESC
See Also:
Constant Field Values

DIGITS

protected static final String DIGITS
See Also:
Constant Field Values

DIGITSDESC

protected static final String DIGITSDESC
See Also:
Constant Field Values

POSITION

protected static final String POSITION
See Also:
Constant Field Values

POSITIONDESC

protected static final String POSITIONDESC
See Also:
Constant Field Values

FKPOSITION

protected static final String FKPOSITION
See Also:
Constant Field Values

FKPOSITIONDESC

protected static final String FKPOSITIONDESC
See Also:
Constant Field Values

FKREFERRINGSCHEMA

protected static final String FKREFERRINGSCHEMA
See Also:
Constant Field Values

FKREFERRINGSCHEMADESC

protected static final String FKREFERRINGSCHEMADESC
See Also:
Constant Field Values

FKREFERRINGTABLE

protected static final String FKREFERRINGTABLE
See Also:
Constant Field Values

FKREFERRINGTABLEDESC

protected static final String FKREFERRINGTABLEDESC
See Also:
Constant Field Values

FKREFERRINGCOLUMN

protected static final String FKREFERRINGCOLUMN
See Also:
Constant Field Values

FKREFERRINGCOLUMNDESC

protected static final String FKREFERRINGCOLUMNDESC
See Also:
Constant Field Values

FKREFERREDSCHEMA

protected static final String FKREFERREDSCHEMA
See Also:
Constant Field Values

FKREFERREDSCHEMADESC

protected static final String FKREFERREDSCHEMADESC
See Also:
Constant Field Values

FKREFERREDTABLE

protected static final String FKREFERREDTABLE
See Also:
Constant Field Values

FKREFERREDTABLEDESC

protected static final String FKREFERREDTABLEDESC
See Also:
Constant Field Values

FKREFERREDCOLUMN

protected static final String FKREFERREDCOLUMN
See Also:
Constant Field Values

FKREFERREDCOLUMNDESC

protected static final String FKREFERREDCOLUMNDESC
See Also:
Constant Field Values

isRemoved

public boolean isRemoved
Constructor Detail

BaseNode

public BaseNode(org.netbeans.modules.db.explorer.node.NodeDataLookup dataLookup,
                String layerEntry,
                NodeProvider provider)
Constructor for nodes without children.

Parameters:
dataLookup - the data lookup for this node

BaseNode

public BaseNode(ChildNodeFactory childFactory,
                org.netbeans.modules.db.explorer.node.NodeDataLookup dataLookup,
                String layerEntry,
                NodeProvider provider)
Constructor for nodes with children.

Parameters:
childFactory - the child factory used to create children of this node
dataLookup - the data lookup for this node
Method Detail

initialize

protected abstract void initialize()
Initialize the node. This method is called before the creation process completes so that the sub class can perform any initialization it requires.


getNodeRegistry

public org.netbeans.modules.db.explorer.node.NodeRegistry getNodeRegistry()

refresh

public void refresh()

setup

protected void setup()
Set up the node

Parameters:
dataLookup - the data lookup
layerEntry - the name of the layer entry folder
factory - the associated child node factory, or null if this node doesn't provide child nodes.

remove

protected void remove()

remove

protected void remove(boolean refreshProvider)

getChildNodesSync

public Collection<? extends Node> getChildNodesSync()
Get the list of child nodes.

Returns:
the list of child nodes.

getChildNodes

public Collection<? extends Node> getChildNodes()

update

public void update()
Updates the node.


updateProperties

protected void updateProperties()
Updates the basic node properties.


clearProperties

protected void clearProperties()

addProperty

protected void addProperty(Node.Property nps)

addProperty

protected void addProperty(String name,
                           String desc,
                           Class clazz,
                           boolean writeable,
                           Object value)

setPropertyValue

public void setPropertyValue(Node.Property nps,
                             Object val)

getPropertyValue

public Object getPropertyValue(String key)

getProperties

public Collection<Node.Property> getProperties()

createSheet

protected Sheet createSheet()
Overrides:
createSheet in class AbstractNode

getActions

public Action[] getActions(boolean context)
Gets the actions associated with this node.

Overrides:
getActions in class Node
Parameters:
context - true if this is for a context menu, false otherwise
Returns:
an array of Actions

getIconBase

public abstract String getIconBase()
Get the icon base for the current state of the node.

Returns:
the icon base

getName

public abstract String getName()
Get the name for the current state of the node.

Overrides:
getName in class FeatureDescriptor
Returns:
the name

destroy

public void destroy()
Destroy the node.

Overrides:
destroy in class Node

canDestroy

public boolean canDestroy()
Determine if this node can be destroyed.

Overrides:
canDestroy in class AbstractNode
Returns:
true if it can, false otherwise

canRename

public boolean canRename()
Overrides:
canRename in class AbstractNode

canCut

public boolean canCut()
Overrides:
canCut in class AbstractNode

canCopy

public boolean canCopy()
Overrides:
canCopy in class AbstractNode

org.netbeans.modules.db/1 1.44.1 30

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.