SWT LPEX
v3.0.5

com.ibm.lpex.alef.preferences
Class ViewParserPreferencePage

java.lang.Object
  extended byorg.eclipse.jface.dialogs.DialogPage
      extended byorg.eclipse.jface.preference.PreferencePage
          extended byorg.eclipse.jface.preference.FieldEditorPreferencePage
              extended bycom.ibm.lpex.alef.preferences.LpexFieldEditorPreferencePage
                  extended bycom.ibm.lpex.alef.preferences.ViewParserPreferencePage
All Implemented Interfaces:
EventListener, IDialogPage, IMessageProvider, IPreferencePage, IPropertyChangeListener, IWorkbenchPreferencePage

public class ViewParserPreferencePage
extends LpexFieldEditorPreferencePage

Parser preference page for an LPEX view. It handles the document parser setting for the view.


Field Summary
protected  com.ibm.lpex.alef.preferences.LpexListEditor _parserList
          The list editor for document parsers selectable for the view.
 
Fields inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
FLAT, GRID, MARGIN_HEIGHT, MARGIN_WIDTH, VERTICAL_SPACING
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
ViewParserPreferencePage(LpexView lpexView)
          Constructor.
 
Method Summary
protected  void contributeButtons(Composite buttonBar)
          Contributes the "Reset" and "Apply" buttons.
protected  Control createContents(Composite parent)
          Creates and returns the SWT control for the customized body of this preference page.
protected  void createFieldEditors()
          Creates this preference page's field editor.
 void dispose()
          Disposes the SWT resources allocated by this dialog page.
 boolean performOk()
          "OK" / "Apply" button pressed.
protected  void performReset()
          "Reset" button pressed.
 void setVisible(boolean visible)
          Sets the visibility of this preference page.
protected  void updateApplyButton()
          Updates the enabled state of the "Apply" button to reflect whether this page is valid.
 
Methods inherited from class com.ibm.lpex.alef.preferences.LpexFieldEditorPreferencePage
fieldEditorsCreated, init
 
Methods inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
addField, adjustGridLayout, applyFont, checkState, getFieldEditorParent, initialize, performDefaults, propertyChange
 
Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyDialogFont, computeSize, createControl, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, okToLeave, performApply, performCancel, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
createControl, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle
 

Field Detail

_parserList

protected com.ibm.lpex.alef.preferences.LpexListEditor _parserList
The list editor for document parsers selectable for the view.

Constructor Detail

ViewParserPreferencePage

public ViewParserPreferencePage(LpexView lpexView)
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 for the page.


createFieldEditors

protected void createFieldEditors()
Creates this preference page's field editor. Called by FieldEditorPreferencePage#createContents().

Method fieldEditorsCreated() will be called after the field of this preference page is created and set to its initial value. A subclass may then disable it:

   _parserList.setEnabled(false);


setVisible

public void setVisible(boolean visible)
Sets the visibility of this preference page. Extended in order to update the page with the settings of the active view of an LpexMultiWindow each time this page is made visible.


contributeButtons

protected void contributeButtons(Composite buttonBar)
Contributes the "Reset" and "Apply" buttons. We had to get rid of the "Defaults" button for this page, so the original "Apply" also had to be Ecliptically flushed...

Overrides:
contributeButtons in class LpexFieldEditorPreferencePage
Parameters:
buttonBar - the preference-page button bar
See Also:
PreferencePage.contributeButtons(org.eclipse.swt.widgets.Composite), LpexFieldEditorPreferencePage.performReset()

dispose

public void dispose()
Disposes the SWT resources allocated by this dialog page. Extended in order to clear the last used document parser when this page is disposed.


updateApplyButton

protected void updateApplyButton()
Updates the enabled state of the "Apply" button to reflect whether this page is valid. Reimplemented as this page defines its own "Apply" button.


performOk

public boolean performOk()
"OK" / "Apply" button pressed. Commits any new updated parser value by running the updateProfile command, and ensures the change is reflected correctly on the view screen.


performReset

protected void performReset()
"Reset" button pressed. Sets the value and the dialog field to the initial preference-page setting.

Overrides:
performReset in class LpexFieldEditorPreferencePage
See Also:
LpexFieldEditorPreferencePage.contributeButtons(org.eclipse.swt.widgets.Composite)

SWT LPEX
v3.0.5

(C) Copyright IBM Corporation 1998, 2005.  All Rights Reserved.