com.bluemarsh.jswat.breakpoint.ui
Class BasicBreakpointUI

java.lang.Object
  |
  +--com.bluemarsh.jswat.breakpoint.ui.BasicBreakpointUI
All Implemented Interfaces:
BreakpointUI, UIAdapter
Direct Known Subclasses:
LineBreakpointUI, MethodBreakpointUI

public class BasicBreakpointUI
extends java.lang.Object
implements BreakpointUI

Class BasicBreakpointUI is an adapter for building the user interface components to represent a the common properties of all breakpoints.

Author:
Nathan Fiedler

Inner Class Summary
protected static class BasicBreakpointUI.GroupNamePair
          Class GroupNamePair represents a breakpoint group/composite name pair.
protected  class BasicBreakpointUI.NumericDocument
          Implements a text document that only accepts digits.
 
Field Summary
protected  javax.swing.JTextField classFiltersTextfield
          Breakpoint's class filters text field.
protected  javax.swing.JCheckBox enabledCheckbox
          Checkbox for the breakpoint's enabledness.
protected  javax.swing.JTextField expirecountTextfield
          Breakpoint's expire count text field.
protected  java.awt.GridBagConstraints gbc
          Contraints object for the panel layout.
protected  java.awt.GridBagLayout gbl
          Layout for the properties panel.
protected  javax.swing.JComboBox groupCombo
          Combo box showing the available breakpoint groups.
protected  java.lang.String originalClassFilters
          Original list of class filters.
protected  boolean originalEnabled
          Original enabled value.
protected  int originalExpirecount
          Original expire count value.
protected  BreakpointGroup originalGroup
          Original group the breakpoint belonged to.
protected  int originalSkipcount
          Original skip count value.
protected  int originalSuspendPolicy
          Original suspend policy value.
protected  java.lang.String originalThreadFilters
          Original list of thread filters.
protected  javax.swing.JPanel propertiesPanel
          Panel that contains all of our properties, in a gridbag layout.
protected  javax.swing.JTextField skipcountTextfield
          Breakpoint's skip count text field.
protected  javax.swing.ButtonGroup suspendGroup
          Radio button group for the suspend policy.
protected  Breakpoint targetBreakpoint
          Breakpoint that we are working against.
protected  javax.swing.JTextField threadFiltersTextfield
          Breakpoint's thread filters text field.
 
Constructor Summary
BasicBreakpointUI(Breakpoint bp)
          Create a BasicBreakpointUI that will operate on the given breakpoint.
 
Method Summary
 void addClassFilter()
          Add the text input field for setting the class filters.
 void addThreadFilter()
          Add the text input field for setting the thread filters.
static javax.swing.JComboBox buildGroupList(BreakpointGroup defaultGroup)
          Builds a combo box to display all the available breakpoint groups.
 void commit()
          Commit the values stored in the user interface elements to the object this adapter is representing (breakpoint, condition, or monitor).
static void findAndSelectGroup(javax.swing.JComboBox box, Breakpoint bp)
          Using the given combo box, previously built using buildGroupList(), set one of the breakpoint groups in the combo box as selected according to the parent group of the given breakpoint.
static BreakpointGroup getSelectedGroup(javax.swing.JComboBox box)
          Retrieves the selected BreakpointGroup from the given combo box.
 java.awt.Component getUI()
          Return a reference to the user interface element that this adapter uses to graphically represent the breakpoint, condition, or monitor.
 void undo()
          Reverse the changes made to the object this adapter is representing (breakpoint, condition, or monitor).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetBreakpoint

protected Breakpoint targetBreakpoint
Breakpoint that we are working against.

propertiesPanel

protected javax.swing.JPanel propertiesPanel
Panel that contains all of our properties, in a gridbag layout. Subclasses can add their own components to this panel as needed.

gbl

protected java.awt.GridBagLayout gbl
Layout for the properties panel.

gbc

protected java.awt.GridBagConstraints gbc
Contraints object for the panel layout.

originalEnabled

protected boolean originalEnabled
Original enabled value.

enabledCheckbox

protected javax.swing.JCheckBox enabledCheckbox
Checkbox for the breakpoint's enabledness.

originalSkipcount

protected int originalSkipcount
Original skip count value.

skipcountTextfield

protected javax.swing.JTextField skipcountTextfield
Breakpoint's skip count text field.

originalExpirecount

protected int originalExpirecount
Original expire count value.

expirecountTextfield

protected javax.swing.JTextField expirecountTextfield
Breakpoint's expire count text field.

originalGroup

protected BreakpointGroup originalGroup
Original group the breakpoint belonged to.

groupCombo

protected javax.swing.JComboBox groupCombo
Combo box showing the available breakpoint groups.

originalSuspendPolicy

protected int originalSuspendPolicy
Original suspend policy value.

suspendGroup

protected javax.swing.ButtonGroup suspendGroup
Radio button group for the suspend policy.

originalClassFilters

protected java.lang.String originalClassFilters
Original list of class filters.

classFiltersTextfield

protected javax.swing.JTextField classFiltersTextfield
Breakpoint's class filters text field.

originalThreadFilters

protected java.lang.String originalThreadFilters
Original list of thread filters.

threadFiltersTextfield

protected javax.swing.JTextField threadFiltersTextfield
Breakpoint's thread filters text field.
Constructor Detail

BasicBreakpointUI

public BasicBreakpointUI(Breakpoint bp)
Create a BasicBreakpointUI that will operate on the given breakpoint.
Parameters:
bp - breakpoint to be edited.
Method Detail

addClassFilter

public void addClassFilter()
Add the text input field for setting the class filters.

addThreadFilter

public void addThreadFilter()
Add the text input field for setting the thread filters.

buildGroupList

public static javax.swing.JComboBox buildGroupList(BreakpointGroup defaultGroup)
Builds a combo box to display all the available breakpoint groups. Each group is represented using its name plus the names of all of its parents, separated by periods.

To retrieve the selected breakpoint group from the combo box, pass the combo box to the getSelectedGroup() method.

Parameters:
defaultGroup - the "default" breakpoint group, usually retrieved from the breakpoint manager.
Returns:
combo box widget that uses special objects to represent the elements of the list.

commit

public void commit()
Commit the values stored in the user interface elements to the object this adapter is representing (breakpoint, condition, or monitor).
Specified by:
commit in interface UIAdapter

findAndSelectGroup

public static void findAndSelectGroup(javax.swing.JComboBox box,
                                      Breakpoint bp)
Using the given combo box, previously built using buildGroupList(), set one of the breakpoint groups in the combo box as selected according to the parent group of the given breakpoint.
Parameters:
box - combo box in which to select a group.
bp - breakpoint whose parent group should be selected.

getSelectedGroup

public static BreakpointGroup getSelectedGroup(javax.swing.JComboBox box)
Retrieves the selected BreakpointGroup from the given combo box. The combo box must have been built using the buildGroupList() method.
Parameters:
box - combo box that lists breakpoint groups.
Returns:
selected breakpoint group, or null if none.

getUI

public java.awt.Component getUI()
Return a reference to the user interface element that this adapter uses to graphically represent the breakpoint, condition, or monitor. This may be a container that has several user interface elements inside it.
Specified by:
getUI in interface UIAdapter
Returns:
user interface ocmponent.

undo

public void undo()
Reverse the changes made to the object this adapter is representing (breakpoint, condition, or monitor). This must not modify the user interface widgets.
Specified by:
undo in interface UIAdapter
Following copied from interface: com.bluemarsh.jswat.breakpoint.ui.UIAdapter
Throws:
UnsupportedOperationException - Thrown if this operation is not supported.