LPEX
4.4.0

com.ibm.lpex.alef.preferences
Class UserActionsPreferencePage

java.lang.Object
  extended by PreferencePage
      extended by com.ibm.lpex.alef.preferences.UserActionsPreferencePage

public final class UserActionsPreferencePage
extends PreferencePage

Preference page for user actions. It lets the user add and remove user-defined editor actions.

The "Class name" combo list is prefilled with the actions available in the com.ibm.lpex.samples package.

See Also:
All the samples

Constructor Summary
UserActionsPreferencePage()
          Constructor.
 
Method Summary
protected  void contributeButtons(Composite buttonBar)
          Contributes a "Reset" button.
protected  Control createContents(Composite parent)
          Creates and returns the SWT control for the customized body of this preference page.
protected  void doSetPressed(String value1, String value2)
          Handles the "Set" button having been pressed.
protected  Vector<com.ibm.lpex.alef.preferences.LpexTableItem> getItems()
          Returns the current vector of LpexTableItems in the table.
protected  String getValue2()
          Returns the text in the value2 edit field.
protected  String[] getValue2Options()
          Returns an array of the actions in the com.ibm.lpex.samples package for the value2 combo.
protected  String[] getValueNames()
          Returns the names for the text-field labels.
protected  String[] getValueTableNames()
          Returns the names for the table columns.
protected  int[] getValueWeights()
          Returns the column weights for the two columns in the table.
 void init(IWorkbench workbench)
          Initializes this preference page for the given workbench.
protected  Vector<com.ibm.lpex.alef.preferences.LpexTableItem> initialize()
          Returns a new vector of LpexTableItems with the initial (current) settings (the preference page is being initialized).
protected  Vector<com.ibm.lpex.alef.preferences.LpexTableItem> initializeDefaults()
          Returns a new vector of LpexTableItems with the install settings ("Restore Defaults" button was pressed).
protected  void performDefaults()
          "Restore Defaults" button pressed.
 boolean performOk()
          "OK" / "Apply" button pressed.
protected  void performReset()
          "Reset" button pressed.
protected  void selectItem(String value1)
          Selects an item in the table, and ensures it shows.
 void setValid(boolean b)
          Sets whether this page is valid.
protected  void setValue2Options()
          Called to (re)set the options list in the value2 combo, when a combo box is used as the value2 edit field.
protected  void tableSelectionModified(String newValue1, String newValue2)
          Notification for subclasses that the table selection was modified.
protected  Text value1Info()
          Returns the Text widget used to display additional information for the value1 edit field.
protected  void value1Modified()
          Value1 is being edited in the text field.
protected  Text value1TextField()
          Returns the Text widget used as the value1 edit field.
protected  void value2ListSelectionModified()
          A Value2 has been selected from the combo list.
protected  void value2Modified()
          Value2 is being edited in the text field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserActionsPreferencePage

public UserActionsPreferencePage()
Constructor.

Method Detail

createContents

protected Control createContents(Composite parent)
Creates and returns the SWT control for the customized body of this preference page. Overridden in order to set the context help.

See Also:
PreferencePage

getValueTableNames

protected String[] getValueTableNames()
Returns the names for the table columns.


getValueNames

protected String[] getValueNames()
Returns the names for the text-field labels.


getValueWeights

protected int[] getValueWeights()
Returns the column weights for the two columns in the table.


getValue2Options

protected String[] getValue2Options()
Returns an array of the actions in the com.ibm.lpex.samples package for the value2 combo.

See Also:
All the samples

initialize

protected Vector<com.ibm.lpex.alef.preferences.LpexTableItem> initialize()
Returns a new vector of LpexTableItems with the initial (current) settings (the preference page is being initialized).


initializeDefaults

protected Vector<com.ibm.lpex.alef.preferences.LpexTableItem> initializeDefaults()
Returns a new vector of LpexTableItems with the install settings ("Restore Defaults" button was pressed).


performOk

public boolean performOk()
"OK" / "Apply" button pressed. Commits any new updated values.


value1Modified

protected void value1Modified()
Value1 is being edited in the text field. Extended to check it is a valid LPEX action name.


value2Modified

protected void value2Modified()
Value2 is being edited in the text field. Extended to check it is a valid Java class name.


value2ListSelectionModified

protected void value2ListSelectionModified()
A Value2 has been selected from the combo list. Extended to suggest action names for the sample package's actions.


init

public void init(IWorkbench workbench)
Initializes this preference page for the given workbench. This method, defined by IWorkbenchPreferencePage, is called automatically when the preference page defined in plugin.xml is being created and initialized.

The TablePreferencePage implementation of this method does nothing.


value1TextField

protected Text value1TextField()
Returns the Text widget used as the value1 edit field.


getValue2

protected String getValue2()
Returns the text in the value2 edit field.


value1Info

protected Text value1Info()
Returns the Text widget used to display additional information for the value1 edit field.


setValid

public void setValid(boolean b)
Sets whether this page is valid. The enable state of the container buttons and the "Apply" button is updated when a page's valid state changes. Extended here to enable/disable the "Set" button as well.


doSetPressed

protected void doSetPressed(String value1,
                            String value2)
Handles the "Set" button having been pressed. The value1 entry being edited is

Parameters:
value1 - trimmed value read from the value1 entry field
value2 - trimmed value read from the value2 entry field

contributeButtons

protected void contributeButtons(Composite buttonBar)
Contributes a "Reset" button. Method performReset() is called when this button is selected.

Parameters:
buttonBar - the preference-page button bar
See Also:
PreferencePage, performReset()

performDefaults

protected void performDefaults()
"Restore Defaults" button pressed. Sets the table to the install settings.


performReset

protected void performReset()
"Reset" button pressed. Restores the initial preference page settings.


setValue2Options

protected void setValue2Options()
Called to (re)set the options list in the value2 combo, when a combo box is used as the value2 edit field.

See Also:
getValue2Options()

getItems

protected Vector<com.ibm.lpex.alef.preferences.LpexTableItem> getItems()
Returns the current vector of LpexTableItems in the table.


tableSelectionModified

protected void tableSelectionModified(String newValue1,
                                      String newValue2)
Notification for subclasses that the table selection was modified. The change was either the result of a user mouse click, or effected by us while tracking the value1 text field being edited.


selectItem

protected void selectItem(String value1)
Selects an item in the table, and ensures it shows. If not in the table, clears any existing selection.


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.