org.mockcentral.editor.wizards
Class WizardDialogSettingsManager

java.lang.Object
  extended by org.mockcentral.editor.wizards.WizardDialogSettingsManager
Direct Known Subclasses:
EditExpectationWizardDialogSettingsManager, EditFixtureWizardDialogSettingsManager, EditMockObjectWizardDialogSettingsManager, EditSignaturepartWizardDialogSettingsManager

public abstract class WizardDialogSettingsManager
extends java.lang.Object

Base for classes used to manage the various wizard dialog settings for the Mock Central editor plugin. This class handles storing and retrieving dialog size and location settings stored in sections based on the subclass canonical name and provides convenience methods for accessing setting data.

Author:
David Hutchinson

Field Summary
protected  org.eclipse.jface.wizard.WizardDialog dialog
          The WizardDialog the settings of which are managed by this instance.
protected static java.lang.String DIALOG_HEIGHT
          the identifier for the dialog settings section preserving the dialog height
protected static java.lang.String DIALOG_LOCATION_SETTINGS
          the identifier for the dialog settings section preserving the dialog location
protected static java.lang.String DIALOG_LOCATION_X
          the identifier for the dialog settings section preserving the dialog horizontal location
protected static java.lang.String DIALOG_LOCATION_Y
          the identifier for the dialog settings section preserving the dialog vertical location
protected static java.lang.String DIALOG_SIZE_SETTINGS
          the identifier for the dialog settings section preserving the dialog size
protected static java.lang.String DIALOG_WIDTH
          the identifier for the dialog settings section preserving the dialog width
protected  org.eclipse.jface.dialogs.IDialogSettings settings
          The IDialogSettings for this instance.
 
Constructor Summary
WizardDialogSettingsManager(org.eclipse.jface.wizard.WizardDialog dialog)
          Creates a new settings manager.
 
Method Summary
protected  boolean getBooleanSetting(java.lang.String key)
          Convenience method for subclasses which returns a boolean value for a setting stored under the supplied String.
 org.eclipse.swt.graphics.Point getDialogLocation()
          Returns a Point describing the current dialog location.
 org.eclipse.swt.graphics.Point getDialogSize()
          Returns a Point describing the current dialog size.
 org.eclipse.swt.graphics.Point getInitialDialogLocation(org.eclipse.swt.graphics.Point defaultInitialLocation)
          Returns a Point describing the previously set dialog location, or the provided default value if none has been set yet.
 org.eclipse.swt.graphics.Point getInitialDialogSize()
          Returns a Point describing the previously set dialog size, or a default value if none has been set yet.
 java.lang.String getStringSetting(java.lang.String key)
          Returns a setting.
protected  void loadSettings()
          Assigns the IDialogSettings for this instance, getting them from the plug-in or (if none currently stored) creating them using the canonical name of the class.
protected  void storeSizeAndLocationSettings()
          Stores all settings preserving the dialog's size and location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIALOG_SIZE_SETTINGS

protected static final java.lang.String DIALOG_SIZE_SETTINGS
the identifier for the dialog settings section preserving the dialog size

See Also:
Constant Field Values

DIALOG_HEIGHT

protected static final java.lang.String DIALOG_HEIGHT
the identifier for the dialog settings section preserving the dialog height

See Also:
Constant Field Values

DIALOG_WIDTH

protected static final java.lang.String DIALOG_WIDTH
the identifier for the dialog settings section preserving the dialog width

See Also:
Constant Field Values

DIALOG_LOCATION_SETTINGS

protected static final java.lang.String DIALOG_LOCATION_SETTINGS
the identifier for the dialog settings section preserving the dialog location

See Also:
Constant Field Values

DIALOG_LOCATION_X

protected static final java.lang.String DIALOG_LOCATION_X
the identifier for the dialog settings section preserving the dialog horizontal location

See Also:
Constant Field Values

DIALOG_LOCATION_Y

protected static final java.lang.String DIALOG_LOCATION_Y
the identifier for the dialog settings section preserving the dialog vertical location

See Also:
Constant Field Values

settings

protected org.eclipse.jface.dialogs.IDialogSettings settings
The IDialogSettings for this instance.


dialog

protected org.eclipse.jface.wizard.WizardDialog dialog
The WizardDialog the settings of which are managed by this instance.

Constructor Detail

WizardDialogSettingsManager

public WizardDialogSettingsManager(org.eclipse.jface.wizard.WizardDialog dialog)
Creates a new settings manager.

Parameters:
dialog - the WizardDialog the settings of which are managed by this instance.
Method Detail

getDialogSize

public org.eclipse.swt.graphics.Point getDialogSize()
Returns a Point describing the current dialog size.

Returns:
a Point describing the current dialog size.

getDialogLocation

public org.eclipse.swt.graphics.Point getDialogLocation()
Returns a Point describing the current dialog location.

Returns:
a Point describing the current dialog location.

getInitialDialogSize

public org.eclipse.swt.graphics.Point getInitialDialogSize()
Returns a Point describing the previously set dialog size, or a default value if none has been set yet.

Returns:
a Point describing the previously set dialog size.

getInitialDialogLocation

public org.eclipse.swt.graphics.Point getInitialDialogLocation(org.eclipse.swt.graphics.Point defaultInitialLocation)
Returns a Point describing the previously set dialog location, or the provided default value if none has been set yet.

Parameters:
defaultInitialLocation - the default dialog location.
Returns:
a Point describing the previously set dialog location.

getStringSetting

public java.lang.String getStringSetting(java.lang.String key)
Returns a setting.

Parameters:
key - the String under which the setting is stored.
Returns:
the setting.

loadSettings

protected void loadSettings()
Assigns the IDialogSettings for this instance, getting them from the plug-in or (if none currently stored) creating them using the canonical name of the class.


storeSizeAndLocationSettings

protected void storeSizeAndLocationSettings()
Stores all settings preserving the dialog's size and location.


getBooleanSetting

protected boolean getBooleanSetting(java.lang.String key)
Convenience method for subclasses which returns a boolean value for a setting stored under the supplied String.

Parameters:
key - the String under which the setting is stored.
Returns:
a boolean value for a setting stored under the supplied String.