Business Objects
Quark Platform Documentation
Version 1.7.0_0
Business Objects

org.openquark.gems.client.valueentry
Class AbstractListValueEditor

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 org.openquark.gems.client.valueentry.ValueEditor
                      extended by org.openquark.gems.client.valueentry.StructuredValueEditor
                          extended by org.openquark.gems.client.valueentry.TableValueEditor
                              extended by org.openquark.gems.client.valueentry.AbstractListValueEditor
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
ListTupleValueEditor

public abstract class AbstractListValueEditor
extends TableValueEditor

This is a super class for value editors which display a list-like interface to the user. This class should not assume that it is editing a specific type of value node (such as a ListValueNode), but instead work with a AbstractListTableModel to manipulate the value.

Author:
Richard Webster
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openquark.gems.client.valueentry.ValueEditor
ValueEditor.Info, ValueEditor.ValueEditorKeyListener
 
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
 
Fields inherited from class org.openquark.gems.client.valueentry.TableValueEditor
table, tableModel, tableScrollPane
 
Fields inherited from class org.openquark.gems.client.valueentry.ValueEditor
valueEditorHierarchyManager, valueEditorManager
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
protected AbstractListValueEditor(ValueEditorHierarchyManager valueEditorHierarchyManager)
          Constructor for AbstractListValueEditor.
 
Method Summary
protected  void addButton_ActionEvents()
          Adds a new row with default values to the table.
protected  JPanel createCenterPanel()
           
protected  JPanel createDivideLeftPanel()
          Creates the panel on the left side of the divider pane.
protected  JPanel createDivideRightPanel()
           
protected  JPanel createEastPanel()
           
protected abstract  AbstractListTableModel createListTableModel(ValueNode valueNode)
          Returns a new model to be used for displaying and editing the data as a list.
protected  JPanel createSouthPanel()
           
protected  ValueEditorTableModel createTableModel(ValueNode valueNode)
          Creates the table model to use by this table editor.
protected  boolean displayElementIcon()
          Returns whether an the type icon should be displayed in the editor.
protected  void downButton_ActionEvents()
          Move the selected row one down.
protected  void enableButtonsForTableState()
          Enable/Disable the buttons according to the current state of the table.
protected  JButton getAddButton()
          Return the AddButton property value.
protected  JPanel getCenterPanel()
          Return the CenterPanel property value.
protected  JSplitPane getCenterSplitPanel()
           
protected  JPanel getDivideLeftPanel()
           
protected  JPanel getDivideRightPanel()
           
protected  JButton getDownButton()
          Return the DownButton property value.
protected  JPanel getEastPanel()
          Return the EastPanel property value.
protected  JTable getElementIndexHeader()
           
protected  TypeExpr getListElementType()
           
protected  AbstractListTableModel getListTableModel()
          Returns an interface for manipulating the contents of the list.
protected  JButton getRemoveButton()
          Return the RemoveButton property value.
protected  JPanel getSouthPanel()
          Return the SouthPanel property value.
protected  JButton getUpButton()
          Return the UpButton property value.
 void handleCellActivated()
          When a cell has been activated, there might be set-up issues that need to be done.
 void handleElementLaunchingEditor()
          Performs any setup needed when a child editor is launched.
 void refreshDisplay()
          Refreshes the ValueEditor to display the latest data.
protected  void removeButton_ActionEvents()
          Removes the selected row.
 void replaceValueNode(ValueNode newValueNode, boolean preserveInfo)
          Replaces the current valueNode with newValueNode.
protected  void resetComponents()
          Adds all of the subcomponents to 'this'.
 void setEditable(boolean b)
          Set the editable state for the ValueEditor.
 void setInitialValue()
          Call this method to make the ValueEditor initialize its values.
protected  void upButton_ActionEvents()
          Moves the selected row up one.
protected  void updateColumnSizes()
          Updates the sizes of the table columns via the auto-resize function of the table, such that either the columns are all proportionately stretched to fit screen size, or the auto-resize is turned off to allow columns to display their preferred size.
protected  void updateIconToolTip()
          Call this whenever the icon's tooltip needs to be refreshed.
protected  void updateRowHeaderDivider()
          Update the location of the split panel divider to show the whole row index text, if it is not already doing so.
protected  void userHasResized()
          This method is called if the user manually resizes the value editor.
 
