org.eclipse.ocl.examples.debug.ui.pages
Class OCLBreakpointPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.preference.PreferencePage
          extended by org.eclipse.ui.dialogs.PropertyPage
              extended by org.eclipse.ocl.examples.debug.ui.pages.OCLBreakpointPage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.ui.IWorkbenchPropertyPage
Direct Known Subclasses:
OCLLineBreakpointPage

public class OCLBreakpointPage
extends org.eclipse.ui.dialogs.PropertyPage


Field Summary
static java.lang.String ATTR_DELETE_ON_CANCEL
          Attribute used to indicate that a breakpoint should be deleted when cancel is pressed.
protected static java.lang.String EMPTY_STRING
          Constant for the empty string
protected  org.eclipse.swt.widgets.Button fEnabledButton
           
protected  java.util.List<java.lang.String> fErrorMessages
           
protected  org.eclipse.swt.widgets.Button fHitCountButton
           
protected  org.eclipse.swt.widgets.Text fHitCountText
           
protected  org.eclipse.swt.widgets.Combo fSuspendPolicy
           
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
OCLBreakpointPage()
           
 
Method Summary
protected  void addErrorMessage(java.lang.String message)
          Adds the given fError message to the errors currently displayed on this page.
protected  org.eclipse.swt.widgets.Button createCheckButton(org.eclipse.swt.widgets.Composite parent, java.lang.String text)
          Creates a fully configured check button with the given text.
protected  org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent, int numColumns)
          Creates a fully configured composite with the given number of columns
protected  org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
          Creates the labels and editors displayed for the breakpoint.
 void createControl(org.eclipse.swt.widgets.Composite parent)
           
protected  void createEnabledButton(org.eclipse.swt.widgets.Composite parent)
          Creates the button to toggle enablement of the breakpoint
protected  org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent, java.lang.String text)
          Creates a fully configured label with the given text.
protected  void createLabels(org.eclipse.swt.widgets.Composite parent)
          Creates the labels displayed for the breakpoint.
protected  org.eclipse.swt.widgets.Button createRadioButton(org.eclipse.swt.widgets.Composite parent, java.lang.String text)
          Creates a fully configured radio button with the given text.
protected  org.eclipse.swt.widgets.Text createText(org.eclipse.swt.widgets.Composite parent, java.lang.String initialValue)
          Creates a fully configured text editor with the given initial value
protected  void createTypeSpecificEditors(org.eclipse.swt.widgets.Composite parent)
          Allows subclasses to add type specific editors to the common Java breakpoint page.
protected  void createTypeSpecificLabels(org.eclipse.swt.widgets.Composite parent)
          Allows subclasses to add type specific labels to the common Java breakpoint page.
protected  void doStore()
          Stores the values configured in this page.
protected  VMLineBreakpoint getBreakpoint()
          Returns the breakpoint that this preference page configures
 boolean performCancel()
          Check to see if the breakpoint should be deleted.
 boolean performOk()
          Store the breakpoint properties.
protected  void removeErrorMessage(java.lang.String message)
          Removes the given fError message from the errors currently displayed on this page.
 
Methods inherited from class org.eclipse.ui.dialogs.PropertyPage
getElement, setElement
 
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, performDefaults, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, 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.preference.IPreferencePage
computeSize, isValid, okToLeave, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
 

Field Detail

fEnabledButton

protected org.eclipse.swt.widgets.Button fEnabledButton

fHitCountButton

protected org.eclipse.swt.widgets.Button fHitCountButton

fHitCountText

protected org.eclipse.swt.widgets.Text fHitCountText

fSuspendPolicy

protected org.eclipse.swt.widgets.Combo fSuspendPolicy

fErrorMessages

protected java.util.List<java.lang.String> fErrorMessages

ATTR_DELETE_ON_CANCEL

public static final java.lang.String ATTR_DELETE_ON_CANCEL
Attribute used to indicate that a breakpoint should be deleted when cancel is pressed.

See Also:
Constant Field Values

EMPTY_STRING

protected static final java.lang.String EMPTY_STRING
Constant for the empty string

See Also:
Constant Field Values
Constructor Detail

OCLBreakpointPage

public OCLBreakpointPage()
Method Detail

performOk

public boolean performOk()
Store the breakpoint properties.

