wt.clients.iba.container
Class InlineValueEditorWrapper

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bywt.clients.iba.container.InlineValueEditorWrapper
All Implemented Interfaces:
Accessible, ActionListener, EventListener, ImageObserver, JCSMTableComponent, MeasurementSystemChangeListener, MenuContainer, Serializable, ValueEditorListenerInterface

public class InlineValueEditorWrapper
extends JPanel
implements ValueEditorListenerInterface, ActionListener, JCSMTableComponent, MeasurementSystemChangeListener, Serializable

This wrapper will be added to the table cell as it implements the JCSMTableComponent. After creation, it will create the InlineValueEditorWidget depending on the AttributeContainer and the AttributeDefDefaultView. It consists of the widget, the up spinner button, the down spinner button, and the details button.

See Also:
Serialized Form

Nested Class Summary
(package private)  class InlineValueEditorWrapper.DetailsPanel
           
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  JButton btnDetails
           
private  JButton btnDown
           
private  JButton btnUp
           
private static String CLASSNAME
           
private  DefaultAttributeContainer container
           
protected static String CONTAINER_RESOURCE
           
protected  ResourceBundle containerResource
           
private  int current
           
private  Vector dataList
           
private static boolean debug
           
private  AttributeDefDefaultView definition
           
private  boolean dirty
           
private  boolean edit
           
private  boolean immutable
           
private  int max
           
private  String measurementSystem
           
private  ValueEditorListenerInterface parent
           
private static String RESOURCE
           
private static String versionID
           
private  InlineValueEditorWidgetInterface widget
           
 
Fields inherited from class javax.swing.JPanel
 
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.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
InlineValueEditorWrapper(ValueEditorListenerInterface parent, DefaultAttributeContainer container, AttributeDefDefaultView definition, boolean edit)
          Create the wrapper.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Inherited from ActionListener.
 void addAndDisplayValue(AbstractValueView obj)
          Add and display the AbstractValueView object.
 int addValue(AbstractValueView obj)
          Set the AbstractValueView to this wrapper.
 void addValues(Vector vector)
          Set the values from the vector of AbstractValueView.
 JToolTip createToolTip()
           
private  void createWidget(DefaultAttributeContainer container, AttributeDefDefaultView definition)
          private method to create the InlineValueEditorWidget.
private  void detailsClick()
          Action for the details click.
protected  void displayExceptionMessage(String key, Object[] params)
           
 void displayValue(AbstractValueView obj)
          Display the value.
private  void displayValue(int index)
          Display the value at the index.
private  void downClick()
          Action for the down click spinner.
private  int findInsertPosition(AbstractValueView obj)
          Find the insert position of this object to the vector.
 JComponent getTableComponent()
           
 String getToolTipText()
           
 AbstractValueView getValue()
          Get the current display AbstractValueView.
 Vector getValues()
          Get all AbstractValueView from this wrapper.
 boolean hasUninitializedValues()
           
protected  void initResource()
          Initialize resource bundle for internationalization and localization.
 boolean isDirty()
           
 boolean isWidgetEnabled()
           
private  void populateInitialValues()
          Populate the Initial AbstractValueView values.
 void refreshConstraint()
           
 void saveValue()
           
protected  void setBusy(boolean busy)
           
 void setMeasurementSystem(String measurementSystem)
           
 void setWidgetEnabled(boolean state)
           
private  void upClick()
          Action for the up click spinner.
 void valueChanged()
          Callback function.
 void valueShown(AttributeDefDefaultView definition, AbstractValueView obj)
          Callback function.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

private static final boolean debug

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

versionID

private static final String versionID
See Also:
Constant Field Values

parent

private ValueEditorListenerInterface parent

container

private DefaultAttributeContainer container

definition

private AttributeDefDefaultView definition

widget

private InlineValueEditorWidgetInterface widget

btnUp

private JButton btnUp

btnDown

private JButton btnDown

btnDetails

private JButton btnDetails

dataList

private Vector dataList

edit

private boolean edit

measurementSystem

private String measurementSystem

CONTAINER_RESOURCE

protected static final String CONTAINER_RESOURCE
See Also:
Constant Field Values

containerResource

protected ResourceBundle containerResource

max

private int max

current

private int current

dirty

private boolean dirty

immutable

private boolean immutable
Constructor Detail

InlineValueEditorWrapper