Methods inherited from class org.openquark.gems.client.valueentry.TableValueEditor
cancelValue, clearSelection, commitChildChanges, commitValue, createTableCellEditor, createTableHeaderRenderer, getColumnCount, getDefaultFocusComponent, getRowCount, getSaveSize, getSelectedColumn, getSelectedRow, getTableHeader, initializeTableCellRenderers, initSize, loadSavedSize, scrollToSelectedRow, selectCell, setOwnerValueNode, setTableModel, showTypeIconInColumnHeading
 
Methods inherited from class org.openquark.gems.client.valueentry.ValueEditor
addValueEditorListener, changeOwnerValue, childrenHasFocus, copyToClipboard, cutToClipboard, editorActivated, getContext, getMaxResizeDimension, getMinResizeDimension, getOwnerValueNode, getParentValueEditor, getValueEditorHierarchyManager, getValueNode, handleCancelGesture, handleCommitGesture, hasOverallFocus, isEditable, isEditorClosing, isMoveable, isResizable, notifyValueCanceled, notifyValueChanged, notifyValueCommitted, paintComponent, pasteFromClipboard, removeValueEditorListener, setContext, setEditorIsClosing, setLocation, setLocation, setMaxResizeDimension, setMinResizeDimension, setMoveable, setParentValueEditor, setResizable, setSize, setSize
 
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, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, 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, 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, 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, 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, setName, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractListValueEditor

protected AbstractListValueEditor(ValueEditorHierarchyManager valueEditorHierarchyManager)
Constructor for AbstractListValueEditor.

Parameters:
valueEditorHierarchyManager - the hierarchy manager for the editor
Method Detail

createTableModel

protected ValueEditorTableModel createTableModel(ValueNode valueNode)
Description copied from class: TableValueEditor
Creates the table model to use by this table editor. Subclasses implement this to return the proper table model they want to use.

Specified by:
createTableModel in class TableValueEditor
Parameters:
valueNode - the value node to create the table model for
Returns:
ValueEditorTableModel
See Also:
TableValueEditor.createTableModel(org.openquark.cal.valuenode.ValueNode)

createListTableModel

protected abstract AbstractListTableModel createListTableModel(ValueNode valueNode)
Returns a new model to be used for displaying and editing the data as a list. Subclasses should implement this instead of createTableModel.

Returns:
a new model to be used for displaying and editing the data as a list

getListTableModel

protected AbstractListTableModel getListTableModel()
Returns an interface for manipulating the contents of the list.

Returns:
an interface for manipulating the contents of the list

resetComponents

protected void resetComponents()
Adds all of the subcomponents to 'this'. The subcomponents include the centre panel showing the table, the east components showing up/down arrows, and the south component showing the add/remove item buttons. If the value editor is editable (determined by calling isEditable()) then all components are shown. If the editor is not editable then only the centre component is shown for viewing the data.


setEditable

public void setEditable(boolean b)
Description copied from class: ValueEditor
Set the editable state for the ValueEditor. Normally a value editor is always editable. However, in some cases we may want a non-editable value editor. For example: A ValueEntryPanel containing a large a textual result would be too small to show all the text and there is no provision for scrolling. The user can call up the StringValueEditor, which does scroll, in order to more easily read all the text. But we don't want them trying to edit the result.

Overrides:
setEditable in class TableValueEditor
See Also:
ValueEditor.setEditable(boolean)

upButton_ActionEvents

protected void upButton_ActionEvents()
Moves the selected row up one.


downButton_ActionEvents

protected void downButton_ActionEvents()
Move the selected row one down.


addButton_ActionEvents

protected void addButton_ActionEvents()
Adds a new row with default values to the table.


removeButton_ActionEvents

protected void removeButton_ActionEvents()
Removes the selected row.


getAddButton

protected JButton getAddButton()
Return the AddButton property value.

Returns:
JButton

getCenterPanel

protected JPanel getCenterPanel()
Return the CenterPanel property value.

Returns:
JPanel

getCenterSplitPanel

protected JSplitPane getCenterSplitPanel()
Returns:
split panel used in the center of the VEP

createCenterPanel

protected JPanel createCenterPanel()
Returns:
panel used in the center of the VEP

getDivideRightPanel

protected JPanel getDivideRightPanel()
Returns:
the panel used on the right hand side of the divider pane

createDivideRightPanel

