|
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.TreeCursor
public class TreeCursor
A TreeCursor provides a way for the user to navigate around a Tree with columns using the keyboard. It also provides a mechanism for selecting an individual cell in a tree.
For a detailed example of using a TreeCursor 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/Snippet360.java .
Field Summary |
---|
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
TreeCursor(Tree parent,
int style)
Constructs a new instance of this class given its parent tree 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 receiver's selection changes, 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 TreeCursor is positioned. |
Color |
getForeground()
Returns the foreground color that the receiver will use to draw. |
TreeItem |
getRow()
Returns the row over which the TreeCursor is positioned. |
void |
removeSelectionListener(SelectionListener listener)
Removes the listener from the collection of listeners who will be notified when the receiver's selection changes. |
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 TreeCursor over the root-level cell at the given row and column in the parent tree. |
void |
setSelection(TreeItem row,
int column)
Positions the TreeCursor over the cell at the given row and column in the parent tree. |
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 TreeCursor(Tree 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 Tree 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
IllegalArgumentException
- SWTException
- SelectionListener
,
SelectionEvent
,
removeSelectionListener(SelectionListener)
public Color getBackground()
getBackground
in class Control
public int getColumn()
SWTException
- public Color getForeground()
getForeground
in class Control
public TreeItem getRow()
null
if none
SWTException
- public void removeSelectionListener(SelectionListener listener)
listener
- the listener which should no longer be notified
IllegalArgumentException
- SWTException
- SelectionListener
,
addSelectionListener(SelectionListener)
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 root-level row for the cell to selectcolumn
- the index of column for the cell to select
SWTException
- public void setSelection(TreeItem row, int column)
row
- the TreeItem of the row for the cell to selectcolumn
- the index of column for the cell to select
SWTException
- 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 state
|
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, 2013. All rights reserved.