public class GridEditor
extends org.eclipse.swt.custom.ControlEditor
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT. THIS IS A PRE-RELEASE ALPHA VERSION. USERS SHOULD EXPECT API CHANGES IN FUTURE VERSIONS.
A GridEditor is a manager for a Control that appears above a cell in a Grid and tracks with the moving and resizing of that cell. It can be used to display a text widget above a cell in a Grid so that the user can edit the contents of that cell. It can also be used to display a button that can launch a dialog for modifying the contents of the associated cell.TableEditor
Modifier and Type | Field and Description |
---|---|
(package private) int |
column |
(package private) org.eclipse.swt.events.ControlListener |
columnListener |
(package private) GridItem |
item |
(package private) org.eclipse.swt.widgets.Listener |
resizeListener |
(package private) Grid |
table |
Constructor and Description |
---|
GridEditor(Grid table)
Creates a TableEditor for the specified Table.
|
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.swt.graphics.Rectangle |
computeEditorBounds()
Returns the bounds of the editor.
|
void |
dispose()
Removes all associations between the TableEditor and the cell in the
table.
|
int |
getColumn()
Returns the zero based index of the column of the cell being tracked by
this editor.
|
GridItem |
getItem()
Returns the TableItem for the row of the cell being tracked by this
editor.
|
void |
layout() |
void |
setColumn(int column)
Sets the zero based index of the column of the cell being tracked by this
editor.
|
void |
setEditor(org.eclipse.swt.widgets.Control editor,
GridItem item,
int column)
Specify the Control that is to be displayed and the cell in the table
that it is to be positioned above.
|
void |
setItem(GridItem item)
Sets the item that this editor will function over.
|
Grid table
GridItem item
int column
org.eclipse.swt.events.ControlListener columnListener
org.eclipse.swt.widgets.Listener resizeListener
public GridEditor(Grid table)
table
- the Table Control above which this editor will be displayedprotected org.eclipse.swt.graphics.Rectangle computeEditorBounds()
public void dispose()
dispose
in class org.eclipse.swt.custom.ControlEditor
public int getColumn()
public GridItem getItem()
public void setColumn(int column)
column
- the zero based index of the column of the cell being
tracked by this editorpublic void setItem(GridItem item)
item
- editing item.public void setEditor(org.eclipse.swt.widgets.Control editor, GridItem item, int column)
Note: The Control provided as the editor must be created with its parent being the Table control specified in the TableEditor constructor.
editor
- the Control that is displayed above the cell being editeditem
- the TableItem for the row of the cell being tracked by this
editorcolumn
- the zero based index of the column of the cell being
tracked by this editorpublic void layout()
layout
in class org.eclipse.swt.custom.ControlEditor