Specified by:
performOk in interface org.eclipse.jface.preference.IPreferencePage
Overrides:
performOk in class org.eclipse.jface.preference.PreferencePage
See Also:
IPreferencePage.performOk()

addErrorMessage

protected void addErrorMessage(java.lang.String message)
Adds the given fError message to the errors currently displayed on this page. The page displays the most recently added fError message. Clients should retain messages that are passed into this method as the message should later be passed into removeErrorMessage(String) to clear the fError. This method should be used instead of setErrorMessage(String).

Parameters:
message - the fError message to display on this page.

removeErrorMessage

protected void removeErrorMessage(java.lang.String message)
Removes the given fError message from the errors currently displayed on this page. When an fError message is removed, the page displays the fError that was added before the given message. This is akin to popping the message from a stack. Clients should call this method instead of setErrorMessage(null).

Parameters:
message - the fError message to clear

doStore

protected void doStore()
                throws org.eclipse.core.runtime.CoreException
Stores the values configured in this page. This method should be called from within a workspace runnable to reduce the number of resource deltas.

Throws:
org.eclipse.core.runtime.CoreException

createContents

protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
Creates the labels and editors displayed for the breakpoint.

Specified by:
createContents in class org.eclipse.jface.preference.PreferencePage
See Also:
PreferencePage.createContents(org.eclipse.swt.widgets.Composite)

createLabels

protected void createLabels(org.eclipse.swt.widgets.Composite parent)
                     throws org.eclipse.core.runtime.CoreException
Creates the labels displayed for the breakpoint.

Parameters:
parent -
Throws:
org.eclipse.debug.core.DebugException
org.eclipse.core.runtime.CoreException

createEnabledButton

protected void createEnabledButton(org.eclipse.swt.widgets.Composite parent)
                            throws org.eclipse.core.runtime.CoreException
Creates the button to toggle enablement of the breakpoint

Parameters:
parent -
Throws:
org.eclipse.core.runtime.CoreException

getBreakpoint

protected VMLineBreakpoint getBreakpoint()
Returns the breakpoint that this preference page configures

Returns:
the breakpoint this page configures

createTypeSpecificLabels

protected void createTypeSpecificLabels(org.eclipse.swt.widgets.Composite parent)
Allows subclasses to add type specific labels to the common Java breakpoint page.

Parameters:
parent -

createTypeSpecificEditors

protected void createTypeSpecificEditors(org.eclipse.swt.widgets.Composite parent)
                                  throws org.eclipse.core.runtime.CoreException
Allows subclasses to add type specific editors to the common Java breakpoint page.

Parameters:
parent -
Throws:
org.eclipse.core.runtime.CoreException

createText

protected org.eclipse.swt.widgets.Text createText(org.eclipse.swt.widgets.Composite parent,
                                                  java.lang.String initialValue)
Creates a fully configured text editor with the given initial value

Parameters:
parent -
initialValue -
Returns:
the configured text editor

createComposite

protected org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent,
                                                            int numColumns)
Creates a fully configured composite with the given number of columns

Parameters:
parent -
numColumns -
Returns:
the configured composite

createCheckButton

protected org.eclipse.swt.widgets.Button createCheckButton(org.eclipse.swt.widgets.Composite parent,
                                                           java.lang.String text)
Creates a fully configured check button with the given text.

Parameters:
parent - the parent composite
text - the label of the returned check button
Returns:
a fully configured check button

createLabel

protected org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent,
                                                    java.lang.String text)
Creates a fully configured label with the given text.

Parameters:
parent - the parent composite
text - the test of the returned label
Returns:
a fully configured label

createRadioButton

protected org.eclipse.swt.widgets.Button createRadioButton(org.eclipse.swt.widgets.Composite parent,
                                                           java.lang.String text)
Creates a fully configured radio button with the given text.

Parameters:
parent - the parent composite
text - the label of the returned radio button
Returns:
a fully configured radio button

performCancel

public boolean performCancel()
Check to see if the breakpoint should be deleted.

Specified by:
performCancel in interface org.eclipse.jface.preference.IPreferencePage
Overrides:
performCancel in class org.eclipse.jface.preference.PreferencePage

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createControl in interface org.eclipse.jface.dialogs.IDialogPage
Overrides:
createControl in class org.eclipse.jface.preference.PreferencePage