protected JPanel createDivideRightPanel()
Returns:
new panel to use on the right hand side of the divider pane

getDivideLeftPanel

protected JPanel getDivideLeftPanel()
Returns:
the panel used on the left hand side of the divider pane

createDivideLeftPanel

protected JPanel createDivideLeftPanel()
Creates the panel on the left side of the divider pane. This panel contains the column header " # ", and the left divide scroll pane.

Returns:
new panel to use on the left side of the divide pane

getElementIndexHeader

protected JTable getElementIndexHeader()
Returns:
the list row header

displayElementIcon

protected boolean displayElementIcon()
Returns whether an the type icon should be displayed in the editor.


getDownButton

protected JButton getDownButton()
Return the DownButton property value.

Returns:
JButton

getEastPanel

protected JPanel getEastPanel()
Return the EastPanel property value.

Returns:
JPanel

createEastPanel

protected JPanel createEastPanel()
Returns:
new EastPanel

getRemoveButton

protected JButton getRemoveButton()
Return the RemoveButton property value.

Returns:
JButton

getSouthPanel

protected JPanel getSouthPanel()
Return the SouthPanel property value.

Returns:
JPanel

createSouthPanel

protected JPanel createSouthPanel()
Returns:
newly created SouthPanel

getUpButton

protected JButton getUpButton()
Return the UpButton property value.

Returns:
JButton

handleCellActivated

public void handleCellActivated()
When a cell has been activated, there might be set-up issues that need to be done. By default this method makes the editor resizable and enables the scrollbars. Subclasses should override this to perform any additional setup needed.

Overrides:
handleCellActivated in class TableValueEditor

handleElementLaunchingEditor

public void handleElementLaunchingEditor()
Performs any setup needed when a child editor is launched. By default this disables resizability and the scrollbars. Subclasses should override this to perform any additional setup needed.

Overrides:
handleElementLaunchingEditor in class TableValueEditor

enableButtonsForTableState

protected void enableButtonsForTableState()
Enable/Disable the buttons according to the current state of the table. Creation date: (03/14/02 11:21:00 AM)


updateRowHeaderDivider

protected void updateRowHeaderDivider()
Update the location of the split panel divider to show the whole row index text, if it is not already doing so. Ex: When creating a new list, this method shifts the divider right when expanding the list from 9 to 10 rows.


setInitialValue

public void setInitialValue()
Description copied from class: ValueEditor
Call this method to make the ValueEditor initialize its values. Note: Usually call this method after adding the ValueEditor to the display, setting its ValueNode, and correctly updating the currentEditor and the currentEditorStack, since some implementations of this method will require that pre-condition.

Specified by:
setInitialValue in class ValueEditor
See Also:
ValueEditor.setInitialValue()

refreshDisplay

public void refreshDisplay()
Description copied from class: ValueEditor
Refreshes the ValueEditor to display the latest data. Note: The default implementation is to do nothing. All subclasses that need this will have to override this method. This method is called if the editor that is in the hierarchy below this editor is closed and this editor in turn becomes the current editor. It is also called when an editor that was previously not showing on screen is now shown on screen.

Overrides:
refreshDisplay in class ValueEditor
See Also:
ValueEditor.refreshDisplay()

userHasResized

protected void userHasResized()
This method is called if the user manually resizes the value editor. Subclasses can implement this to perform special actions they may require.

Overrides:
userHasResized in class ValueEditor

updateColumnSizes

protected void updateColumnSizes()
Updates the sizes of the table columns via the auto-resize function of the table, such that either the columns are all proportionately stretched to fit screen size, or the auto-resize is turned off to allow columns to display their preferred size.


updateIconToolTip

protected void updateIconToolTip()
Call this whenever the icon's tooltip needs to be refreshed. What happens is that the number of elements in this list will be shown in the tooltip. Creation date: (16/03/01 2:30:09 PM)


getListElementType

protected TypeExpr getListElementType()
Returns:
type expression of the list elements

replaceValueNode

public void replaceValueNode(ValueNode newValueNode,
                             boolean preserveInfo)
Replaces the current valueNode with newValueNode. Notice you are replacing the current working copy of the valueNode, not the ownerValueNode

Overrides:
replaceValueNode in class TableValueEditor
See Also:
ValueEditor.replaceValueNode(org.openquark.cal.valuenode.ValueNode, boolean)