|
Eclipse Platform Release 4.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.swt.custom.TableCursor
public class TableCursor
A TableCursor provides a way for the user to navigate around a Table using the keyboard. It also provides a mechanism for selecting an individual cell in a table.
For a detailed example of using a TableCursor to navigate to a cell and then edit it see http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96.java .
Field Summary |
---|
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
TableCursor(Table parent,
int style)
Constructs a new instance of this class given its parent table and a style value describing its behavior and appearance. |
Method Summary | |
---|---|
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. |
Color |
getBackground()
Returns the background color that the receiver will use to draw. |
int |
getColumn()
Returns the index of the column over which the TableCursor is positioned. |
Color |
getForeground()
Returns the foreground color that the receiver will use to draw. |
TableItem |
getRow()
Returns the row over which the TableCursor is positioned. |
void |
removeSelectionListener(SelectionListener listener)
Removes the listener from the collection of listeners who will be notified when the user changes the receiver's selection. |
void |
setBackground(Color color)
Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null. |
void |
setForeground(Color color)
Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null. |
void |
setSelection(int row,
int column)
Positions the TableCursor over the cell at the given row and column in the parent table. |
void |
setSelection(TableItem row,
int column)
Positions the TableCursor over the cell at the given row and column in the parent table. |
void |
setVisible(boolean visible)
Marks the receiver as visible if the argument is true ,
and marks it invisible otherwise. |
Methods inherited from class org.eclipse.swt.widgets.Canvas |
---|
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TableCursor(Table 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 Table control which will be the parent of the new instance (cannot be null)style
- the style of control to construct
IllegalArgumentException
- SWTException
- SWT.BORDER
,
Widget.checkSubclass()
,
Widget.getStyle()
Method Detail |
---|
public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
When widgetSelected
is called, the item field of the event object is valid.
If the receiver has SWT.CHECK
style set 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.
listener
- the listener which should be notified when the user changes the receiver's selection
IllegalArgumentException
- SWTException
- SelectionListener
,
SelectionEvent
,
removeSelectionListener(SelectionListener)
public void setVisible(boolean visible)
Control
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.
setVisible
in class Control
visible
- the new visibility statepublic void removeSelectionListener(SelectionListener listener)
listener
- the listener which should no longer be notified
IllegalArgumentException
- SWTException
- SelectionListener
,
addSelectionListener(SelectionListener)
public int getColumn()
SWTException
- public Color getBackground()
getBackground
in class Control
public Color getForeground()
getForeground
in class Control
public TableItem getRow()
null
if none
SWTException
- public void setBackground(Color color)
Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.
setBackground
in class Control
color
- the new color (or null)
IllegalArgumentException
- SWTException
- public void setForeground(Color color)
Note: This operation is a hint and may be overridden by the platform.
setForeground
in class Control
color
- the new color (or null)
IllegalArgumentException
- SWTException
- public void setSelection(int row, int column)
row
- the index of the row for the cell to selectcolumn
- the index of column for the cell to select
SWTException
- public void setSelection(TableItem row, int column)
row
- the TableItem of the row for the cell to selectcolumn
- the index of column for the cell to select
SWTException
-
|
Eclipse Platform Release 4.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2012. All rights reserved.