abbot.editor.editors
Class StepEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by abbot.editor.editors.StepEditor
All Implemented Interfaces:
XMLConstants, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, Scrollable
Direct Known Subclasses:
AnnotationEditor, AppletviewerEditor, CallEditor, CommentEditor, EventEditor, ExpressionEditor, SequenceEditor

public abstract class StepEditor
extends JPanel
implements ActionListener, Scrollable, XMLConstants

Provide base-level step editor support with step change notification.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected static Color DEFAULT_FOREGROUND
           
(package private)  JTextField description
           
protected static Color ERROR_FOREGROUND
           
protected static int MARGIN
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface abbot.script.XMLConstants
TAG_ACTION, TAG_APPLETVIEWER, TAG_ARCHIVE, TAG_ARGS, TAG_ASSERT, TAG_AWT, TAG_AWTTESTSCRIPT, TAG_BORDER_TITLE, TAG_CALL, TAG_CLASS, TAG_CLASSPATH, TAG_CODE, TAG_CODEBASE, TAG_COMMENT, TAG_COMPONENT, TAG_COUNT, TAG_DELEGATE, TAG_DESC, TAG_DOCBASE, TAG_EVENT, TAG_EXPR, TAG_FILENAME, TAG_FIXTURE, TAG_FORKED, TAG_HEIGHT, TAG_HORDER, TAG_ICON, TAG_ID, TAG_INDEX, TAG_INVERT, TAG_INVOKER, TAG_KEYCHAR, TAG_KEYCODE, TAG_KIND, TAG_LABEL, TAG_LAUNCH, TAG_METHOD, TAG_MODIFIERS, TAG_NAME, TAG_PARAMS, TAG_PARENT, TAG_POLL_INTERVAL, TAG_PROPERTY, TAG_ROOT, TAG_SAMPLE, TAG_SCRIPT, TAG_SEQUENCE, TAG_SLOW, TAG_STOP_ON_ERROR, TAG_STOP_ON_FAILURE, TAG_TAG, TAG_TERMINATE, TAG_TEXT, TAG_THREADED, TAG_TIMEOUT, TAG_TITLE, TAG_TRIGGER, TAG_TYPE, TAG_VALUE, TAG_VMARGS, TAG_VORDER, TAG_WAIT, TAG_WEIGHTED, TAG_WIDTH, TAG_WINDOW, TAG_X, TAG_Y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
StepEditor(Step step)
           
 
Method Summary
 void actionPerformed(ActionEvent ev)
          Respond to UI changes by updating the step data.
 Component add(Component comp)
          Automatically add a vertical struct with a component.
 Component add(String name, Component comp)
          Auto-add a label with a component.
protected  ArrayEditor addArrayEditor(String title, Object[] values)
           
protected  JButton addButton(String title)
           
protected  JCheckBox addCheckBox(String title, boolean value)
           
protected  JComboBox addComboBox(String title, Object value, Object[] values)
           
protected  JComboBox addComponentSelector(String title, String refid, Resolver resolver, boolean allowNone)
           
 void addStepChangeListener(StepChangeListener scl)
           
protected  JTextArea addTextArea(String title, String value)
           
protected  JTextField addTextField(String title, String value)
           
protected  JTextField addTextField(String title, String value, String defaultValue)
           
protected  void fireStepChanged()
          This method should be invoked after any change to step data.
static StepEditor getEditor(Step step)
          Return the appropriate editor panel for the given Step.
 Dimension getMaximumSize()
          We don't want to become infinitely wide due to text fields.
 Dimension getMinimumSize()
          Keep a reasonable minimum width.
 Dimension getPreferredScrollableViewportSize()
          Always maintain the minimum width.
 Dimension getPreferredSize()
          Keep a reasonable minimum width.
 int getScrollableBlockIncrement(Rectangle visible, int orient, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(Rectangle visible, int orient, int direction)
           
 void remove(Component comp)
          Automatically remove the strut spacing and the component.
 void removeStepChangeListener(StepChangeListener scl)
           
 String toString()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

description

JTextField description

MARGIN

protected static final int MARGIN
See Also:
Constant Field Values

DEFAULT_FOREGROUND

protected static Color DEFAULT_FOREGROUND

ERROR_FOREGROUND

protected static Color ERROR_FOREGROUND
Constructor Detail

StepEditor

public StepEditor(Step step)
Method Detail

getMinimumSize

public Dimension getMinimumSize()
Keep a reasonable minimum width.

Overrides:
getMinimumSize in class JComponent

getPreferredSize

public Dimension getPreferredSize()
Keep a reasonable minimum width.

Overrides:
getPreferredSize in class JComponent

getMaximumSize

public Dimension getMaximumSize()
We don't want to become infinitely wide due to text fields.

Overrides:
getMaximumSize in class JComponent

addCheckBox

protected JCheckBox addCheckBox(String title,
                                boolean value)

addComponentSelector

protected JComboBox addComponentSelector(String title,
                                         String refid,
                                         Resolver resolver,
                                         boolean allowNone)

addComboBox

protected JComboBox addComboBox(String title,
                                Object value,
                                Object[] values)

addTextField

protected JTextField addTextField(String title,
                                  String value)

addTextField

protected JTextField addTextField(String title,
                                  String value,
                                  String defaultValue)

addArrayEditor

protected ArrayEditor addArrayEditor(String title,
                                     Object[] values)

addButton

protected JButton addButton(String title)

addTextArea

protected JTextArea addTextArea(String title,
                                String value)

remove

public void remove(Component comp)
Automatically remove the strut spacing and the component.

Overrides:
remove in class Container

add

public Component add(String name,
                     Component comp)
Auto-add a label with a component.

Overrides:
add in class Container

add

public Component add(Component comp)
Automatically add a vertical struct with a component.

Overrides:
add in class Container

actionPerformed

public void actionPerformed(ActionEvent ev)
Respond to UI changes by updating the step data.

Specified by:
actionPerformed in interface ActionListener

addStepChangeListener

public void addStepChangeListener(StepChangeListener scl)

removeStepChangeListener

public void removeStepChangeListener(StepChangeListener scl)

fireStepChanged

protected void fireStepChanged()
This method should be invoked after any change to step data.


getEditor

public static StepEditor getEditor(Step step)
Return the appropriate editor panel for the given Step. Custom editors must be named after the step class name, and be defined in the abbot.editor.editors package, e.g. abbot.script.Launch expects abbot.editor.editors.LaunchEditor, abbot.script.Assert expects abbot.editor.editors.AssertEditor.


getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize()
Always maintain the minimum width.

Specified by:
getPreferredScrollableViewportSize in interface Scrollable

getScrollableBlockIncrement

public int getScrollableBlockIncrement(Rectangle visible,
                                       int orient,
                                       int direction)
Specified by:
getScrollableBlockIncrement in interface Scrollable

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface Scrollable

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(Rectangle visible,
                                      int orient,
                                      int direction)
Specified by:
getScrollableUnitIncrement in interface Scrollable

toString

public String toString()
Overrides:
toString in class Component


Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge