|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.ScrollPane
net.xoetrope.awt.XScrollPane
net.xoetrope.awt.XTable
public class XTable
Provides a simple read-only tables/grid component.
Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt
$Revision: 2.7 $
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.ScrollPane |
|---|
java.awt.ScrollPane.AccessibleAWTScrollPane |
| 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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class java.awt.ScrollPane |
|---|
SCROLLBARS_ALWAYS, SCROLLBARS_AS_NEEDED, SCROLLBARS_NEVER |
| 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 | |
|---|---|
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()
Create a panel for 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 |
paint(java.awt.Graphics g)
Render the component |
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 |
repaint()
Request the component repaint itself |
void |
requestFocus()
Forward the focus request to the content/table renderer |
void |
scrollToBottom()
recalculates the size of the scroll area for dynamic table; |
int |
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()
recalculates the size of the scroll area for dynamic table; |
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.awt.XScrollPane |
|---|
add, setNextScrollPanePolicy |
| Methods inherited from class java.awt.ScrollPane |
|---|
addImpl, doLayout, eventTypeEnabled, getAccessibleContext, getHAdjustable, getHScrollbarHeight, getScrollbarDisplayPolicy, getScrollPosition, getVAdjustable, getViewportSize, getVScrollbarWidth, isWheelScrollingEnabled, layout, paramString, printComponents, processMouseWheelEvent, setLayout, setScrollPosition, setScrollPosition, setWheelScrollingEnabled |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, locate, minimumSize, paintComponents, preferredSize, print, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, 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 java.awt.Container getComponentPanel()
public void setModel(XModel xmodel)
setModel in interface XModelHolderxmodel - The XModel of datapublic XModel getModel()
public void checkSize()
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 java.awt.ScrollPanepublic 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 - the left coordinatey - the top coordinatew - the width dimensionh - the height dimensionpublic void setBounds()
public void scrollToBottom()
public void setColWidth(int fieldIdx,
int w)
fieldIdx - the field indexw - the new column width
public int setAttribute(java.lang.String attribName,
java.lang.Object attribValue)
setAttribute in interface XAttributedComponentsetAttribute in class XScrollPaneattribName - the attribute nameattribValue - the attribute value
public 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 listenerremoveItemListener( ItemListener ),
ItemEvent,
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 listeneraddItemListener(java.awt.event.ItemListener),
ItemEvent,
ItemListenerpublic java.lang.Object[] getSelectedObjects()
getSelectedObjects in interface java.awt.ItemSelectableItemSelectablepublic void repaint()
repaint in class java.awt.Componentpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerg - the graphics contextpublic void addMouseListener(java.awt.event.MouseListener l)
addMouseListener in class java.awt.Componentl - the new mouse listenerpublic long getComponentHashCode()
getComponentHashCode in interface XHashCodepublic void requestFocus()
requestFocus in class java.awt.Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||