public InlineValueEditorWrapper(ValueEditorListenerInterface parent,
                                DefaultAttributeContainer container,
                                AttributeDefDefaultView definition,
                                boolean edit)
Create the wrapper. The parent is used for callback about any changes it made. The AttributeContainer and the AttrbiuteDefDefaultView are used for creating the InlineValueEditorWidget. The edit boolean parameter is used to set the widget enabled state.

Parameters:
parent -
container -
definition -
edit -
Method Detail

initResource

protected void initResource()
Initialize resource bundle for internationalization and localization.


addValue

public int addValue(AbstractValueView obj)
Set the AbstractValueView to this wrapper. It will only add the object to the vector list without displaying.

Parameters:
obj -
Returns:
int

addValues

public void addValues(Vector vector)
Set the values from the vector of AbstractValueView.

Parameters:
vector -

displayValue

public void displayValue(AbstractValueView obj)
                  throws ActionAbortedException
Display the value. If the object is not in the list. Nothing will happen. Otherwise, the object will be displayed inside the InlineValueEditorWidget.

Parameters:
obj -
Throws:
ActionAbortedException

displayValue

private void displayValue(int index)
                   throws ActionAbortedException
Display the value at the index.

Parameters:
index -
Throws:
ActionAbortedException

addAndDisplayValue

public void addAndDisplayValue(AbstractValueView obj)
                        throws ActionAbortedException
Add and display the AbstractValueView object.

Parameters:
obj -
Throws:
ActionAbortedException

findInsertPosition

private int findInsertPosition(AbstractValueView obj)
Find the insert position of this object to the vector.

Parameters:
obj -
Returns:
int

getValue

public AbstractValueView getValue()
                           throws ActionAbortedException
Get the current display AbstractValueView.

Returns:
AbstractValueView
Throws:
ActionAbortedException

getValues

public Vector getValues()
Get all AbstractValueView from this wrapper.

Returns:
Vector

populateInitialValues

private void populateInitialValues()
Populate the Initial AbstractValueView values.


upClick

private void upClick()
Action for the up click spinner.


downClick

private void downClick()
Action for the down click spinner.


detailsClick

private void detailsClick()
Action for the details click.


createWidget

private void createWidget(DefaultAttributeContainer container,
                          AttributeDefDefaultView definition)
private method to create the InlineValueEditorWidget.

Parameters:
container -
definition -

actionPerformed

public void actionPerformed(ActionEvent e)
Inherited from ActionListener.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e -

valueChanged

public void valueChanged()
Callback function. The InlineValueEditorWidget will use the valueChanged to notify the Wrapper or Tabbed panel about the value changed.

Specified by:
valueChanged in interface ValueEditorListenerInterface

valueShown

public void valueShown(AttributeDefDefaultView definition,
                       AbstractValueView obj)
Callback function. The wrapper will use the valueShown method to tell the editorpanel that the value shown has changed.

Specified by:
valueShown in interface ValueEditorListenerInterface
Parameters:
definition -
obj -

getTableComponent

public JComponent getTableComponent()
Specified by:
getTableComponent in interface JCSMTableComponent
Returns:
JComponent

setWidgetEnabled

public void setWidgetEnabled(boolean state)
Specified by:
setWidgetEnabled in interface JCSMTableComponent
Parameters:
state -

isWidgetEnabled

public boolean isWidgetEnabled()
Specified by:
isWidgetEnabled in interface JCSMTableComponent
Returns:
boolean

isDirty

public boolean isDirty()
Specified by:
isDirty in interface JCSMTableComponent
Returns:
boolean

saveValue

public void saveValue()
               throws ActionAbortedException
Specified by:
saveValue in interface JCSMTableComponent
Throws:
ActionAbortedException

getToolTipText

public String getToolTipText()
Specified by:
getToolTipText in interface JCSMTableComponent
Returns:
String

setMeasurementSystem

public void setMeasurementSystem(String measurementSystem)
Specified by:
setMeasurementSystem in interface MeasurementSystemChangeListener
Parameters:
measurementSystem -

hasUninitializedValues

public boolean hasUninitializedValues()

createToolTip

public JToolTip createToolTip()

setBusy

protected void setBusy(boolean busy)

displayExceptionMessage

protected void displayExceptionMessage(String key,
                                       Object[] params)

refreshConstraint

public void refreshConstraint()