net.sourceforge.java.feednread.frontend.configuration
Class BrowserConfigurationPage

java.lang.Object
  extended byorg.eclipse.jface.dialogs.DialogPage
      extended byorg.eclipse.jface.preference.PreferencePage
          extended bynet.sourceforge.java.feednread.frontend.configuration.DefaultConfigurationPage
              extended bynet.sourceforge.java.feednread.frontend.configuration.BrowserConfigurationPage
All Implemented Interfaces:
IDialogPage, IMessageProvider, IPreferencePage

public class BrowserConfigurationPage
extends DefaultConfigurationPage

Configuration page for browser settings.

Author:
Sebastian Machhausen

Nested Class Summary
private  class BrowserConfigurationPage.ButtonHandler
           Handles SelectionEvents triggered by the radio Buttons defined in the enclosing BrowserConfigurationPage.
 
Field Summary
private  boolean defaultBrowserAvailable
           true if the default browser could be detected on the end-user's system; false otherwise
private  Image defaultBrowserImg
           The Image icon of the default browser
private  FileFieldEditor externalBrowserEditor
           Editor to select the path to an userdefined external browser
private  Composite externalBrowserEditorContainer
           Composite to hold the externalBrowserEditor
private  Button useDefaultExternalBrowser
           Radio button to select the use of the default external browser
private  Button useInternalBrowser
           Radio button to select the use of the internal browser
private  Button useUserDefinedBrowser
           Radio button to select the use of an userdefined external browser
 
Fields inherited from class org.eclipse.jface.preference.PreferencePage
 
Fields inherited from class org.eclipse.jface.dialogs.DialogPage
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
BrowserConfigurationPage()
           Creates a new BrowserConfigurationPage.
 
Method Summary
protected  Control createContents(Composite parent)
           Creates and returns the SWT control for the customized body of this preference page under the given parent composite.
private  void createDefaultBrowserLabel(Composite parent, LanguageResource resource)
           Creates a CLabel holding the name and Image icon of the default browser if available.
 void dispose()
           Disposes all resources claimed by controls embedded in this BrowserConfigurationPage.
protected  void performDefaults()
           Resets all configured values in the FieldEditors back to their default values.
protected  void performLoad()
           Loads all values for the FieldEditors and widgets from the configuration.
 boolean performOk()
           Notifies that the OK button of this page's container has been pressed.
 
Methods inherited from class net.sourceforge.java.feednread.frontend.configuration.DefaultConfigurationPage
createControl
 
Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, okToLeave, performApply, performCancel, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton
 
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, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, setDescription, setImageDescriptor, setVisible
 

Field Detail

useInternalBrowser

private Button useInternalBrowser

Radio button to select the use of the internal browser


useDefaultExternalBrowser

private Button useDefaultExternalBrowser

Radio button to select the use of the default external browser


useUserDefinedBrowser

private Button useUserDefinedBrowser

Radio button to select the use of an userdefined external browser


externalBrowserEditor

private FileFieldEditor externalBrowserEditor

Editor to select the path to an userdefined external browser


externalBrowserEditorContainer

private Composite externalBrowserEditorContainer

Composite to hold the externalBrowserEditor


defaultBrowserImg

private Image defaultBrowserImg

The Image icon of the default browser


defaultBrowserAvailable

private boolean defaultBrowserAvailable

true if the default browser could be detected on the end-user's system; false otherwise

Constructor Detail

BrowserConfigurationPage

public BrowserConfigurationPage()

Creates a new BrowserConfigurationPage.

Method Detail

performOk

public boolean performOk()

Notifies that the OK button of this page's container has been pressed.

Returns:
false to abort the container's OK processing and true to allow the OK to happen

dispose

public void dispose()

Disposes all resources claimed by controls embedded in this BrowserConfigurationPage.


createContents

protected Control createContents(Composite parent)

Creates and returns the SWT control for the customized body of this preference page under the given parent composite.

Parameters:
parent - the parent composite
Returns:
the new control
See Also:
PreferencePage.createContents(org.eclipse.swt.widgets.Composite)

performLoad

protected void performLoad()

Loads all values for the FieldEditors and widgets from the configuration.


performDefaults

protected void performDefaults()

Resets all configured values in the FieldEditors back to their default values.


createDefaultBrowserLabel

private void createDefaultBrowserLabel(Composite parent,
                                       LanguageResource resource)

Creates a CLabel holding the name and Image icon of the default browser if available. If no default browser is set on the system the CLabel is initialized with a suitable message and an error Image. In addition this method initializes the defaultBrowserAvailable attribute depending on the result of the default browser detection.

Parameters:
parent - the Composite to embed the created label into
resource - the LanguageResource to use