public class Table extends Composite
The item children that may be added to instances of this class
must be of type TableItem
.
Style VIRTUAL
is used to create a Table
whose
TableItem
s are to be populated by the client on an on-demand basis
instead of up-front. This can provide significant performance improvements for
tables that are very large or for which TableItem
population is
expensive (for example, retrieving values from an external source).
Here is an example of using a Table
with style VIRTUAL
:
final Table table = new Table (parent, SWT.VIRTUAL | SWT.BORDER);
table.setItemCount (1000000);
table.addListener (SWT.SetData, new Listener () {
public void handleEvent (Event event) {
TableItem item = (TableItem) event.item;
int index = table.indexOf (item);
item.setText ("Item " + index);
System.out.println (item.getText ());
}
});
Note that although this class is a subclass of Composite
,
it does not normally make sense to add Control
children to
it, or set a layout on it, unless implementing something like a cell
editor.
Note: Only one of the styles SINGLE, and MULTI may be specified.
IMPORTANT: This class is not intended to be subclassed.
Modifier and Type | Field and Description |
---|---|
(package private) int |
columnCount |
(package private) TableColumn[] |
columns |
(package private) static boolean |
COMPRESS_ITEMS |
(package private) TableItem |
currentItem |
(package private) int |
customCount |
(package private) boolean |
customDraw |
(package private) static int |
DRAG_IMAGE_SIZE |
(package private) boolean |
dragStarted |
(package private) static int |
EXPLORER_EXTRA |
(package private) static boolean |
EXPLORER_THEME |
(package private) boolean |
explorerTheme |
(package private) boolean |
firstColumnImage |
(package private) boolean |
fixScrollWidth |
(package private) RECT |
focusRect |
(package private) boolean |
fullRowSelect |
(package private) static int |
GRID_WIDTH |
(package private) static int |
H_SCROLL_LIMIT |
(package private) static int |
HEADER_EXTRA |
(package private) static int |
HEADER_MARGIN |
(package private) ImageList |
headerImageList |
(package private) static int |
HeaderProc |
(package private) int |
headerToolTipHandle |
(package private) int |
hotIndex |
(package private) boolean |
ignoreActivate |
(package private) boolean |
ignoreColumnMove |
(package private) boolean |
ignoreColumnResize |
(package private) boolean |
ignoreCustomDraw |
(package private) boolean |
ignoreDrawBackground |
(package private) boolean |
ignoreDrawFocus |
(package private) boolean |
ignoreDrawForeground |
(package private) boolean |
ignoreDrawHot |
(package private) boolean |
ignoreDrawSelection |
(package private) boolean |
ignoreResize |
(package private) boolean |
ignoreSelect |
(package private) boolean |
ignoreShrink |
(package private) ImageList |
imageList |
(package private) static int |
INSET |
(package private) int |
itemHeight |
(package private) TableItem[] |
items |
(package private) int |
keyCount |
(package private) int[] |
keys |
(package private) int |
lastIndexOf |
(package private) int |
lastWidth |
(package private) boolean |
painted |
(package private) int |
resizeCount |
(package private) int |
selectionForeground |
(package private) static int |
SORT_WIDTH |
(package private) TableColumn |
sortColumn |
(package private) int |
sortDirection |
(package private) static TCHAR |
TableClass |
(package private) static int |
TableProc |
(package private) boolean |
tipRequested |
(package private) static int |
V_SCROLL_LIMIT |
(package private) static int |
VISTA_EXTRA |
(package private) boolean |
wasResized |
(package private) boolean |
wasSelected |
backgroundMode, layout, layoutCount, lpwp, tabList
horizontalBar, verticalBar
accessible, background, backgroundImage, cursor, drawCount, font, foreground, handle, layoutData, menu, parent, region, toolTipText
CANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE
Constructor and Description |
---|
Table(Composite parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
_addListener(int eventType,
Listener listener) |
(package private) boolean |
_checkGrow(int count) |
(package private) void |
_checkShrink() |
(package private) void |
_clearItems() |
(package private) TableItem |
_getItem(int index) |
(package private) TableItem |
_getItem(int index,
boolean create) |
(package private) TableItem |
_getItem(int index,
boolean create,
int count) |
(package private) void |
_getItems(TableItem[] result,
int count) |
(package private) boolean |
_hasItems() |
(package private) void |
_initItems() |
(package private) void |
_insertItem(int index,
TableItem item,
int count) |
(package private) void |
_removeItem(int index,
int count) |
(package private) void |
_removeItems(int start,
int index,
int count) |
(package private) void |
_setItemCount(int count,
int itemCount) |
void |
addSelectionListener(SelectionListener listener)
Adds the listener to the collection of listeners who will
be notified when the user changes the receiver's selection, by sending
it one of the messages defined in the
SelectionListener
interface. |
(package private) int |
callWindowProc(int hwnd,
int msg,
int wParam,
int lParam) |
(package private) int |
callWindowProc(int hwnd,
int msg,
int wParam,
int lParam,
boolean forceSelect) |
(package private) LRESULT |
CDDS_ITEMPOSTPAINT(NMLVCUSTOMDRAW nmcd,
int wParam,
int lParam) |
(package private) LRESULT |
CDDS_ITEMPREPAINT(NMLVCUSTOMDRAW nmcd,
int wParam,
int lParam) |
(package private) LRESULT |
CDDS_POSTPAINT(NMLVCUSTOMDRAW nmcd,
int wParam,
int lParam) |
(package private) LRESULT |
CDDS_PREPAINT(NMLVCUSTOMDRAW nmcd,
int wParam,
int lParam) |
(package private) LRESULT |
CDDS_SUBITEMPOSTPAINT(NMLVCUSTOMDRAW nmcd,
int wParam,
int lParam) |
(package private) LRESULT |
CDDS_SUBITEMPREPAINT(NMLVCUSTOMDRAW nmcd,
int wParam,
int lParam) |
(package private) void |
checkBuffered() |
(package private) boolean |
checkData(TableItem item,
boolean redraw) |
(package private) boolean |
checkData(TableItem item,
int index,
boolean redraw) |
(package private) boolean |
checkHandle(int hwnd) |
(package private) static int |
checkStyle(int style) |
protected void |
checkSubclass()
Checks that this class can be subclassed.
|
void |
clear(int index)
Clears the item at the given zero-relative index in the receiver.
|
void |
clear(int[] indices)
Clears the items at the given zero-relative indices in the receiver.
|
void |
clear(int start,
int end)
Removes the items from the receiver which are between the given
zero-relative start and end indices (inclusive).
|
void |
clearAll()
Clears all the items in the receiver.
|
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Returns the preferred size of the receiver.
|
(package private) void |
createHandle() |
(package private) void |
createHeaderToolTips() |
(package private) void |
createItem(TableColumn column,
int index) |
(package private) void |
createItem(TableItem item,
int index) |
(package private) void |
createWidget() |
(package private) int |
defaultBackground() |
(package private) void |
deregister() |
void |
deselect(int index)
Deselects the item at the given zero-relative index in the receiver.
|
void |
deselect(int[] indices)
Deselects the items at the given zero-relative indices in the receiver.
|
void |
deselect(int start,
int end)
Deselects the items at the given zero-relative indices in the receiver.
|
void |
deselectAll()
Deselects all selected items in the receiver.
|
(package private) void |
destroyItem(TableColumn column) |
(package private) void |
destroyItem(TableItem item) |
(package private) void |
fixCheckboxImageList(boolean fixScroll) |
(package private) void |
fixCheckboxImageListColor(boolean fixScroll) |
(package private) void |
fixItemHeight(boolean fixScroll) |
TableColumn |
getColumn(int index)
Returns the column at the given, zero-relative index in the
receiver.
|
int |
getColumnCount()
Returns the number of columns contained in the receiver.
|
int[] |
getColumnOrder()
Returns an array of zero-relative integers that map
the creation order of the receiver's items to the
order in which they are currently being displayed.
|
TableColumn[] |
getColumns()
Returns an array of
TableColumn s which are the
columns in the receiver. |
(package private) int |
getFocusIndex() |
int |
getGridLineWidth()
Returns the width in pixels of a grid line.
|
int |
getHeaderHeight()
Returns the height of the receiver's header
|
boolean |
getHeaderVisible()
Returns
true if the receiver's header is visible,
and false otherwise. |
TableItem |
getItem(int index)
Returns the item at the given, zero-relative index in the
receiver.
|
TableItem |
getItem(Point point)
Returns the item at the given point in the receiver
or null if no such item exists.
|
int |
getItemCount()
Returns the number of items contained in the receiver.
|
int |
getItemHeight()
Returns the height of the area which would be used to
display one of the items in the receiver.
|
TableItem[] |
getItems()
Returns a (possibly empty) array of
TableItem s which
are the items in the receiver. |
boolean |
getLinesVisible()
Returns
true if the receiver's lines are visible,
and false otherwise. |
TableItem[] |
getSelection()
Returns an array of
TableItem s that are currently
selected in the receiver. |
int |
getSelectionCount()
Returns the number of selected items contained in the receiver.
|
int |
getSelectionIndex()
Returns the zero-relative index of the item which is currently
selected in the receiver, or -1 if no item is selected.
|
int[] |
getSelectionIndices()
Returns the zero-relative indices of the items which are currently
selected in the receiver.
|
TableColumn |
getSortColumn()
Returns the column which shows the sort indicator for
the receiver.
|
(package private) int |
getSortColumnPixel() |
int |
getSortDirection()
Returns the direction of the sort indicator for the receiver.
|
int |
getTopIndex()
Returns the zero-relative index of the item which is currently
at the top of the receiver.
|
(package private) boolean |
hasChildren() |
(package private) boolean |
hitTestSelection(int index,
int x,
int y) |
(package private) int |
imageIndex(Image image,
int column) |
(package private) int |
imageIndexHeader(Image image) |
int |
indexOf(TableColumn column)
Searches the receiver's list starting at the first column
(index 0) until a column is found that is equal to the
argument, and returns the index of that column.
|
int |
indexOf(TableItem item)
Searches the receiver's list starting at the first item
(index 0) until an item is found that is equal to the
argument, and returns the index of that item.
|
(package private) boolean |
isCustomToolTip() |
(package private) boolean |
isOptimizedRedraw() |
boolean |
isSelected(int index)
Returns
true if the item is selected,
and false otherwise. |
(package private) void |
register() |
(package private) void |
releaseChildren(boolean destroy) |
(package private) void |
releaseWidget() |
void |
remove(int index)
Removes the item from the receiver at the given
zero-relative index.
|
void |
remove(int[] indices)
Removes the items from the receiver's list at the given
zero-relative indices.
|
void |
remove(int start,
int end)
Removes the items from the receiver which are
between the given zero-relative start and end
indices (inclusive).
|
void |
removeAll()
Removes all of the items from the receiver.
|
void |
removeSelectionListener(SelectionListener listener)
Removes the listener from the collection of listeners who will
be notified when the user changes the receiver's selection.
|
(package private) void |
reskinChildren(int flags) |
void |
select(int index)
Selects the item at the given zero-relative index in the receiver.
|
void |
select(int[] indices)
Selects the items at the given zero-relative indices in the receiver.
|
void |
select(int start,
int end)
Selects the items in the range specified by the given zero-relative
indices in the receiver.
|
void |
selectAll()
Selects all of the items in the receiver.
|
(package private) void |
sendEraseItemEvent(TableItem item,
NMLVCUSTOMDRAW nmcd,
int lParam,
Event measureEvent) |
(package private) Event |
sendEraseItemEvent(TableItem item,
NMTTCUSTOMDRAW nmcd,
int column,
RECT cellRect) |
(package private) Event |
sendMeasureItemEvent(TableItem item,
int row,
int column,
int hDC) |
(package private) LRESULT |
sendMouseDownEvent(int type,
int button,
int msg,
int wParam,
int lParam) |
(package private) void |
sendPaintItemEvent(TableItem item,
NMLVCUSTOMDRAW nmcd) |
(package private) Event |
sendPaintItemEvent(TableItem item,
NMTTCUSTOMDRAW nmcd,
int column,
RECT itemRect) |
(package private) void |
setBackgroundImage(int hBitmap) |
(package private) void |
setBackgroundPixel(int newPixel) |
(package private) void |
setBackgroundTransparent(boolean transparent) |
(package private) void |
setBounds(int x,
int y,
int width,
int height,
int flags,
boolean defer) |
(package private) void |
setCheckboxImageList(int width,
int height,
boolean fixScroll) |
void |
setColumnOrder(int[] order)
Sets the order that the items in the receiver should
be displayed in to the given argument which is described
in terms of the zero-relative ordering of when the items
were added.
|
(package private) void |
setCustomDraw(boolean customDraw) |
(package private) void |
setDeferResize(boolean defer) |
(package private) void |
setFocusIndex(int index) |
void |
setFont(Font font)
Sets the font that the receiver will use to paint textual information
to the font specified by the argument, or to the default font for that
kind of control if the argument is null.
|
(package private) void |
setForegroundPixel(int pixel) |
void |
setHeaderVisible(boolean show)
Marks the receiver's header as visible if the argument is
true ,
and marks it invisible otherwise. |
void |
setItemCount(int count)
Sets the number of items contained in the receiver.
|
(package private) void |
setItemHeight(boolean fixScroll) |
(package private) void |
setItemHeight(int itemHeight)
Sets the height of the area which would be used to
display one of the items in the table.
|
void |
setLinesVisible(boolean show)
Marks the receiver's lines as visible if the argument is
true ,
and marks it invisible otherwise. |
void |
setRedraw(boolean redraw)
If the argument is
false , causes subsequent drawing
operations in the receiver to be ignored. |
(package private) void |
setScrollWidth(int width) |
(package private) boolean |
setScrollWidth(TableItem item,
boolean force) |
void |
setSelection(int index)
Selects the item at the given zero-relative index in the receiver.
|
void |
setSelection(int[] indices)
Selects the items at the given zero-relative indices in the receiver.
|
void |
setSelection(int start,
int end)
Selects the items in the range specified by the given zero-relative
indices in the receiver.
|
void |
setSelection(TableItem item)
Sets the receiver's selection to the given item.
|
void |
setSelection(TableItem[] items)
Sets the receiver's selection to be the given array of items.
|
void |
setSortColumn(TableColumn column)
Sets the column used by the sort indicator for the receiver.
|
void |
setSortDirection(int direction)
Sets the direction of the sort indicator for the receiver.
|
(package private) void |
setSubImagesVisible(boolean visible) |
(package private) void |
setTableEmpty() |
void |
setTopIndex(int index)
Sets the zero-relative index of the item which is currently
at the top of the receiver.
|
void |
showColumn(TableColumn column)
Shows the column.
|
(package private) void |
showItem(int index) |
void |
showItem(TableItem item)
Shows the item.
|
void |
showSelection()
Shows the selection.
|
(package private) void |
sort() |
(package private) void |
subclass() |
(package private) RECT |
toolTipInset(RECT rect) |
(package private) RECT |
toolTipRect(RECT rect) |
(package private) java.lang.String |
toolTipText(NMTTDISPINFO hdr) |
(package private) void |
unsubclass() |
(package private) void |
update(boolean all) |
(package private) void |
updateHeaderToolTips() |
(package private) void |
updateImages() |
(package private) void |
updateMenuLocation(Event event) |
(package private) void |
updateMoveable() |
(package private) void |
updateOrientation() |
(package private) int |
widgetStyle() |
(package private) TCHAR |
windowClass() |
(package private) int |
windowProc() |
(package private) int |
windowProc(int hwnd,
int msg,
int wParam,
int lParam) |
(package private) LRESULT |
WM_CHAR(int wParam,
int lParam) |
(package private) LRESULT |
WM_CONTEXTMENU(int wParam,
int lParam) |
(package private) LRESULT |
WM_ERASEBKGND(int wParam,
int lParam) |
(package private) LRESULT |
WM_GETOBJECT(int wParam,
int lParam) |
(package private) LRESULT |
WM_HSCROLL(int wParam,
int lParam) |
(package private) LRESULT |
WM_KEYDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_KILLFOCUS(int wParam,
int lParam) |
(package private) LRESULT |
WM_LBUTTONDBLCLK(int wParam,
int lParam) |
(package private) LRESULT |
WM_LBUTTONDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOUSEHOVER(int wParam,
int lParam) |
(package private) LRESULT |
WM_PAINT(int wParam,
int lParam) |
(package private) LRESULT |
WM_RBUTTONDBLCLK(int wParam,
int lParam) |
(package private) LRESULT |
WM_RBUTTONDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETFOCUS(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETFONT(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETREDRAW(int wParam,
int lParam) |
(package private) LRESULT |
WM_SIZE(int wParam,
int lParam) |
(package private) LRESULT |
WM_SYSCOLORCHANGE(int wParam,
int lParam) |
(package private) LRESULT |
WM_VSCROLL(int wParam,
int lParam) |
(package private) LRESULT |
wmMeasureChild(int wParam,
int lParam) |
(package private) LRESULT |
wmNotify(NMHDR hdr,
int wParam,
int lParam) |
(package private) LRESULT |
wmNotifyChild(NMHDR hdr,
int wParam,
int lParam) |
(package private) LRESULT |
wmNotifyHeader(NMHDR hdr,
int wParam,
int lParam) |
(package private) LRESULT |
wmNotifyToolTip(NMHDR hdr,
int wParam,
int lParam) |
(package private) LRESULT |
wmNotifyToolTip(NMTTCUSTOMDRAW nmcd,
int lParam) |
_getChildren, _getTabList, changed, checkComposited, computeTabList, copyArea, drawBackground, findDeferredControl, findMenus, fixChildren, fixTabList, getBackgroundMode, getChildren, getChildrenCount, getLayout, getLayoutDeferred, getTabList, hooksKeys, isLayoutDeferred, layout, layout, layout, layout, layout, markLayout, minimumSize, redrawChildren, releaseParent, removeControl, resizeChildren, resizeChildren, resizeEmbeddedHandle, sendResize, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setResizeChildren, setTabGroupFocus, setTabList, translateMnemonic, translateTraversal, updateBackgroundColor, updateBackgroundImage, updateBackgroundMode, updateFont, updateLayout, updateLayout, updateUIState, WM_GETDLGCODE, WM_GETFONT, WM_NCHITTEST, WM_PARENTNOTIFY, WM_PRINTCLIENT, WM_SYSCOMMAND, WM_UPDATEUISTATE, wmNCPaint
computeTrim, createScrollBar, destroyScrollBar, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, scrolledHandle, widgetExtStyle, WM_MOUSEWHEEL, wmScroll, wmScrollWheel
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, binarySearch, borderHandle, checkBackground, checkBorder, checkGesture, checkMirrored, computeSize, computeTabGroup, computeTabRoot, defaultFont, defaultForeground, destroyWidget, dragDetect, dragDetect, dragDetect, drawBackground, drawBackground, drawBackground, drawImageBackground, drawThemeBackground, enableDrag, enableWidget, fillBackground, fillImageBackground, fillThemeBackground, findBackgroundControl, findBrush, findCursor, findImageControl, findMnemonic, findThemeControl, fixFocus, forceFocus, forceResize, getAccessible, getBackground, getBackgroundImage, getBackgroundPixel, getBorderWidth, getBounds, getClipboardText, getCodePage, getCursor, getDragDetect, getDrawing, getEnabled, getFont, getForeground, getForegroundPixel, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getPath, getRegion, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, hasCursor, hasFocus, internal_dispose_GC, internal_new_GC, isActive, isEnabled, isFocusAncestor, isFocusControl, isReparentable, isShowing, isTabGroup, isTabItem, isVisible, mapEvent, menuShell, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, new_Accessible, new_GC, pack, pack, print, printWidget, redraw, redraw, redraw, releaseHandle, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, sendFocusEvent, sendGestureEvent, sendMove, sendTouchEvent, setBackground, setBackground, setBackgroundImage, setBounds, setBounds, setBounds, setCapture, setCursor, setCursor, setDefaultFont, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRadioFocus, setRadioSelection, setRegion, setSavedFocus, setSize, setSize, setTabItemFocus, setToolTipText, setToolTipText, setTouchEnabled, setVisible, showWidget, sort, toControl, toControl, toDisplay, toDisplay, topHandle, translateAccelerator, translateMnemonic, traverse, traverse, traverse, traverse, traverse, traverseEscape, traverseGroup, traverseItem, traverseMnemonic, traversePage, traverseReturn, update, widgetCreateStruct, widgetParent, WM_ACTIVATE, WM_CAPTURECHANGED, WM_CHANGEUISTATE, WM_CLEAR, WM_CLOSE, WM_COMMAND, WM_CTLCOLOR, WM_CUT, WM_DESTROY, WM_DRAWITEM, WM_ENDSESSION, WM_ENTERIDLE, WM_GESTURE, WM_GETMINMAXINFO, WM_HELP, WM_HOTKEY, WM_IME_CHAR, WM_IME_COMPOSITION_START, WM_IME_COMPOSITION, WM_IME_ENDCOMPOSITION, WM_INITMENUPOPUP, WM_INPUTLANGCHANGE, WM_KEYUP, WM_LBUTTONUP, WM_MBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MEASUREITEM, WM_MENUCHAR, WM_MENUSELECT, WM_MOUSEACTIVATE, WM_MOUSEHWHEEL, WM_MOUSELEAVE, WM_MOUSEMOVE, WM_MOVE, WM_NCACTIVATE, WM_NCCALCSIZE, WM_NCLBUTTONDOWN, WM_NCPAINT, WM_NOTIFY, WM_PALETTECHANGED, WM_PASTE, WM_PRINT, WM_QUERYENDSESSION, WM_QUERYNEWPALETTE, WM_QUERYOPEN, WM_RBUTTONUP, WM_SETCURSOR, WM_SETTINGCHANGE, WM_SHOWWINDOW, WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_TABLET_FLICK, WM_TIMER, WM_TOUCH, WM_UNDO, WM_UNINITMENUPOPUP, WM_WINDOWPOSCHANGED, WM_WINDOWPOSCHANGING, WM_XBUTTONDBLCLK, WM_XBUTTONDOWN, WM_XBUTTONUP, wmColorChild, wmCommandChild, wmDrawChild, wmScrollChild
addDisposeListener, addListener, checkBits, checkOpened, checkOrientation, checkParent, checkWidget, DeferWindowPos, dispose, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getName, getNameText, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, notifyListeners, postEvent, postEvent, release, removeDisposeListener, removeListener, removeListener, reskin, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, SetWindowPos, showMenu, showMenu, toString, wmCaptureChanged, wmChar, wmContextMenu, wmIMEChar, wmKeyDown, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyDown, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUp
TableItem[] items
int[] keys
TableColumn[] columns
int columnCount
int customCount
int keyCount
ImageList imageList
ImageList headerImageList
TableItem currentItem
TableColumn sortColumn
RECT focusRect
int headerToolTipHandle
boolean ignoreCustomDraw
boolean ignoreDrawForeground
boolean ignoreDrawBackground
boolean ignoreDrawFocus
boolean ignoreDrawSelection
boolean ignoreDrawHot
boolean customDraw
boolean dragStarted
boolean explorerTheme
boolean firstColumnImage
boolean fixScrollWidth
boolean tipRequested
boolean wasSelected
boolean wasResized
boolean painted
boolean ignoreActivate
boolean ignoreSelect
boolean ignoreShrink
boolean ignoreResize
boolean ignoreColumnMove
boolean ignoreColumnResize
boolean fullRowSelect
int itemHeight
int lastIndexOf
int lastWidth
int sortDirection
int resizeCount
int selectionForeground
int hotIndex
static int HeaderProc
static final int INSET
static final int GRID_WIDTH
static final int SORT_WIDTH
static final int HEADER_MARGIN
static final int HEADER_EXTRA
static final int VISTA_EXTRA
static final int EXPLORER_EXTRA
static final int H_SCROLL_LIMIT
static final int V_SCROLL_LIMIT
static final int DRAG_IMAGE_SIZE
static final boolean EXPLORER_THEME
static boolean COMPRESS_ITEMS
static final int TableProc
static final TCHAR TableClass
public Table(Composite parent, int style)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
parent
- a composite control which will be the parent of the new instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- SWT.SINGLE
,
SWT.MULTI
,
SWT.CHECK
,
SWT.FULL_SELECTION
,
SWT.HIDE_SELECTION
,
SWT.VIRTUAL
,
SWT.NO_SCROLL
,
Widget.checkSubclass()
,
Widget.getStyle()
void _addListener(int eventType, Listener listener)
_addListener
in class Widget
boolean _checkGrow(int count)
void _checkShrink()
void _clearItems()
TableItem _getItem(int index)
TableItem _getItem(int index, boolean create)
TableItem _getItem(int index, boolean create, int count)
void _getItems(TableItem[] result, int count)
boolean _hasItems()
void _initItems()
void _insertItem(int index, TableItem item, int count)
void _removeItem(int index, int count)
void _removeItems(int start, int index, int count)
void _setItemCount(int count, int itemCount)
public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
When widgetSelected
is called, the item field of the event object is valid.
If the receiver has the SWT.CHECK
style and the check selection changes,
the event object detail field contains the value SWT.CHECK
.
widgetDefaultSelected
is typically called when an item is double-clicked.
The item field of the event object is valid for default selection, but the detail field is not used.
listener
- the listener which should be notified when the user changes the receiver's selectionjava.lang.IllegalArgumentException
- SWTException
- SelectionListener
,
removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,
SelectionEvent
int callWindowProc(int hwnd, int msg, int wParam, int lParam)
callWindowProc
in class Scrollable
int callWindowProc(int hwnd, int msg, int wParam, int lParam, boolean forceSelect)
static int checkStyle(int style)
LRESULT CDDS_ITEMPOSTPAINT(NMLVCUSTOMDRAW nmcd, int wParam, int lParam)
LRESULT CDDS_ITEMPREPAINT(NMLVCUSTOMDRAW nmcd, int wParam, int lParam)
LRESULT CDDS_POSTPAINT(NMLVCUSTOMDRAW nmcd, int wParam, int lParam)
LRESULT CDDS_PREPAINT(NMLVCUSTOMDRAW nmcd, int wParam, int lParam)
LRESULT CDDS_SUBITEMPOSTPAINT(NMLVCUSTOMDRAW nmcd, int wParam, int lParam)
LRESULT CDDS_SUBITEMPREPAINT(NMLVCUSTOMDRAW nmcd, int wParam, int lParam)
void checkBuffered()
checkBuffered
in class Composite
boolean checkData(TableItem item, boolean redraw)
boolean checkData(TableItem item, int index, boolean redraw)
boolean checkHandle(int hwnd)
checkHandle
in class Control
protected void checkSubclass()
Widget
The SWT class library is intended to be subclassed
only at specific, controlled points (most notably,
Composite
and Canvas
when
implementing new widgets). This method enforces this
rule unless it is overridden.
IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
checkSubclass
in class Composite
public void clear(int index)
SWT.VIRTUAL
style,
these attributes are requested again as needed.index
- the index of the item to clearjava.lang.IllegalArgumentException
- SWTException
- SWT.VIRTUAL
,
SWT.SetData
public void clear(int start, int end)
SWT.VIRTUAL
style,
these attributes are requested again as needed.start
- the start index of the item to clearend
- the end index of the item to clearjava.lang.IllegalArgumentException
- SWTException
- SWT.VIRTUAL
,
SWT.SetData
public void clear(int[] indices)
SWT.VIRTUAL
style,
these attributes are requested again as needed.indices
- the array of indices of the itemsjava.lang.IllegalArgumentException
- SWTException
- SWT.VIRTUAL
,
SWT.SetData
public void clearAll()
SWT.VIRTUAL
style, these
attributes are requested again as needed.SWTException
- SWT.VIRTUAL
,
SWT.SetData
public Point computeSize(int wHint, int hHint, boolean changed)
Control
The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT
is passed for the hint.
If the changed flag is true
, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false
, so layout
manager caches can be retained.
computeSize
in class Composite
wHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)changed
- true
if the control's contents have changed, and false
otherwiseLayout
,
Control.getBorderWidth()
,
Control.getBounds()
,
Control.getSize()
,
Control.pack(boolean)
,
"computeTrim, getClientArea for controls that implement them"void createHandle()
createHandle
in class Composite
void createHeaderToolTips()
void createItem(TableColumn column, int index)
void createItem(TableItem item, int index)
void createWidget()
createWidget
in class Scrollable
int defaultBackground()
defaultBackground
in class Control
void deregister()
deregister
in class Control
public void deselect(int[] indices)
indices
- the array of indices for the items to deselectjava.lang.IllegalArgumentException
- SWTException
- public void deselect(int index)
index
- the index of the item to deselectSWTException
- public void deselect(int start, int end)
start
- the start index of the items to deselectend
- the end index of the items to deselectSWTException
- public void deselectAll()
SWTException
- void destroyItem(TableColumn column)
void destroyItem(TableItem item)
void fixCheckboxImageList(boolean fixScroll)
void fixCheckboxImageListColor(boolean fixScroll)
void fixItemHeight(boolean fixScroll)
public TableColumn getColumn(int index)
TableColumn
s were created by the programmer,
this method will throw ERROR_INVALID_RANGE
despite
the fact that a single column of data may be visible in the table.
This occurs when the programmer uses the table like a list, adding
items but never creating a column.index
- the index of the column to returnjava.lang.IllegalArgumentException
- SWTException
- getColumnOrder()
,
setColumnOrder(int[])
,
TableColumn.getMoveable()
,
TableColumn.setMoveable(boolean)
,
SWT.Move
public int getColumnCount()
TableColumn
s were created by the programmer,
this value is zero, despite the fact that visually, one column
of items may be visible. This occurs when the programmer uses
the table like a list, adding items but never creating a column.SWTException
- public int[] getColumnOrder()
Specifically, the indices of the returned array represent the current visual order of the items, and the contents of the array represent the creation order of the items.
Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
SWTException
- setColumnOrder(int[])
,
TableColumn.getMoveable()
,
TableColumn.setMoveable(boolean)
,
SWT.Move
public TableColumn[] getColumns()
TableColumn
s which are the
columns in the receiver. Columns are returned in the order
that they were created. If no TableColumn
s were
created by the programmer, the array is empty, despite the fact
that visually, one column of items may be visible. This occurs
when the programmer uses the table like a list, adding items but
never creating a column.
Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
SWTException
- getColumnOrder()
,
setColumnOrder(int[])
,
TableColumn.getMoveable()
,
TableColumn.setMoveable(boolean)
,
SWT.Move
int getFocusIndex()
public int getGridLineWidth()
SWTException
- public int getHeaderHeight()
SWTException
- public boolean getHeaderVisible()
true
if the receiver's header is visible,
and false
otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.
SWTException
- public TableItem getItem(int index)
index
- the index of the item to returnjava.lang.IllegalArgumentException
- SWTException
- public TableItem getItem(Point point)
The item that is returned represents an item that could be selected by the user. For example, if selection only occurs in items in the first column, then null is returned if the point is outside of the item. Note that the SWT.FULL_SELECTION style hint, which specifies the selection policy, determines the extent of the selection.
point
- the point used to locate the itemjava.lang.IllegalArgumentException
- SWTException
- public int getItemCount()
SWTException
- public int getItemHeight()
SWTException
- public TableItem[] getItems()
TableItem
s which
are the items in the receiver.
Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
SWTException
- public boolean getLinesVisible()
true
if the receiver's lines are visible,
and false
otherwise. Note that some platforms draw
grid lines while others may draw alternating row colors.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.
SWTException
- public TableItem[] getSelection()
TableItem
s that are currently
selected in the receiver. The order of the items is unspecified.
An empty array indicates that no items are selected.
Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
SWTException
- public int getSelectionCount()
SWTException
- public int getSelectionIndex()
SWTException
- public int[] getSelectionIndices()
Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
SWTException
- public TableColumn getSortColumn()
SWTException
- setSortColumn(TableColumn)
int getSortColumnPixel()
public int getSortDirection()
UP
, DOWN
or NONE
.SWTException
- setSortDirection(int)
public int getTopIndex()
SWTException
- boolean hasChildren()
boolean hitTestSelection(int index, int x, int y)
int imageIndex(Image image, int column)
int imageIndexHeader(Image image)
public int indexOf(TableColumn column)
column
- the search columnjava.lang.IllegalArgumentException
- SWTException
- public int indexOf(TableItem item)
item
- the search itemjava.lang.IllegalArgumentException
- SWTException
- boolean isCustomToolTip()
boolean isOptimizedRedraw()
public boolean isSelected(int index)
true
if the item is selected,
and false
otherwise. Indices out of
range are ignored.index
- the index of the itemSWTException
- void releaseChildren(boolean destroy)
releaseChildren
in class Composite
void releaseWidget()
releaseWidget
in class Composite
public void remove(int[] indices)
indices
- the array of indices of the itemsjava.lang.IllegalArgumentException
- SWTException
- public void remove(int index)
index
- the index for the itemjava.lang.IllegalArgumentException
- SWTException
- public void remove(int start, int end)
start
- the start of the rangeend
- the end of the rangejava.lang.IllegalArgumentException
- SWTException
- public void removeAll()
SWTException
- public void removeSelectionListener(SelectionListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- SelectionListener
,
addSelectionListener(SelectionListener)
public void select(int[] indices)
If the item at a given index is not selected, it is selected. If the item at a given index was already selected, it remains selected. Indices that are out of range and duplicate indices are ignored. If the receiver is single-select and multiple indices are specified, then all indices are ignored.
indices
- the array of indices for the items to selectjava.lang.IllegalArgumentException
- SWTException
- setSelection(int[])
void reskinChildren(int flags)
reskinChildren
in class Composite
public void select(int index)
index
- the index of the item to selectSWTException
- public void select(int start, int end)
If an item in the given range is not selected, it is selected. If an item in the given range was already selected, it remains selected. Indices that are out of range are ignored and no items will be selected if start is greater than end. If the receiver is single-select and there is more than one item in the given range, then all indices are ignored.
start
- the start of the rangeend
- the end of the rangeSWTException
- setSelection(int,int)
public void selectAll()
If the receiver is single-select, do nothing.
SWTException
- void sendEraseItemEvent(TableItem item, NMLVCUSTOMDRAW nmcd, int lParam, Event measureEvent)
Event sendEraseItemEvent(TableItem item, NMTTCUSTOMDRAW nmcd, int column, RECT cellRect)
LRESULT sendMouseDownEvent(int type, int button, int msg, int wParam, int lParam)
void sendPaintItemEvent(TableItem item, NMLVCUSTOMDRAW nmcd)
Event sendPaintItemEvent(TableItem item, NMTTCUSTOMDRAW nmcd, int column, RECT itemRect)
void setBackgroundImage(int hBitmap)
setBackgroundImage
in class Control
void setBackgroundPixel(int newPixel)
setBackgroundPixel
in class Control
void setBackgroundTransparent(boolean transparent)
void setBounds(int x, int y, int width, int height, int flags, boolean defer)
public void setColumnOrder(int[] order)
order
- the new order to display the itemsSWTException
- java.lang.IllegalArgumentException
- getColumnOrder()
,
TableColumn.getMoveable()
,
TableColumn.setMoveable(boolean)
,
SWT.Move
void setCustomDraw(boolean customDraw)
void setDeferResize(boolean defer)
void setCheckboxImageList(int width, int height, boolean fixScroll)
void setFocusIndex(int index)
public void setFont(Font font)
Control
void setForegroundPixel(int pixel)
setForegroundPixel
in class Control
public void setHeaderVisible(boolean show)
true
,
and marks it invisible otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
show
- the new visibility stateSWTException
- public void setItemCount(int count)
count
- the number of itemsSWTException
- void setItemHeight(boolean fixScroll)
void setItemHeight(int itemHeight)
itemHeight
- the height of one itemSWTException
- public void setLinesVisible(boolean show)
true
,
and marks it invisible otherwise. Note that some platforms draw grid lines
while others may draw alternating row colors.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
show
- the new visibility stateSWTException
- public void setRedraw(boolean redraw)
Control
false
, causes subsequent drawing
operations in the receiver to be ignored. No drawing of any kind
can occur in the receiver until the flag is set to true.
Graphics operations that occurred while the flag was
false
are lost. When the flag is set to true
,
the entire widget is marked as needing to be redrawn. Nested calls
to this method are stacked.
Note: This operation is a hint and may not be supported on some platforms or for some widgets.
setRedraw
in class Control
redraw
- the new redraw stateControl.redraw(int, int, int, int, boolean)
,
Control.update()
void setScrollWidth(int width)
boolean setScrollWidth(TableItem item, boolean force)
public void setSelection(int[] indices)
Indices that are out of range and duplicate indices are ignored. If the receiver is single-select and multiple indices are specified, then all indices are ignored.
indices
- the indices of the items to selectjava.lang.IllegalArgumentException
- SWTException
- deselectAll()
,
select(int[])
public void setSelection(TableItem item)
If the item is not in the receiver, then it is ignored.
item
- the item to selectjava.lang.IllegalArgumentException
- SWTException
- public void setSelection(TableItem[] items)
Items that are not in the receiver are ignored. If the receiver is single-select and multiple items are specified, then all items are ignored.
items
- the array of itemsjava.lang.IllegalArgumentException
- SWTException
- deselectAll()
,
select(int[])
,
setSelection(int[])
public void setSelection(int index)
index
- the index of the item to selectSWTException
- deselectAll()
,
select(int)
public void setSelection(int start, int end)
Indices that are out of range are ignored and no items will be selected if start is greater than end. If the receiver is single-select and there is more than one item in the given range, then all indices are ignored.
start
- the start index of the items to selectend
- the end index of the items to selectSWTException
- deselectAll()
,
select(int,int)
public void setSortColumn(TableColumn column)
column
- the column used by the sort indicator or null
java.lang.IllegalArgumentException
- SWTException
- public void setSortDirection(int direction)
UP
, DOWN
or NONE
.direction
- the direction of the sort indicatorSWTException
- void setSubImagesVisible(boolean visible)
void setTableEmpty()
public void setTopIndex(int index)
index
- the index of the top itemSWTException
- public void showColumn(TableColumn column)
column
- the column to be shownjava.lang.IllegalArgumentException
- SWTException
- void showItem(int index)
public void showItem(TableItem item)
item
- the item to be shownjava.lang.IllegalArgumentException
- SWTException
- showSelection()
public void showSelection()
SWTException
- showItem(TableItem)
void sort()
java.lang.String toolTipText(NMTTDISPINFO hdr)
toolTipText
in class Composite
void unsubclass()
unsubclass
in class Control
void updateHeaderToolTips()
void updateImages()
updateImages
in class Control
void updateMenuLocation(Event event)
updateMenuLocation
in class Widget
void updateMoveable()
void updateOrientation()
updateOrientation
in class Composite
int widgetStyle()
widgetStyle
in class Composite
TCHAR windowClass()
windowClass
in class Scrollable
int windowProc()
windowProc
in class Scrollable
int windowProc(int hwnd, int msg, int wParam, int lParam)
windowProc
in class Control
LRESULT WM_CONTEXTMENU(int wParam, int lParam)
WM_CONTEXTMENU
in class Control
LRESULT WM_ERASEBKGND(int wParam, int lParam)
WM_ERASEBKGND
in class Composite
LRESULT WM_GETOBJECT(int wParam, int lParam)
WM_GETOBJECT
in class Control
LRESULT WM_KEYDOWN(int wParam, int lParam)
WM_KEYDOWN
in class Control
LRESULT WM_KILLFOCUS(int wParam, int lParam)
WM_KILLFOCUS
in class Control
LRESULT WM_LBUTTONDBLCLK(int wParam, int lParam)
WM_LBUTTONDBLCLK
in class Control
LRESULT WM_LBUTTONDOWN(int wParam, int lParam)
WM_LBUTTONDOWN
in class Composite
LRESULT WM_MOUSEHOVER(int wParam, int lParam)
WM_MOUSEHOVER
in class Control
LRESULT WM_RBUTTONDBLCLK(int wParam, int lParam)
WM_RBUTTONDBLCLK
in class Control
LRESULT WM_RBUTTONDOWN(int wParam, int lParam)
WM_RBUTTONDOWN
in class Control
LRESULT WM_SETFOCUS(int wParam, int lParam)
WM_SETFOCUS
in class Control
LRESULT WM_SETFONT(int wParam, int lParam)
WM_SETFONT
in class Composite
LRESULT WM_SETREDRAW(int wParam, int lParam)
WM_SETREDRAW
in class Control
LRESULT WM_SYSCOLORCHANGE(int wParam, int lParam)
WM_SYSCOLORCHANGE
in class Composite
LRESULT WM_HSCROLL(int wParam, int lParam)
WM_HSCROLL
in class Scrollable
LRESULT WM_VSCROLL(int wParam, int lParam)
WM_VSCROLL
in class Scrollable
LRESULT wmMeasureChild(int wParam, int lParam)
wmMeasureChild
in class Control
LRESULT wmNotifyChild(NMHDR hdr, int wParam, int lParam)
wmNotifyChild
in class Control
LRESULT wmNotifyToolTip(NMTTCUSTOMDRAW nmcd, int lParam)