Package org.eclipse.jface.preference
Class PreferenceNode
java.lang.Object
org.eclipse.jface.preference.PreferenceNode
- All Implemented Interfaces:
IPreferenceNode
A concrete implementation of a node in a preference dialog tree. This class
also supports lazy creation of the node's preference page.
-
Constructor Summary
ConstructorDescriptionPreferenceNode
(String id) Creates a new preference node with the given id.PreferenceNode
(String id, String label, ImageDescriptor image, String className) Creates a preference node with the given id, label, and image, and lazily-loaded preference page.PreferenceNode
(String id, IPreferencePage preferencePage) Creates a preference node with the given id and preference page. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(IPreferenceNode node) Adds the given preference node as a subnode of this preference node.void
Creates the preference page for this node.void
Release the page managed by this node, and any SWT resources held onto by this node (Images, Fonts, etc).findSubNode
(String id) Returns the subnode of this contribution node with the given node id.getId()
Returns the id of this contribution node.protected ImageDescriptor
Returns the image descriptor for this node.Returns the image used to present this node in a preference dialog.Returns the text label used to present this node in a preference dialog.getPage()
Returns the preference page for this node.Returns an iterator over the subnodes (immediate children) of this contribution node.Removes the subnode of this preference node with the given node id.boolean
remove
(IPreferenceNode node) Removes the given preference node from the list of subnodes (immediate children) of this node.void
setPage
(IPreferencePage newPage) Set the current page to be newPage.
-
Constructor Details
-
PreferenceNode
Creates a new preference node with the given id. The new node has no subnodes.- Parameters:
id
- the node id
-
PreferenceNode
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 idlabel
- the label used to display the node in the preference dialog's treeimage
- the image displayed left of the label in the preference dialog's tree, ornull
if noneclassName
- the class name of the preference page; this class must implementIPreferencePage
-
PreferenceNode
Creates a preference node 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 idpreferencePage
- the preference page
-
-
Method Details
-
add
Description copied from interface:IPreferenceNode
Adds the given preference node as a subnode of this preference node.- Specified by:
add
in interfaceIPreferenceNode
- Parameters:
node
- the node to add
-
createPage
public void createPage()Description copied from interface:IPreferenceNode
Creates the preference page for this node.- Specified by:
createPage
in interfaceIPreferenceNode
-
disposeResources
public void disposeResources()Description copied from interface:IPreferenceNode
Release the page managed by this node, and any SWT resources held onto by this node (Images, Fonts, etc). Note that nodes are reused so this is not a call to dispose the node itself.- Specified by:
disposeResources
in interfaceIPreferenceNode
-
findSubNode
Description copied from interface:IPreferenceNode
Returns the subnode of this contribution node with the given node id.- Specified by:
findSubNode
in interfaceIPreferenceNode
- Parameters:
id
- the preference node id- Returns:
- the subnode, or
null
if none
-
getId
Description copied from interface:IPreferenceNode
Returns the id of this contribution node. This id identifies a contribution node relative to its parent.- Specified by:
getId
in interfaceIPreferenceNode
- Returns:
- the node id
-
getImageDescriptor
Returns the image descriptor for this node.- Returns:
- the image descriptor
-
getLabelImage
Description copied from interface:IPreferenceNode
Returns the image used to present this node in a preference dialog.- Specified by:
getLabelImage
in interfaceIPreferenceNode
- Returns:
- the image for this node, or
null
if there is no image for this node
-
getLabelText
Description copied from interface:IPreferenceNode
Returns the text label used to present this node in a preference dialog.- Specified by:
getLabelText
in interfaceIPreferenceNode
- Returns:
- the text label for this node, or
null
if there is no label for this node
-
getPage
Description copied from interface:IPreferenceNode
Returns the preference page for this node.- Specified by:
getPage
in interfaceIPreferenceNode
- Returns:
- the preference page
-
getSubNodes
Description copied from interface:IPreferenceNode
Returns an iterator over the subnodes (immediate children) of this contribution node.- Specified by:
getSubNodes
in interfaceIPreferenceNode
- Returns:
- an IPreferenceNode array containing the child nodes
-
remove
Description copied from interface:IPreferenceNode
Removes the subnode of this preference node with the given node id.- Specified by:
remove
in interfaceIPreferenceNode
- Parameters:
id
- the subnode id- Returns:
- the removed subnode, or
null
if none
-
remove
Description copied from interface:IPreferenceNode
Removes the given preference node from the list of subnodes (immediate children) of this node.- Specified by:
remove
in interfaceIPreferenceNode
- Parameters:
node
- the node to remove- Returns:
true
if the node was removed, andfalse
otherwise
-
setPage
Set the current page to be newPage.- Parameters:
newPage
- page to set
-