com.klg.jclass.datasource.swing
Class DSdbJList
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JList
|
+--com.klg.jclass.datasource.swing.DSdbJList
- All Implemented Interfaces:
- Accessible, EventListener, ImageObserver, ListSelectionListener, MenuContainer, Scrollable, Serializable
- public class DSdbJList
- extends JList
- implements ListSelectionListener
This class binds a JList to a column in the datasource. The list selection
responds to row changes in the datasource and can initiate one.
- See Also:
- Serialized Form
Constructor Summary |
DSdbJList()
Creates a new DSdbJList component. |
DSdbJList(com.klg.jclass.datasource.BindingModel binding,
String columnName)
Create and bind to a Binding |
DSdbJList(com.klg.jclass.datasource.DataModel dataModel,
com.klg.jclass.datasource.MetaDataModel metaDataModel,
String columnName)
Creates a new DSdbJList component and binds it to a particular column
in a MetaDataModel. |
Method Summary |
String |
getDataBinding()
Returns the data binding hierarchy string, starting from a JCTreeData instance name
and containing full sequence of MetaDataModel levels starting from the root to the
level the table is bound with. |
int |
getFixedCellHeight()
|
int |
getFixedCellWidth()
|
Dimension |
getMinimumSize()
Returns the minimum size of the component. |
Dimension |
getPreferredSize()
Returns the preferred size of the component. |
int |
getVisibleRowCount()
|
void |
paint(Graphics gc)
Override to display default text if unbound. |
void |
setDataBinding(com.klg.jclass.datasource.BindingModel binding,
String columnName)
Sets the data source to a DataModel and binds the MetaData to the
MetaDataModel represented by a "path" of MetaDataModel descriptions
separated by '|' (e.g. |
void |
setDataBinding(com.klg.jclass.datasource.DataModel dataModel,
com.klg.jclass.datasource.MetaDataModel metaDataModel,
String columnName)
Sets the parameters for binding the component to a particular column
in a MetaDataModel. |
void |
setDataBinding(com.klg.jclass.datasource.DataModel dataModel,
String metaPath)
Sets the data source to a DataModel and binds the MetaData to the
MetaDataModel represented by a "path" of MetaDataModel descriptions
separated by '|' (e.g. |
void |
setDataBinding(String dataBinding)
Sets the data source to the path of DataModel, MetaDataModel descriptions
and column name. |
void |
setSelectionMode(int selectionMode)
Only SINGLE_SELECTION selection mode is allowed. |
void |
valueChanged(ListSelectionEvent event)
Called when an item's state has been changed. |
Methods inherited from class javax.swing.JList |
addListSelectionListener, addSelectionInterval, clearSelection, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getFirstVisibleIndex, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionModel, setUI, setValueIsAdjusting, setVisibleRowCount, 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, getNextFocusableComponent, 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, 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 |
columnBinding
protected com.klg.jclass.datasource.swing.DSdbJList.ColumnDataBinding columnBinding
shouldMove
protected boolean shouldMove
nullDatabindingText
protected static final String nullDatabindingText
- See Also:
- Constant Field Values
textMargin
protected int textMargin
DSdbJList
public DSdbJList()
- Creates a new DSdbJList component.
DSdbJList
public DSdbJList(com.klg.jclass.datasource.DataModel dataModel,
com.klg.jclass.datasource.MetaDataModel metaDataModel,
String columnName)
- Creates a new DSdbJList component and binds it to a particular column
in a MetaDataModel.
- See Also:
NodeProperties.setDataSource(java.lang.Object)
DSdbJList
public DSdbJList(com.klg.jclass.datasource.BindingModel binding,
String columnName)
- Create and bind to a Binding
setSelectionMode
public void setSelectionMode(int selectionMode)
- Only SINGLE_SELECTION selection mode is allowed.
- Overrides:
setSelectionMode
in class JList
setDataBinding
public void setDataBinding(com.klg.jclass.datasource.DataModel dataModel,
com.klg.jclass.datasource.MetaDataModel metaDataModel,
String columnName)
- Sets the parameters for binding the component to a particular column
in a MetaDataModel. If the MetaDataModel is the root in the DataModel's
MetaDataTree, the DataTableModel is automatically set to the root
DataTableModel, otherwise, the DataTableModel is set when an appropriate
table becomes available.
setDataBinding
public void setDataBinding(com.klg.jclass.datasource.DataModel dataModel,
String metaPath)
- Sets the data source to a DataModel and binds the MetaData to the
MetaDataModel represented by a "path" of MetaDataModel descriptions
separated by '|' (e.g. Orders|Customers).
setDataBinding
public void setDataBinding(com.klg.jclass.datasource.BindingModel binding,
String columnName)
- Sets the data source to a DataModel and binds the MetaData to the
MetaDataModel represented by a "path" of MetaDataModel descriptions
separated by '|' (e.g. Orders|Customers).
setDataBinding
public void setDataBinding(String dataBinding)
- Sets the data source to the path of DataModel, MetaDataModel descriptions
and column name.
getDataBinding
public String getDataBinding()
- Returns the data binding hierarchy string, starting from a JCTreeData instance name
and containing full sequence of MetaDataModel levels starting from the root to the
level the table is bound with.
valueChanged
public void valueChanged(ListSelectionEvent event)
- Called when an item's state has been changed.
- Specified by:
valueChanged
in interface ListSelectionListener
paint
public void paint(Graphics gc)
- Override to display default text if unbound.
- Overrides:
paint
in class JComponent
getFixedCellWidth
public int getFixedCellWidth()
- Overrides:
getFixedCellWidth
in class JList
getFixedCellHeight
public int getFixedCellHeight()
- Overrides:
getFixedCellHeight
in class JList
getVisibleRowCount
public int getVisibleRowCount()
- Overrides:
getVisibleRowCount
in class JList
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred size of the component.
- Overrides:
getPreferredSize
in class JComponent
getMinimumSize
public Dimension getMinimumSize()
- Returns the minimum size of the component.
- Overrides:
getMinimumSize
in class JComponent