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
ConstructorsConstructorDescriptionPreferenceNode(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 TypeMethodDescriptionvoidadd(IPreferenceNode node) Adds the given preference node as a subnode of this preference node.voidCreates the preference page for this node.voidRelease 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 ImageDescriptorReturns 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.booleanremove(IPreferenceNode node) Removes the given preference node from the list of subnodes (immediate children) of this node.voidsetPage(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, ornullif 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:IPreferenceNodeAdds the given preference node as a subnode of this preference node.- Specified by:
addin interfaceIPreferenceNode- Parameters:
node- the node to add
-
createPage
public void createPage()Description copied from interface:IPreferenceNodeCreates the preference page for this node.- Specified by:
createPagein interfaceIPreferenceNode
-
disposeResources
public void disposeResources()Description copied from interface:IPreferenceNodeRelease 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:
disposeResourcesin interfaceIPreferenceNode
-
findSubNode
Description copied from interface:IPreferenceNodeReturns the subnode of this contribution node with the given node id.- Specified by:
findSubNodein interfaceIPreferenceNode- Parameters:
id- the preference node id- Returns:
- the subnode, or
nullif none
-
getId
Description copied from interface:IPreferenceNodeReturns the id of this contribution node. This id identifies a contribution node relative to its parent.- Specified by:
getIdin interfaceIPreferenceNode- Returns:
- the node id
-
getImageDescriptor
Returns the image descriptor for this node.- Returns:
- the image descriptor
-
getLabelImage
Description copied from interface:IPreferenceNodeReturns the image used to present this node in a preference dialog.- Specified by:
getLabelImagein interfaceIPreferenceNode- Returns:
- the image for this node, or
nullif there is no image for this node
-
getLabelText
Description copied from interface:IPreferenceNodeReturns the text label used to present this node in a preference dialog.- Specified by:
getLabelTextin interfaceIPreferenceNode- Returns:
- the text label for this node, or
nullif there is no label for this node
-
getPage
Description copied from interface:IPreferenceNodeReturns the preference page for this node.- Specified by:
getPagein interfaceIPreferenceNode- Returns:
- the preference page
-
getSubNodes
Description copied from interface:IPreferenceNodeReturns an iterator over the subnodes (immediate children) of this contribution node.- Specified by:
getSubNodesin interfaceIPreferenceNode- Returns:
- an IPreferenceNode array containing the child nodes
-
remove
Description copied from interface:IPreferenceNodeRemoves the subnode of this preference node with the given node id.- Specified by:
removein interfaceIPreferenceNode- Parameters:
id- the subnode id- Returns:
- the removed subnode, or
nullif none
-
remove
Description copied from interface:IPreferenceNodeRemoves the given preference node from the list of subnodes (immediate children) of this node.- Specified by:
removein interfaceIPreferenceNode- Parameters:
node- the node to remove- Returns:
trueif the node was removed, andfalseotherwise
-
setPage
Set the current page to be newPage.- Parameters:
newPage- page to set
-