net.sourceforge.java.util.gui.jface.preference
Class ExtendedPreferenceNode

java.lang.Object
  extended byorg.eclipse.jface.preference.PreferenceNode
      extended bynet.sourceforge.java.util.gui.jface.preference.ExtendedPreferenceNode
All Implemented Interfaces:
IPreferenceNode

public class ExtendedPreferenceNode
extends PreferenceNode

Extends PreferenceNode to support esay handling of different icons in the TreeViewer and PreferencePage of a JFace PreferenceDialog. This class changes the original behaviour to that effect that the icon of a PreferencePage stays untouched and has to be set in the implementing class itself.

Author:
Sebastian Machhausen

Field Summary
private  String classname
           
 
Fields inherited from class org.eclipse.jface.preference.PreferenceNode
 
Constructor Summary
ExtendedPreferenceNode(String id)
           Creates an ExtendedPreferenceNode with the given id.
ExtendedPreferenceNode(String id, IPreferencePage preferencePage)
           Creates an ExtendedPreferenceNode with the given id and preference page.
ExtendedPreferenceNode(String id, String label, ImageDescriptor image, String className)
           Creates an ExtendedPreferenceNode with the given id, label, and image, and lazily-loaded preference page.
 
Method Summary
private  Object createObject(String className)
           Creates a new instance of the given class className.
 void createPage()
           Creates the PreferencePage according to the settings in this ExtendedPreferenceNode.
 
Methods inherited from class org.eclipse.jface.preference.PreferenceNode
add, disposeResources, findSubNode, getId, getImageDescriptor, getLabelImage, getLabelText, getPage, getSubNodes, remove, remove, setPage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classname

private String classname
Constructor Detail

ExtendedPreferenceNode

public ExtendedPreferenceNode(String id)

Creates an ExtendedPreferenceNode with the given id. The new node has nosubnodes.

Parameters:
id - the node id

ExtendedPreferenceNode

public ExtendedPreferenceNode(String id,
                              String label,
                              ImageDescriptor image,
                              String className)

Creates an ExtendedPreferenceNode 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

ExtendedPreferenceNode

public ExtendedPreferenceNode(String id,
                              IPreferencePage preferencePage)

Creates an ExtendedPreferenceNode with the given id and preference page. The title of the preference page is used for the node label. The node will not have an image.

Parameters:
id - the node id
preferencePage - the preference page
Method Detail

createPage

public void createPage()

Creates the PreferencePage according to the settings in this ExtendedPreferenceNode.


createObject

private Object createObject(String className)

Creates a new instance of the given class className.

Parameters:
className -
Returns:
new Object or null in case of failures