Class JavaBreakpointConditionEditor
- java.lang.Object
-
- org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
-
- org.eclipse.jdt.debug.ui.breakpoints.JavaBreakpointConditionEditor
-
public final class JavaBreakpointConditionEditor extends org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
Controls to edit a breakpoint's conditional expression, condition enabled state, and suspend policy (suspend when condition istrue
or when the value of the conditional expression changes).The controls are intended to be embedded in a composite provided by the client - for example, in a dialog. Clients must call
createControl(Composite)
as the first life cycle method after instantiation. Clients may then callsetInput(Object)
with the breakpoint object to be displayed/edited. Changes are not applied to the breakpoint untildoSave()
is called. The methodisDirty()
may be used to determine if any changes have been made in the editor, andgetStatus()
may be used to determine if the editor settings are valid. Clients can register for property change notification (addPropertyListener(IPropertyListener)
). The editor will fire a property change each time a setting is modified. The same editor can be used to display different breakpoints by callingsetInput(Object)
with different breakpoint objects.- Since:
- 3.5
-
-
Field Summary
Fields Modifier and Type Field Description static int
PROP_CONDITION
Property id for breakpoint condition expression.static int
PROP_CONDITION_ENABLED
Property id for breakpoint condition enabled state.static int
PROP_CONDITION_SUSPEND_POLICY
Property id for breakpoint condition suspend policy.
-
Constructor Summary
Constructors Constructor Description JavaBreakpointConditionEditor()
Creates a new Java breakpoint condition editor.JavaBreakpointConditionEditor(IDialogSettings dialogSettings)
Creates a new Java breakpoint condition editor with a history drop-down list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyListener(IPropertyListener listener)
Adds the given property listener to this editor.Control
createControl(Composite parent)
Creates the condition editor widgets and returns the top level control.protected void
dispose()
Disposes this editor and its controls.void
doSave()
Saves current settings to the breakpoint being edited.Object
getInput()
Returns the breakpoint being edited ornull
if none.IStatus
getStatus()
Returns a status describing whether the condition editor is in a valid state.boolean
isDirty()
Returns whether the editor needs saving.void
removePropertyListener(IPropertyListener listener)
Removes the property listener from this editor.void
setFocus()
Gives focus to an appropriate control in the editor.void
setInput(Object input)
Sets the breakpoint to editor ornull
if none.void
setMnemonics(boolean mnemonics)
Sets whether mnemonics should be displayed in editor controls.
-
-
-
Field Detail
-
PROP_CONDITION
public static final int PROP_CONDITION
Property id for breakpoint condition expression.- See Also:
- Constant Field Values
-
PROP_CONDITION_ENABLED
public static final int PROP_CONDITION_ENABLED
Property id for breakpoint condition enabled state.- See Also:
- Constant Field Values
-
PROP_CONDITION_SUSPEND_POLICY
public static final int PROP_CONDITION_SUSPEND_POLICY
Property id for breakpoint condition suspend policy.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JavaBreakpointConditionEditor
public JavaBreakpointConditionEditor()
Creates a new Java breakpoint condition editor.
-
JavaBreakpointConditionEditor
public JavaBreakpointConditionEditor(IDialogSettings dialogSettings)
Creates a new Java breakpoint condition editor with a history drop-down list.- Parameters:
dialogSettings
- the dialog settings for the condition history ornull
to use the default settings (i.e. those used by JDT Debug)- Since:
- 3.6
-
-
Method Detail
-
addPropertyListener
public void addPropertyListener(IPropertyListener listener)
Adds the given property listener to this editor. Property changes are reported on the breakpoint being edited. Property identifiers are breakpoint attribute keys.- Overrides:
addPropertyListener
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
- Parameters:
listener
- listener
-
removePropertyListener
public void removePropertyListener(IPropertyListener listener)
Removes the property listener from this editor.- Overrides:
removePropertyListener
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
- Parameters:
listener
- listener
-
setInput
public void setInput(Object input) throws CoreException
Sets the breakpoint to editor ornull
if none.- Specified by:
setInput
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
- Parameters:
input
- breakpoint ornull
- Throws:
CoreException
- if unable to access breakpoint attributes
-
createControl
public Control createControl(Composite parent)
Creates the condition editor widgets and returns the top level control.- Specified by:
createControl
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
- Parameters:
parent
- composite to embed the editor controls in- Returns:
- top level control
-
dispose
protected void dispose()
Disposes this editor and its controls. Once disposed, the editor can no longer be used.- Overrides:
dispose
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
-
setFocus
public void setFocus()
Gives focus to an appropriate control in the editor.- Specified by:
setFocus
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
-
doSave
public void doSave() throws CoreException
Saves current settings to the breakpoint being edited. Has no effect if a breakpoint is not currently being edited or if this editor is not dirty.- Specified by:
doSave
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
- Throws:
CoreException
- if unable to update the breakpoint.
-
getStatus
public IStatus getStatus()
Returns a status describing whether the condition editor is in a valid state. Returns an OK status when all is good. For example, an error status is returned when the conditional expression is empty but enabled.- Specified by:
getStatus
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
- Returns:
- editor status.
-
isDirty
public boolean isDirty()
Returns whether the editor needs saving.- Overrides:
isDirty
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
- Returns:
- whether the editor needs saving
-
setMnemonics
public void setMnemonics(boolean mnemonics)
Sets whether mnemonics should be displayed in editor controls. Only has an effect if set beforecreateControl(Composite)
is called. By default, mnemonics are displayed.- Overrides:
setMnemonics
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
- Parameters:
mnemonics
- whether to display mnemonics
-
getInput
public Object getInput()
Returns the breakpoint being edited ornull
if none.- Specified by:
getInput
in classorg.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor
- Returns:
- breakpoint or
null
-
-