|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
net.xoetrope.swing.XScrollPane
net.xoetrope.swing.XTable
public class XTable
Provides a simple read-only tables/grid component.
Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt
$Revision: 2.6 $
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JScrollPane |
|---|
javax.swing.JScrollPane.AccessibleJScrollPane, javax.swing.JScrollPane.ScrollBar |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JScrollPane |
|---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
| 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 javax.swing.ScrollPaneConstants |
|---|
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
XTable()
Create a new table |
|
| Method Summary | |
|---|---|
void |
addItemListener(java.awt.event.ItemListener l)
Adds the specified item listener to receive item events from this list. |
void |
addMouseListener(java.awt.event.MouseListener l)
Add a mouse listener |
void |
addNotify()
Creates the scroll pane's peer and sizes the child element. |
void |
checkSize()
Recalculate and check the size of the content |
void |
first()
Move to the first row |
long |
getComponentHashCode()
Get the hash code to be used by the event handler for this component |
java.awt.Container |
getComponentPanel()
Get the container that holds the components |
java.lang.String |
getContent()
Set the model's name |
java.lang.String |
getFieldValue(int fieldIdx)
Gets a field value as a string from the currently selected row |
java.lang.String |
getFieldValue(int rowIdx,
int fieldIdx)
Gets a field value as a string from the specified row |
XModel |
getModel()
Get the underlying model. |
java.lang.Object[] |
getSelectedObjects()
Returns the selected items on the list in an array of objects. |
int |
getSelectedRow()
Get the index of the selected row |
java.lang.Object |
getValue(int fieldIdx)
Gets a field value object from the currently selected row |
java.lang.Object |
getValue(int rowIdx,
int fieldIdx)
Gets a field value object from the specified row |
boolean |
isInteractiveTable()
Check the if the table is interactive |
void |
last()
Move to the last row |
void |
next()
Move to the next row |
void |
prev()
Move to the previous row |
void |
removeItemListener(java.awt.event.ItemListener l)
Removes the specified item listener so that it no longer receives item events from this list. |
void |
setAttribute(java.lang.String attribName,
java.lang.Object attribValue)
Set one or more attributes of the component. |
void |
setBorderStyle(java.lang.String style)
Set the style of the border |
void |
setBounds(int x,
int y,
int w,
int h)
Sets the bounds for this component |
void |
setColWidth(int fieldIdx,
int w)
Set the table column width; |
void |
setComponentAt(int col,
java.lang.String className)
Set the type of component for a column |
void |
setHeaderStyle(java.lang.String style)
Set the style of the header data |
void |
setInteractiveTable(boolean state)
Set the user interaction state |
void |
setModel(XModel xmodel)
Set the XModel which we will be generating the table from |
void |
setSelectedRow(int idx)
Sets the indexof the selected row |
void |
setSelectedStyle(java.lang.String style)
Set the style of the selected row |
void |
setStyle(java.lang.String style)
Set the general style of the XTable |
void |
setUpdateModelSelection(boolean doUpdate)
Tie the model selection to this table's selection |
void |
update()
implemented from XModelHolder interface |
| Methods inherited from class net.xoetrope.swing.XScrollPane |
|---|
add, setNextHorzScrollPanePolicy, setNextScrollPanePolicy, setNextVertScrollPanePolicy |
| Methods inherited from class javax.swing.JScrollPane |
|---|
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, 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, 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, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, 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, 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 |
| Constructor Detail |
|---|
public XTable()
| Method Detail |
|---|
public void update()
update in interface XModelHolderpublic void setModel(XModel xmodel)
setModel in interface XModelHolderxmodel - The XModel of datapublic XModel getModel()
public void checkSize()
public java.awt.Container getComponentPanel()
public void setComponentAt(int col,
java.lang.String className)
col - the field indexclassName - the class namepublic java.lang.String getContent()
public void addNotify()
addNotify in class javax.swing.JComponentpublic void setStyle(java.lang.String style)
setStyle in interface XStyleComponentstyle - XStylepublic void setHeaderStyle(java.lang.String style)
style - XStylepublic void setSelectedStyle(java.lang.String style)
style - XStylepublic void setBorderStyle(java.lang.String style)
style - XStylepublic boolean isInteractiveTable()
public void setInteractiveTable(boolean state)
state - true for an user interactive table.public void setSelectedRow(int idx)
setSelectedRow in interface XRowSelectoridx - the new selected rowpublic int getSelectedRow()
getSelectedRow in interface XRowSelectorpublic void first()
public void prev()
public void next()
public void last()
public void setUpdateModelSelection(boolean doUpdate)
doUpdate - true to tie the selections together, false to ignore
public void setBounds(int x,
int y,
int w,
int h)
setBounds in class java.awt.Componentx - x/lefty - y/topw - widthh - height
public void setColWidth(int fieldIdx,
int w)
fieldIdx - the field indexw - the new column width
public void setAttribute(java.lang.String attribName,
java.lang.Object attribValue)
setAttribute in interface XAttributedComponentsetAttribute in class XScrollPaneattribName - the attribute nameattribValue - the attribute valuepublic java.lang.Object getValue(int fieldIdx)
fieldIdx - the field offset
public java.lang.Object getValue(int rowIdx,
int fieldIdx)
rowIdx - the row offsetfieldIdx - the field offset
public java.lang.String getFieldValue(int fieldIdx)
fieldIdx - the field offset
public java.lang.String getFieldValue(int rowIdx,
int fieldIdx)
rowIdx - the row offsetfieldIdx - the field offset
public void addItemListener(java.awt.event.ItemListener l)
select or deselect.
If listener l is null,
no exception is thrown and no action is performed.
addItemListener in interface java.awt.ItemSelectablel - the item listenerItemEvent,
ItemListenerpublic void removeItemListener(java.awt.event.ItemListener l)
l is null,
no exception is thrown and no action is performed.
removeItemListener in interface java.awt.ItemSelectablel - the item listenerItemEvent,
ItemListenerpublic java.lang.Object[] getSelectedObjects()
getSelectedObjects in interface java.awt.ItemSelectableItemSelectablepublic void addMouseListener(java.awt.event.MouseListener l)
addMouseListener in class java.awt.Componentl - the new mouse listenerpublic long getComponentHashCode()
getComponentHashCode in interface XHashCode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||