org.openide.src.nodes
Class ClassElementNode

java.lang.Object
  |
  +--java.beans.FeatureDescriptor
        |
        +--org.openide.nodes.Node
              |
              +--org.openide.nodes.AbstractNode
                    |
                    +--org.openide.src.nodes.ElementNode
                          |
                          +--org.openide.src.nodes.MemberElementNode
                                |
                                +--org.openide.src.nodes.ClassElementNode
All Implemented Interfaces:
ElementProperties, org.openide.src.nodes.IconStrings

public class ClassElementNode
extends MemberElementNode

Node representing a Java class.

See Also:
ClassElement

Inner classes inherited from class org.openide.nodes.Node
Node.Cookie, Node.Handle, Node.IndexedProperty, Node.Property, Node.PropertySet
 
Fields inherited from class org.openide.src.nodes.ElementNode
CLASS, CONSTRUCTOR_PACKAGE, CONSTRUCTOR_PRIVATE, CONSTRUCTOR_PROTECTED, CONSTRUCTOR_PUBLIC, CONSTRUCTORS_CATEGORY, element, elementFormat, ERROR, FIELD_PACKAGE, FIELD_PRIVATE, FIELD_PROTECTED, FIELD_PUBLIC, FIELD_ST_PACKAGE, FIELD_ST_PRIVATE, FIELD_ST_PROTECTED, FIELD_ST_PUBLIC, FIELDS_CATEGORY, INITIALIZER, INITIALIZER_ST, INTERFACE, METHOD_PACKAGE, METHOD_PRIVATE, METHOD_PROTECTED, METHOD_PUBLIC, METHOD_ST_PACKAGE, METHOD_ST_PRIVATE, METHOD_ST_PROTECTED, METHOD_ST_PUBLIC, METHODS_CATEGORY, sourceOptions, WAIT, writeable
 
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_NAME, PROP_OPENED_ICON, PROP_PARENT_NODE, PROP_PROPERTY_SETS, PROP_SHORT_DESCRIPTION
 
Fields inherited from interface org.openide.src.ElementProperties
PROP_ALL_CLASSES, PROP_BODY, PROP_CLASS_OR_INTERFACE, PROP_CLASSES, PROP_CONSTRUCTORS, PROP_EXCEPTIONS, PROP_FIELDS, PROP_IMPORTS, PROP_INIT_VALUE, PROP_INITIALIZERS, PROP_INTERFACES, PROP_JAVADOC, PROP_MEMBERS, PROP_METHODS, PROP_MODIFIERS, PROP_NAME, PROP_PACKAGE, PROP_PARAMETERS, PROP_RETURN, PROP_STATIC, PROP_STATUS, PROP_SUPERCLASS, PROP_TYPE, PROP_VALID
 
Constructor Summary
ClassElementNode(ClassElement element, Children children, boolean writeable)
          Create a new class node.
 
Method Summary
 Transferable clipboardCopy()
          Copy this node to the clipboard.
 Transferable clipboardCut()
          Cut this node to the clipboard.
protected  Node.Property createInterfacesProperty(boolean canW)
          Create a node property for the implemented interfaces of this class.
protected  void createPasteTypes(Transferable t, List s)
          Accumulate the paste types that this node can handle for a given transferable.
protected  Sheet createSheet()
          Initialize a default property sheet; commonly overridden.
protected  Node.Property createSuperclassProperty(boolean canW)
          Create a node property for the superclass of this class.
 void destroy()
          Remove this class from its declaring class or source file.
 Component getCustomizer()
          Get the customizer.
 HelpCtx getHelpCtx()
          Get context help associated with this node.
protected  ElementFormat getHintElementFormat()
          Get a format for creating this node's short description.
protected  String[] getIconAffectingProperties()
          Get the names of all element properties which might affect the choice of icon.
 NewType[] getNewTypes()
          Get the new types that can be created in this node.
 boolean hasCustomizer()
          Does this node have a customizer?
protected  String resolveIconBase()
          Get the currently appropriate icon base.
 
Methods inherited from class org.openide.src.nodes.MemberElementNode
createModifiersProperty, createNameProperty, setName
 
Methods inherited from class org.openide.src.nodes.ElementNode
canCopy, canCut, canDestroy, canRename, equals, getCookie, getElementFormat, getHandle, getShortDescription, hashCode, setActions, setElementFormat
 
Methods inherited from class org.openide.nodes.AbstractNode
cloneNode, createActions, drag, getActions, getCookieSet, getDefaultAction, getDropType, getIcon, getOpenedIcon, getPasteTypes, getPropertySets, getSheet, setCookieSet, setDefaultAction, setIconBase, setSheet
 
Methods inherited from class org.openide.nodes.Node
addNodeListener, addPropertyChangeListener, clone, fireCookieChange, fireDisplayNameChange, fireIconChange, fireNameChange, fireNodeDestroyed, fireOpenedIconChange, firePropertyChange, firePropertySetsChange, fireShortDescriptionChange, getChildren, getContextActions, getContextMenu, getParentNode, hasPropertyChangeListener, isLeaf, removeNodeListener, removePropertyChangeListener, setDisplayName, setShortDescription, toString
 
