wt.clients.csm.navigation
Class InlineRangeValueEditorWrapper

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

public class InlineRangeValueEditorWrapper
extends JPanel
implements ActionListener, JCSMTableComponent, MeasurementSystemChangeListener, Serializable

See Also:
Serialized Form

Nested Class Summary
(package private)  class InlineRangeValueEditorWrapper.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  QueryFormElementDefaultView container
           
private  int current
           
private  Vector dataList
           
private static boolean debug
           
private  AttributeDefDefaultView definition
           
private  boolean dirty
           
private  boolean disableDetails
           
private  boolean edit
           
private  boolean hasNullValue
           
private  int max
           
private  String measurementSystem
           
protected static String NAVIGATION_RESOURCE
           
protected  ResourceBundle nvResource
           
private  QueryInfoObject queryObject
           
private static String RESOURCE
           
private static String versionID
           
private  InlineRangeValueEditorWidget 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
InlineRangeValueEditorWrapper(QueryFormElementDefaultView container, AttributeDefDefaultView definition, boolean edit)
          Create the wrapper.
InlineRangeValueEditorWrapper(QueryInfoObject queryObject, QueryFormElementDefaultView container, AttributeDefDefaultView definition, boolean edit)
           
InlineRangeValueEditorWrapper(QueryInfoObject queryObject, QueryFormElementDefaultView container, AttributeDefDefaultView definition, boolean edit, boolean disableDetails)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void addAndDisplayValue(RangeQFElementValueDefaultView obj)
          Add and display the AbstractValueView object.
 int addValue(RangeQFElementValueDefaultView obj)
          Set the AbstractValueView to this wrapper.
 void addValues(Vector vector)
          Set the values from the vector of AbstractValueView.
private  void createWidget(AttributeDefDefaultView definition)
          private method to create the InlineValueEditorWidget.
private  void detailsClick()
          Action for the details click.
protected  void displayExceptionMessage(String key, Object[] params)
           
private  void displayValue(int index)
          Display the value at the index.
 void displayValue(RangeQFElementValueDefaultView obj)
          Display the value.
private  void downClick()
          Action for the down click spinner.
private  int findInsertPosition(RangeQFElementValueDefaultView obj)
          Find the insert position of this object to the vector.
private  int findValuePosition(RangeQFElementValueDefaultView obj)
           
 JComponent getTableComponent()
           
 String getToolTipText()
           
 RangeQFElementValueDefaultView getValue()
          Get the current display AbstractValueView.
 Vector getValues()
          Get all AbstractValueView from this wrapper.
protected  void initResource()
          Initialize resource bundle for internationalization and localization.
 boolean isDirty()
           
 boolean isWidgetEnabled()
           
private  void populateInitialValues()
          Populate the Initial AbstractValueView values.
 void saveValue()
           
protected  void setBusy(boolean busy)
           
 void setMeasurementSystem(String measurementSystem)
           
 void setWidgetEnabled(boolean state)
           
private  void upClick()
          Action for the up click spinner.
 
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, createToolTip, 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

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

debug

private static final boolean debug

versionID

private static final String versionID
See Also:
Constant Field Values

container

private QueryFormElementDefaultView container

definition

private AttributeDefDefaultView definition

queryObject

private QueryInfoObject queryObject

widget

private InlineRangeValueEditorWidget widget

btnUp

private JButton btnUp

btnDown

private JButton btnDown

btnDetails

private JButton btnDetails

dataList

private Vector dataList

edit

private boolean edit

dirty

private boolean dirty

hasNullValue

private boolean hasNullValue

max

private int max

current

private int current

measurementSystem

private String measurementSystem

disableDetails

private boolean disableDetails

NAVIGATION_RESOURCE

protected static final String NAVIGATION_RESOURCE
See Also:
Constant Field Values

nvResource

protected ResourceBundle nvResource
Constructor Detail

InlineRangeValueEditorWrapper

public InlineRangeValueEditorWrapper(QueryFormElementDefaultView 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:
container -
definition -
edit -

InlineRangeValueEditorWrapper

public InlineRangeValueEditorWrapper(QueryInfoObject queryObject,
                                     QueryFormElementDefaultView container,
                                     AttributeDefDefaultView definition,
                                     boolean edit)

InlineRangeValueEditorWrapper

public InlineRangeValueEditorWrapper(QueryInfoObject queryObject,
                                     QueryFormElementDefaultView container,
                                     AttributeDefDefaultView definition,
                                     boolean edit,
                                     boolean disableDetails)
Parameters:
queryObject -
container -
definition -
edit -
Method Detail

initResource

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


addValue

public int addValue(RangeQFElementValueDefaultView 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(RangeQFElementValueDefaultView 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(RangeQFElementValueDefaultView obj)
                        throws ActionAbortedException
Add and display the AbstractValueView object.

Parameters:
obj -
Throws:
ActionAbortedException

findInsertPosition

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

Parameters:
obj -
Returns:
int

findValuePosition

private int findValuePosition(RangeQFElementValueDefaultView obj)
Parameters:
obj -
Returns:
int

getValue

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

Returns:
RangeQFElementValueDefaultView
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(AttributeDefDefaultView definition)
private method to create the InlineValueEditorWidget.

Parameters:
definition -

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener
Parameters:
e -

setBusy

protected void setBusy(boolean busy)
Parameters:
busy -

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 -

displayExceptionMessage

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