net.refractions.udig.style.sld.editor
Class EditorNode

java.lang.Object
  extended by net.refractions.udig.style.sld.editor.EditorNode

public class EditorNode
extends java.lang.Object

The EditorNode is the abstract class for all page nodes.


Field Summary
static java.lang.String ATT_CATEGORY
           
static java.lang.String ATT_CLASS
           
static java.lang.String ATT_ICON
           
static java.lang.String ATT_ID
           
static java.lang.String ATT_LABEL
           
static java.lang.String ATT_REQUIRES
           
 
Constructor Summary
EditorNode(java.lang.String id)
          Creates a new preference node with the given id.
EditorNode(java.lang.String id, IConfigurationElement configurationElement)
          Create a new instance of the receiver.
EditorNode(java.lang.String id, java.lang.String label, ImageDescriptor image, java.lang.String className)
          Creates a preference node with the given id, label, and image, and lazily-loaded preference page.
 
Method Summary
 void add(EditorNode node)
           
 void clearKeywords()
          Clear the keyword cache, if any.
static java.lang.Object createExtension(IConfigurationElement element, java.lang.String classAttribute)
          Creates an extension.
 void createPage(Composite parent, IEditorPageContainer container)
          Creates the page this node stands for.
 void disposeResources()
           
 EditorNode findSubNode(java.lang.String id)
           
 java.lang.String getCategory()
          Return the category name for the node.
 IConfigurationElement getConfigurationElement()
          Return the configuration element.
 java.lang.String getId()
           
 ImageDescriptor getImageDescriptor()
          Returns the image descriptor for this node.
 java.util.Collection getKeywordLabels()
          Get the labels of all of the keywords of the receiver.
 java.util.Collection getKeywordReferences()
          Get the ids of the keywords the receiver is bound to.
 Image getLabelImage()
           
 java.lang.String getLabelText()
           
 java.lang.String getLocalId()
           
 IEditorPage getPage()
           
 java.lang.String getPluginId()
           
 java.lang.String getRequires()
          Return the required class the layer must resolve to.
 EditorNode[] getSubNodes()
           
 boolean remove(EditorNode node)
           
 EditorNode remove(java.lang.String id)
           
 void setPage(IStyleEditorPage newPage)
          Set the current page to be newPage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATT_CLASS

public static final java.lang.String ATT_CLASS
See Also:
Constant Field Values

ATT_ID

public static final java.lang.String ATT_ID
See Also:
Constant Field Values

ATT_ICON

public static final java.lang.String ATT_ICON
See Also:
Constant Field Values

ATT_LABEL

public static final java.lang.String ATT_LABEL
See Also:
Constant Field Values

ATT_CATEGORY

public static final java.lang.String ATT_CATEGORY
See Also:
Constant Field Values

ATT_REQUIRES

public static final java.lang.String ATT_REQUIRES
See Also:
Constant Field Values
Constructor Detail

EditorNode

public EditorNode(java.lang.String id,
                  IConfigurationElement configurationElement)
Create a new instance of the receiver.

Parameters:
id -
configurationElement -

EditorNode

public EditorNode(java.lang.String id)
Creates a new preference node with the given id. The new node has no subnodes.

Parameters:
id - the node id

EditorNode

public EditorNode(java.lang.String id,
                  java.lang.String label,
                  ImageDescriptor image,
                  java.lang.String className)
Creates a preference node with the given id, label, and image, and lazily-loaded preference page. The preference node assumes (sole) responsibility for disposing of the image; this will happen when the node is disposed.

Parameters:
id - the node id
label - the label used to display the node in the preference dialog's tree
image - the image displayed left of the label in the preference dialog's tree, or null if none
className - the class name of the preference page; this class must implement IPreferencePage
Method Detail

getKeywordReferences

public java.util.Collection getKeywordReferences()
Get the ids of the keywords the receiver is bound to.

Returns:
Collection of String. Never null.

getKeywordLabels

public java.util.Collection getKeywordLabels()
Get the labels of all of the keywords of the receiver.

Returns:
Collection of String. Never null.

clearKeywords

public void clearKeywords()
Clear the keyword cache, if any.


disposeResources

public void disposeResources()

getLabelImage

public Image getLabelImage()

getLabelText

public java.lang.String getLabelText()

getImageDescriptor

public ImageDescriptor getImageDescriptor()
Returns the image descriptor for this node.

Returns:
the image descriptor

getConfigurationElement

public IConfigurationElement getConfigurationElement()
Return the configuration element.

Returns:
the configuration element

getLocalId

public java.lang.String getLocalId()

getPluginId

public java.lang.String getPluginId()

createPage

public void createPage(Composite parent,
                       IEditorPageContainer container)
Creates the page this node stands for. The page is created, but its composite won't exist


getCategory

public java.lang.String getCategory()
Return the category name for the node.

Returns:
java.lang.String

getRequires

public java.lang.String getRequires()
Return the required class the layer must resolve to.

Returns:
java.lang.String (Class)

add

public void add(EditorNode node)

findSubNode

public EditorNode findSubNode(java.lang.String id)

getId

public java.lang.String getId()

getPage

public IEditorPage getPage()

getSubNodes

public EditorNode[] getSubNodes()

remove

public EditorNode remove(java.lang.String id)

remove

public boolean remove(EditorNode node)

setPage

public void setPage(IStyleEditorPage newPage)
Set the current page to be newPage.

Parameters:
newPage -

createExtension

public static java.lang.Object createExtension(IConfigurationElement element,
                                               java.lang.String classAttribute)
                                        throws CoreException
Creates an extension. If the extension plugin has not been loaded a busy cursor will be activated during the duration of the load.

Parameters:
element - the config element defining the extension
classAttribute - the name of the attribute carrying the class
Returns:
the extension object
Throws:
CoreException - if the extension cannot be created