LPEX
4.4.0

com.ibm.lpex.alef
Class LpexViewPreferenceNode

java.lang.Object
  extended by PreferenceNode
      extended by com.ibm.lpex.alef.LpexViewPreferenceNode

public class LpexViewPreferenceNode
extends PreferenceNode

PreferenceNode for a view-scoped preference page.

You may extend this class in order to create custom preference page nodes. Custom nodes may be added by extending LpexAbstractTextEditor.createViewPreferenceNodes() or LpexSourceViewer.createViewPreferenceNodes().

Extenders of this class must implement method getLabelText(). Also, the preference page for a custom node must be created, by extending LpexAbstractTextEditor.createViewPreferencePage() or LpexSourceViewer.createViewPreferencePage().


Field Summary
static int VIEW_BASE_PREFERENCE_NODE
          Node type for the LPEX built-in base preference page (ViewBasePreferencePage).
static int VIEW_PARSER_PREFERENCE_NODE
          Node type for the LPEX built-in parser preference page (ViewParserPreferencePage).
static int VIEW_SEQUENCE_NUMBERS_PREFERENCE_NODE
          Node type for the LPEX built-in sequence-numbers preference page (SequenceNumbersPreferencePage).
static int VIEW_SOURCE_ENCODING_PREFERENCE_NODE
          Node type for the LPEX built-in source-emulation preference page (SourceEncodingPreferencePage).
 
Constructor Summary
LpexViewPreferenceNode(LpexSourceViewer lpexSourceViewer)
          Constructor for a custom view-scoped preference page node to be shown in the workbench "Preferences" dialog.
 
Method Summary
 void createPage()
          Constructs and sets the preference page for this view-scoped node.
 String getLabelText()
          Returns the name of this preference node.
 int getNodeType()
          Returns the type of this preference node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_BASE_PREFERENCE_NODE

public static final int VIEW_BASE_PREFERENCE_NODE
Node type for the LPEX built-in base preference page (ViewBasePreferencePage).

See Also:
Constant Field Values

VIEW_PARSER_PREFERENCE_NODE

public static final int VIEW_PARSER_PREFERENCE_NODE
Node type for the LPEX built-in parser preference page (ViewParserPreferencePage).

See Also:
Constant Field Values

VIEW_SEQUENCE_NUMBERS_PREFERENCE_NODE

public static final int VIEW_SEQUENCE_NUMBERS_PREFERENCE_NODE
Node type for the LPEX built-in sequence-numbers preference page (SequenceNumbersPreferencePage).

See Also:
Constant Field Values

VIEW_SOURCE_ENCODING_PREFERENCE_NODE

public static final int VIEW_SOURCE_ENCODING_PREFERENCE_NODE
Node type for the LPEX built-in source-emulation preference page (SourceEncodingPreferencePage).

See Also:
Constant Field Values
Constructor Detail

LpexViewPreferenceNode

public LpexViewPreferenceNode(LpexSourceViewer lpexSourceViewer)
Constructor for a custom view-scoped preference page node to be shown in the workbench "Preferences" dialog. A node type is assigned here to this prefence node, retrievable through getNodeType().

Parameters:
lpexSourceViewer - the source viewer instance
Method Detail

getNodeType

public int getNodeType()
Returns the type of this preference node.


getLabelText

public String getLabelText()
Returns the name of this preference node. The org.eclipse.jface.preference.PreferenceNode super constructor used by this class does not set a label. This would prevent the "Preferences" dialog from displaying this node (as there will be no text for this tree item's name): therefore, we override getTextLabel() in order to return the desired name for all the LPEX built-in view preference page nodes.

Extenders of this class must implement this method in order to return the name for custom view preference page nodes they create.


createPage

public final void createPage()
Constructs and sets the preference page for this view-scoped node. Uses the primary view of the document open in the source viewer.

Eclipse preference pages will be created lazily when the user selects a node. Method getPage() != null is used to track what pages have been visited. When the "Preferences" dialog is dismissed, the node resources are disposed (disposeResources() is called). This method is called when the user first selects this particular node in the "Preferences" dialog; afterwards, method #createControl() in the preference page will be called by PreferenceDialog to build the page.

The custom preference page for this node must be created by extending LpexAbstractTextEditor.createViewPreferencePage() or LpexSourceViewer.createViewPreferencePage().


LPEX
4.4.0

Copyright � 2016 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.