Methods inherited from class java.beans.FeatureDescriptor
attributeNames, getDisplayName, getName, getValue, isExpert, isHidden, isPreferred, setExpert, setHidden, setPreferred, setValue
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassElementNode

public ClassElementNode(ClassElement element,
                        Children children,
                        boolean writeable)
Create a new class node.
Parameters:
element - class element to represent
children - node children
writeable - true to be writable
Method Detail

getHelpCtx

public HelpCtx getHelpCtx()
Description copied from class: Node
Get context help associated with this node.
Overrides:
getHelpCtx in class ElementNode
Following copied from class: org.openide.nodes.Node
Returns:
the context help object (could be null or HelpCtx.DEFAULT_HELP)

resolveIconBase

protected String resolveIconBase()
Description copied from class: ElementNode
Get the currently appropriate icon base. Subclasses should make this sensitive to the state of the element--for example, a private variable may have a different icon than a public one. The icon will be automatically changed whenever a relevant change is made to the element.
Overrides:
resolveIconBase in class ElementNode
Following copied from class: org.openide.src.nodes.ElementNode
Returns:
icon base
See Also:
AbstractNode.setIconBase(java.lang.String)

getIconAffectingProperties

protected String[] getIconAffectingProperties()
Description copied from class: ElementNode
Get the names of all element properties which might affect the choice of icon. The default implementation just returns ElementProperties.PROP_MODIFIERS.
Overrides:
getIconAffectingProperties in class ElementNode
Following copied from class: org.openide.src.nodes.ElementNode
Returns:
the property names, from ElementProperties

getHintElementFormat

protected ElementFormat getHintElementFormat()
Description copied from class: ElementNode
Get a format for creating this node's short description.
Overrides:
getHintElementFormat in class ElementNode

createSheet

protected Sheet createSheet()
Description copied from class: AbstractNode
Initialize a default property sheet; commonly overridden. If AbstractNode.getSheet() is called and there is not yet a sheet, this method is called to allow a subclass to specify its properties.

Warning: Do not call getSheet in this method.

The default implementation returns an empty sheet.

Overrides:
createSheet in class AbstractNode
Following copied from class: org.openide.nodes.AbstractNode
Returns:
the sheet with initialized values (never null)

destroy

public void destroy()
             throws IOException
Remove this class from its declaring class or source file.
Overrides:
destroy in class Node
Throws:
IOException - if the containing element refuses to delete it

getCustomizer

public Component getCustomizer()
Description copied from class: AbstractNode
Get the customizer.
Overrides:
getCustomizer in class AbstractNode
Following copied from class: org.openide.nodes.AbstractNode
Returns:
null in the default implementation

hasCustomizer

public boolean hasCustomizer()
Description copied from class: AbstractNode
Does this node have a customizer?
Overrides:
hasCustomizer in class AbstractNode
Following copied from class: org.openide.nodes.AbstractNode
Returns:
false

createPasteTypes

protected void createPasteTypes(Transferable t,
                                List s)
Description copied from class: AbstractNode
Accumulate the paste types that this node can handle for a given transferable.

The default implementation simply tests whether the transferable supports intelligent pasting via NodeTransfer.findPaste(java.awt.datatransfer.Transferable), and if so, it obtains the paste types from the transfer data and inserts them into the set.

Subclass implementations should typically call super (first or last) so that they add to, rather than replace, a superclass's available paste types; especially as the default implementation in AbstractNode is generally desirable to retain.

Overrides:
createPasteTypes in class AbstractNode
Following copied from class: org.openide.nodes.AbstractNode
Parameters:
t - a transferable containing clipboard data
s - a list of PasteTypes that will have added to it all types valid for this node (ordered as they will be presented to the user)

createSuperclassProperty

protected Node.Property createSuperclassProperty(boolean canW)
Create a node property for the superclass of this class.
Parameters:
canW - if false, property will be read-only
Returns:
the property

createInterfacesProperty

protected Node.Property createInterfacesProperty(boolean canW)
Create a node property for the implemented interfaces of this class. (Or, extended interfaces if this is itself an interface.)
Parameters:
canW - if false, property will be read-only
Returns:
the property

getNewTypes

public NewType[] getNewTypes()
Description copied from class: Node
Get the new types that can be created in this node. For example, a node representing a Java package will permit classes to be added.
Overrides:
getNewTypes in class AbstractNode
Following copied from class: org.openide.nodes.Node
Returns:
array of new type operations that are allowed

clipboardCopy

public Transferable clipboardCopy()
Description copied from class: AbstractNode
Copy this node to the clipboard.
Overrides:
clipboardCopy in class ElementNode
Following copied from class: org.openide.nodes.AbstractNode
Returns:
ExTransferable.Single with one copy flavor
Throws:
IOException - if it could not copy
See Also:
NodeTransfer

clipboardCut

public Transferable clipboardCut()
Description copied from class: AbstractNode
Cut this node to the clipboard.
Overrides:
clipboardCut in class ElementNode
Following copied from class: org.openide.nodes.AbstractNode
Returns:
ExTransferable.Single with one cut flavor
Throws:
IOException - if it could not cut
See Also:
NodeTransfer


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