public class Grid
extends org.eclipse.swt.widgets.Canvas
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.
Instances of this class implement a selectable user interface object that displays a list of images and strings and issue notification when selected.
The item children that may be added to instances of this class must be of
type GridItem
.
Modifier and Type | Class | Description |
---|---|---|
static class |
Grid.GridVisibleRange |
Object holding the visible range
|
Constructor | Description |
---|---|
Grid(DataVisualizer dataVisualizer,
org.eclipse.swt.widgets.Composite parent,
int style) |
Constructs a new instance of this class given its parent and a style
value describing its behavior and appearance.
|
Grid(org.eclipse.swt.widgets.Composite parent,
int style) |
Grid with generic DataVisualizer
|
Modifier and Type | Method | Description |
---|---|---|
void |
addSelectionListener(org.eclipse.swt.events.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. |
void |
addTreeListener(org.eclipse.swt.events.TreeListener listener) |
Adds the listener to the collection of listeners who will be notified
when the receiver's items changes, by sending it one of the messages
defined in the
TreeListener interface. |
void |
clear(int[] indices,
boolean allChildren) |
Clears the items at the given zero-relative indices in the receiver.
|
void |
clear(int index,
boolean allChildren) |
Clears the item at the given zero-relative index in the receiver.
|
void |
clear(int start,
int end,
boolean allChildren) |
Clears the items in the receiver which are between the given
zero-relative start and end indices (inclusive).
|
void |
clearAll(boolean allChildren) |
Clears all the items in the receiver.
|
void |
clearItems() |
Clear simply all GridItems
|
org.eclipse.swt.graphics.Point |
computeSize(int wHint,
int hHint,
boolean changed) |
|
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.
|
void |
deselectAllCells() |
Deselects all selected cells in the receiver.
|
void |
deselectCell(org.eclipse.swt.graphics.Point cell) |
Deselects the given cell in the receiver.
|
void |
deselectCells(org.eclipse.swt.graphics.Point[] cells) |
Deselects the given cells.
|
void |
disableDefaultKeyListener() |
Disable default key listener
|
void |
disposeAllItems() |
All items needs to call the disposeOnly method
|
void |
enableDefaultKeyListener() |
Enable default key listener
|
org.eclipse.swt.graphics.Color |
getBackground() |
|
IRenderer |
getBottomLeftRenderer() |
Gets the bottom left renderer.
|
org.eclipse.swt.graphics.Point |
getCell(org.eclipse.swt.graphics.Point point) |
Returns the cell at the given point in the receiver or null if no such
cell exists.
|
org.eclipse.swt.graphics.Color |
getCellHeaderSelectionBackground() |
Returns the background color of column and row headers when a cell in
the row or header is selected.
|
org.eclipse.swt.graphics.Point[] |
getCellSelection() |
Returns an array of cells that are currently selected in the
receiver.
|
int |
getCellSelectionCount() |
Returns the number of selected cells contained in the receiver.
|
boolean |
getCellSelectionEnabled() |
Returns true if the cells are selectable in the reciever.
|
GridColumn |
getColumn(int index) |
Returns the column at the given, zero-relative index in the receiver.
|
GridColumn |
getColumn(org.eclipse.swt.graphics.Point point) |
Returns the column at the given point in the receiver or null if no such
column exists.
|
int |
getColumnCount() |
Returns the number of columns contained in the receiver.
|
GridColumnGroup |
getColumnGroup(int index) |
Returns the column group at the given, zero-relative index in the receiver.
|
int |
getColumnGroupCount() |
Returns the number of column groups contained in the receiver.
|
GridColumnGroup[] |
getColumnGroups() |
Returns an array of
GridColumnGroup s which are the column groups 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.
|
GridColumn[] |
getColumns() |
Returns an array of
GridColumn s which are the columns in the
receiver. |
boolean |
getColumnScrolling() |
Returns true if the table is set to horizontally scroll column-by-column
rather than pixel-by-pixel.
|
DataVisualizer |
getDataVisualizer() |
|
GridCellRenderer |
getEmptyCellRenderer() |
Returns the empty cell renderer.
|
IRenderer |
getEmptyColumnFooterRenderer() |
Returns the empty column footer renderer.
|
IRenderer |
getEmptyColumnHeaderRenderer() |
Returns the empty column header renderer.
|
IRenderer |
getEmptyRowHeaderRenderer() |
Returns the empty row header renderer.
|
org.eclipse.swt.graphics.Point |
getFocusCell() |
Returns the current cell in focus.
|
GridItem |
getFocusItem() |
Returns the current item in focus.
|
IRenderer |
getFocusRenderer() |
Gets the focus renderer.
|
org.eclipse.swt.graphics.Font |
getFont() |
Cached default font of Control.getFont
|
int |
getFooterHeight() |
Returns the height of the column footers.
|
boolean |
getFooterVisible() |
Returns
true if the receiver's footer is visible, and false otherwise |
int |
getGroupHeaderHeight() |
Returns the height of the column group headers.
|
int |
getHeaderHeight() |
Returns the height of the column headers.
|
boolean |
getHeaderVisible() |
Returns
true if the receiver's header is visible, and
false otherwise. |
int |
getIndexOfItem(GridItem item) |
|
GridItem |
getItem(int index) |
Returns the item at the given, zero-relative index in the receiver.
|
GridItem |
getItem(org.eclipse.swt.graphics.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 |
getItemHeaderWidth() |
Returns the row header width or 0 if row headers are not visible.
|
int |
getItemHeight() |
Returns the default height of the items
in this
Grid . |
GridItem[] |
getItems() |
Returns a (possibly empty) array of
GridItem s which are the
items in the receiver. |
org.eclipse.swt.graphics.Color |
getLineColor() |
Returns the line color.
|
boolean |
getLinesVisible() |
Returns true if the lines are visible.
|
GridColumn |
getNextVisibleColumn(GridColumn column) |
Returns the next visible column in the table.
|
GridItem |
getNextVisibleItem(GridItem item) |
Returns the next visible item in the table.
|
GridColumn |
getPreviousVisibleColumn(GridColumn column) |
Returns the previous visible column in the table.
|
GridItem |
getPreviousVisibleItem(GridItem item) |
Returns the previous visible item in the table.
|
GridItem |
getRootItem(int index) |
TODO: asl;fj
|
int |
getRootItemCount() |
Returns the number of root items contained in the receiver.
|
GridItem[] |
getRootItems() |
Returns a (possibly empty) array of
GridItem s which are
the root items in the receiver. |
IRenderer |
getRowHeaderRenderer() |
Gets the row header renderer.
|
int |
getRowHeaderWidth() |
Returns the width of the row headers.
|
boolean |
getRowsResizeable() |
Returns true if the rows are resizable.
|
GridItem[] |
getSelection() |
Returns a array of
GridItem s that are currently selected in the
receiver. |
int |
getSelectionCount() |
Returns the number of selected items contained in the receiver.
|
boolean |
getSelectionEnabled() |
Returns
true if selection is enabled, false otherwise. |
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.
|
java.lang.String |
getToolTipText() |
Returns the receiver's tool tip text, or null if it has
not been set.
|
int |
getTopIndex() |
Returns the zero-relative index of the item which is currently at the top
of the receiver.
|
IRenderer |
getTopLeftRenderer() |
Gets the top left renderer.
|
boolean |
getTreeLinesVisible() |
Returns true if the tree lines are visible.
|
Grid.GridVisibleRange |
getVisibleRange() |
Query the grid for all currently visible rows and columns
|
int |
indexOf(GridColumn 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(GridItem 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.
|
boolean |
isAutoHeight() |
Returns the value of the auto-height feature, which resizes row heights and column header heights based on word-wrapped content.
|
boolean |
isAutoWidth() |
Returns the value of the auto-height feature, which resizes row header width based on content.
|
boolean |
isCellSelected(org.eclipse.swt.graphics.Point cell) |
Returns true if the given cell is selected.
|
boolean |
isCellSelectionEnabled() |
|
boolean |
isRowHeaderVisible() |
Returns
true if the receiver's row header is visible, and
false otherwise. |
boolean |
isSelected(int index) |
Returns
true if the item is selected, and false
otherwise. |
boolean |
isSelected(GridItem item) |
Returns true if the given item is selected.
|
boolean |
isVisibleLinesColumnPack() |
If
true , column pack is based only with the visible lines (from topIndex
to bottomIndex). |
boolean |
isWordWrapHeader() |
Returns the value of the row header word-wrap feature, which word-wraps the content of row headers.
|
void |
recalculateHeader() |
Recalculate the height of the header
|
void |
refreshData() |
|
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() |
Deprecated.
|
void |
removeSelectionListener(org.eclipse.swt.events.SelectionListener listener) |
Removes the listener from the collection of listeners who will be
notified when the receiver's selection changes.
|
void |
removeTreeListener(org.eclipse.swt.events.TreeListener listener) |
Removes the listener from the collection of listeners who will be
notified when the receiver's items changes.
|
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.
|
void |
selectAllCells() |
Selects all cells in the receiver.
|
void |
selectCell(org.eclipse.swt.graphics.Point cell) |
Selects the given cell.
|
void |
selectCells(org.eclipse.swt.graphics.Point[] cells) |
Selects the given cells.
|
void |
selectColumn(int col) |
Selects all cells in the given column in the receiver.
|
void |
selectColumnGroup(int colGroup) |
Selects all cells in the given column group in the receiver.
|
void |
selectColumnGroup(GridColumnGroup colGroup) |
Selects all cells in the given column group in the receiver.
|
void |
setAutoHeight(boolean enabled) |
Sets the value of the auto-height feature.
|
void |
setAutoWidth(boolean enabled) |
Sets the value of the auto-width feature.
|
void |
setBackground(org.eclipse.swt.graphics.Color color) |
|
void |
setBottomLeftRenderer(IRenderer bottomLeftRenderer) |
Sets the bottom left renderer.
|
void |
setCellHeaderSelectionBackground(org.eclipse.swt.graphics.Color cellSelectionBackground) |
Sets the background color of column and row headers displayed when a cell in
the row or header is selected.
|
void |
setCellSelection(org.eclipse.swt.graphics.Point cell) |
Selects the selection to the given cell.
|
void |
setCellSelection(org.eclipse.swt.graphics.Point[] cells) |
Selects the selection to the given set of cell.
|
void |
setCellSelectionEnabled(boolean cellSelection) |
Sets whether cells are selectable in the receiver.
|
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.
|
void |
setColumnScrolling(boolean columnScrolling) |
Sets the table scrolling method to either scroll column-by-column (true)
or pixel-by-pixel (false).
|
void |
setEmptyCellRenderer(GridCellRenderer emptyCellRenderer) |
Sets the empty cell renderer.
|
void |
setEmptyColumnFooterRenderer(IRenderer emptyColumnFooterRenderer) |
Sets the empty column footer renderer.
|
void |
setEmptyColumnHeaderRenderer(IRenderer emptyColumnHeaderRenderer) |
Sets the empty column header renderer.
|
void |
setEmptyRowHeaderRenderer(IRenderer emptyRowHeaderRenderer) |
Sets the empty row header renderer.
|
void |
setFocusColumn(GridColumn column) |
Sets the focused item to the given column.
|
void |
setFocusItem(GridItem item) |
Sets the focused item to the given item.
|
void |
setFocusRenderer(IRenderer focusRenderer) |
Sets the focus renderer.
|
void |
setFont(org.eclipse.swt.graphics.Font font) |
|
void |
setFooterVisible(boolean show) |
Marks the receiver's footer as visible if the argument is
true ,
and marks it invisible otherwise. |
void |
setForeground(org.eclipse.swt.graphics.Color color) |
|
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.
|
void |
setItemHeaderWidth(int width) |
Sets the row header width to the specified value.
|
void |
setItemHeight(int height) |
Sets the default height for this
Grid 's items. |
void |
setLineColor(org.eclipse.swt.graphics.Color lineColor) |
Sets the line color.
|
void |
setLinesVisible(boolean linesVisible) |
Sets the line visibility.
|
void |
setRowHeaderRenderer(IRenderer rowHeaderRenderer) |
Sets the row header renderer.
|
void |
setRowHeaderVisible(boolean show) |
Marks the receiver's row header as visible if the argument is
true , and marks it invisible otherwise. |
void |
setRowsResizeable(boolean rowsResizeable) |
Sets the rows resizeable state of this
Grid . |
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(GridItem[] _items) |
Sets the receiver's selection to be the given array of items.
|
void |
setSelectionEnabled(boolean selectionEnabled) |
Enables selection highlighting if the argument is
true . |
void |
setToolTipText(java.lang.String string) |
Sets the receiver's tool tip text to the argument, which
may be null indicating that no tool tip text should be shown.
|
void |
setTopIndex(int index) |
Sets the zero-relative index of the item which is currently at the top of
the receiver.
|
void |
setTopLeftRenderer(IRenderer topLeftRenderer) |
Sets the top left renderer.
|
void |
setTreeLinesVisible(boolean treeLinesVisible) |
Sets the tree line visibility.
|
void |
setVisibleLinesColumnPack(boolean visibleLinesBasedColumnPack) |
Set optimizedColumnPack to
true for column pack based only with the
visible lines. |
void |
setWordWrapHeader(boolean enabled) |
Sets the value of the word-wrap feature for row headers.
|
void |
showColumn(GridColumn col) |
Shows the column.
|
void |
showItem(GridItem item) |
Shows the item.
|
void |
showSelection() |
Shows the selection.
|
drawBackground, getCaret, getIME, scroll, setCaret, setIME
changed, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public Grid(org.eclipse.swt.widgets.Composite parent, int style)
public Grid(DataVisualizer dataVisualizer, org.eclipse.swt.widgets.Composite parent, int style)
dataVisualizer
- manage all data of grid and its itemsparent
- a composite control which will be the parent of the new
instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SWT.SINGLE
,
SWT.MULTI
public DataVisualizer getDataVisualizer()
DataVisualizer
public void clearItems()
public org.eclipse.swt.graphics.Color getBackground()
getBackground
in class org.eclipse.swt.widgets.Control
public void setBackground(org.eclipse.swt.graphics.Color color)
setBackground
in class org.eclipse.swt.widgets.Control
public org.eclipse.swt.graphics.Color getCellHeaderSelectionBackground()
org.eclipse.swt.SWTException
- public void setCellHeaderSelectionBackground(org.eclipse.swt.graphics.Color cellSelectionBackground)
cellSelectionBackground
- color to set.org.eclipse.swt.SWTException
- public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
SelectionListener
interface.
Cell selection events may have Event.detail = SWT.DRAG
when the
user is drag selecting multiple cells. A follow up selection event will be generated
when the drag is complete.
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void addTreeListener(org.eclipse.swt.events.TreeListener listener)
TreeListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- TreeListener
,
removeTreeListener(org.eclipse.swt.events.TreeListener)
,
TreeEvent
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)
computeSize
in class org.eclipse.swt.widgets.Control
public void deselect(int index)
If cell selection is enabled, all cells in the specified item are deselected.
index
- the index of the item to deselectorg.eclipse.swt.SWTException
- public void deselect(int start, int end)
If cell selection is enabled, all cells in the given range are deselected.
start
- the start index of the items to deselectend
- the end index of the items to deselectorg.eclipse.swt.SWTException
- public void deselect(int[] indices)
If cell selection is enabled, all cells in the given items are deselected.
indices
- the array of indices for the items to deselectjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void deselectAll()
org.eclipse.swt.SWTException
- public GridColumn getColumn(int index)
GridColumn
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
- org.eclipse.swt.SWTException
- public GridColumn getColumn(org.eclipse.swt.graphics.Point point)
point
- the point used to locate the columnjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public int getColumnCount()
GridColumn
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.org.eclipse.swt.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.
org.eclipse.swt.SWTException
- public int getColumnGroupCount()
org.eclipse.swt.SWTException
- public GridColumnGroup[] getColumnGroups()
GridColumnGroup
s which are the column groups 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.
org.eclipse.swt.SWTException
- public GridColumnGroup getColumnGroup(int index)
index
- the index of the column group to returnjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setColumnOrder(int[] order)
order
- the new order to display the itemsorg.eclipse.swt.SWTException
- java.lang.IllegalArgumentException
- public GridColumn[] getColumns()
GridColumn
s which are the columns in the
receiver. If no GridColumn
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.
org.eclipse.swt.SWTException
- public GridCellRenderer getEmptyCellRenderer()
org.eclipse.swt.SWTException
- public IRenderer getEmptyColumnHeaderRenderer()
org.eclipse.swt.SWTException
- public IRenderer getEmptyColumnFooterRenderer()
org.eclipse.swt.SWTException
- public IRenderer getEmptyRowHeaderRenderer()
org.eclipse.swt.SWTException
- public IRenderer getFocusRenderer()
org.eclipse.swt.SWTException
- public int getHeaderHeight()
org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Font getFont()
getFont
in class org.eclipse.swt.widgets.Control
Control.getFont()
public int getFooterHeight()
org.eclipse.swt.SWTException
- public int getGroupHeaderHeight()
org.eclipse.swt.SWTException
- public boolean getHeaderVisible()
true
if the receiver's header is visible, and
false
otherwise.org.eclipse.swt.SWTException
- public boolean getFooterVisible()
true
if the receiver's footer is visible, and false
otherwiseorg.eclipse.swt.SWTException
- public GridItem getItem(int index)
index
- the index of the item to returnjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public GridItem getItem(org.eclipse.swt.graphics.Point point)
point
- the point used to locate the itemjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public int getItemCount()
org.eclipse.swt.SWTException
- public int getItemHeight()
Grid
. See setItemHeight(int)
for details.
IMPORTANT: The Grid's items need not all have the
height returned by this method, because an
item's height may have been changed by calling
GridItem.setHeight(int)
.
org.eclipse.swt.SWTException
- setItemHeight(int)
public void setItemHeight(int height)
Grid
's items. When
this method is called, all existing items are resized
to the specified height and items created afterwards will be
initially sized to this height.
As long as no default height was set by the client through this method,
the preferred height of the first item in this Grid
is
used as a default for all items (and is returned by getItemHeight()
).
height
- default height in pixelsjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- GridItem.getHeight()
,
GridItem.setHeight(int)
public boolean getRowsResizeable()
org.eclipse.swt.SWTException
- setRowsResizeable(boolean)
public void setRowsResizeable(boolean rowsResizeable)
Grid
.
The default is 'false'.
If a row in a Grid
is resizeable,
then the user can interactively change its height
by dragging the border of the row header.
Note that for rows to be resizable the row headers must be visible.
rowsResizeable
- true if this Grid
's rows should be resizableorg.eclipse.swt.SWTException
- setRowHeaderVisible(boolean)
public GridItem[] getItems()
GridItem
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.
org.eclipse.swt.SWTException
- public int getIndexOfItem(GridItem item)
item
- public org.eclipse.swt.graphics.Color getLineColor()
org.eclipse.swt.SWTException
- public boolean getLinesVisible()
org.eclipse.swt.SWTException
- public boolean getTreeLinesVisible()
org.eclipse.swt.SWTException
- public GridItem getNextVisibleItem(GridItem item)
item
- itemorg.eclipse.swt.SWTException
- public GridItem getPreviousVisibleItem(GridItem item)
item
- item or nullorg.eclipse.swt.SWTException
- public GridColumn getPreviousVisibleColumn(GridColumn column)
column
- columnorg.eclipse.swt.SWTException
- public GridColumn getNextVisibleColumn(GridColumn column)
column
- columnorg.eclipse.swt.SWTException
- public int getRootItemCount()
org.eclipse.swt.SWTException
- public GridItem[] getRootItems()
GridItem
s which are
the root 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.
org.eclipse.swt.SWTException
- public GridItem getRootItem(int index)
index
- public IRenderer getRowHeaderRenderer()
org.eclipse.swt.SWTException
- public GridItem[] getSelection()
GridItem
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.
If cell selection is enabled, any items which contain at least one selected cell are returned.
org.eclipse.swt.SWTException
- public int getSelectionCount()
org.eclipse.swt.SWTException
- public int getCellSelectionCount()
org.eclipse.swt.SWTException
- public int getSelectionIndex()
org.eclipse.swt.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.
If cell selection is enabled, returns the indices of any items which contain at least one selected cell.
org.eclipse.swt.SWTException
- public int getTopIndex()
org.eclipse.swt.SWTException
- public IRenderer getTopLeftRenderer()
org.eclipse.swt.SWTException
- public IRenderer getBottomLeftRenderer()
org.eclipse.swt.SWTException
- public int indexOf(GridColumn column)
column
- the search columnjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public int indexOf(GridItem item)
item
- the search itemjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public boolean isRowHeaderVisible()
true
if the receiver's row header is visible, and
false
otherwise.
org.eclipse.swt.SWTException
- public boolean isSelected(int index)
true
if the item is selected, and false
otherwise. Indices out of range are ignored. If cell selection is
enabled, returns true if the item at the given index contains at
least one selected cell.index
- the index of the itemorg.eclipse.swt.SWTException
- public boolean isSelected(GridItem item)
item
- itemjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public boolean isCellSelected(org.eclipse.swt.graphics.Point cell)
cell
- celljava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void remove(int index)
index
- the index for the itemjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void remove(int start, int end)
start
- the start of the rangeend
- the end of the rangejava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void remove(int[] indices)
indices
- the array of indices of the itemsjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- @Deprecated public void removeAll()
org.eclipse.swt.SWTException
- Grid
disposeAllItems and clearItems.. Is fasterpublic void disposeAllItems()
public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
listener
- the listener which should no longer be notifiedorg.eclipse.swt.SWTException
- SelectionListener
,
addSelectionListener(SelectionListener)
public void removeTreeListener(org.eclipse.swt.events.TreeListener listener)
listener
- the listener which should no longer be notifiedorg.eclipse.swt.SWTException
- TreeListener
,
addTreeListener(TreeListener)
public void select(int index)
If cell selection is enabled, selects all cells at the given index.
index
- the index of the item to selectorg.eclipse.swt.SWTException
- 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.
If cell selection is enabled, all cells within the given range are selected.
start
- the start of the rangeend
- the end of the rangeorg.eclipse.swt.SWTException
- setSelection(int,int)
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.
If cell selection is enabled, all cells within the given indices are selected.
indices
- the array of indices for the items to selectjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- setSelection(int[])
public void selectAll()
If the receiver is single-select, do nothing. If cell selection is enabled, all cells are selected.
org.eclipse.swt.SWTException
- public void setEmptyCellRenderer(GridCellRenderer emptyCellRenderer)
emptyCellRenderer
- The emptyCellRenderer to set.org.eclipse.swt.SWTException
- public void setEmptyColumnHeaderRenderer(IRenderer emptyColumnHeaderRenderer)
emptyColumnHeaderRenderer
- The emptyColumnHeaderRenderer to set.org.eclipse.swt.SWTException
- public void setEmptyColumnFooterRenderer(IRenderer emptyColumnFooterRenderer)
emptyColumnFooterRenderer
- The emptyColumnFooterRenderer to set.org.eclipse.swt.SWTException
- public void setEmptyRowHeaderRenderer(IRenderer emptyRowHeaderRenderer)
emptyRowHeaderRenderer
- The emptyRowHeaderRenderer to set.org.eclipse.swt.SWTException
- public void setFocusRenderer(IRenderer focusRenderer)
focusRenderer
- The focusRenderer to set.org.eclipse.swt.SWTException
- public void setHeaderVisible(boolean show)
true
,
and marks it invisible otherwise.show
- the new visibility stateorg.eclipse.swt.SWTException
- public void setFooterVisible(boolean show)
true
,
and marks it invisible otherwise.show
- the new visibility stateorg.eclipse.swt.SWTException
- public void setLineColor(org.eclipse.swt.graphics.Color lineColor)
lineColor
- The lineColor to set.org.eclipse.swt.SWTException
- public void setLinesVisible(boolean linesVisible)
linesVisible
- Te linesVisible to set.org.eclipse.swt.SWTException
- public void setTreeLinesVisible(boolean treeLinesVisible)
treeLinesVisible
- org.eclipse.swt.SWTException
- public void setRowHeaderRenderer(IRenderer rowHeaderRenderer)
rowHeaderRenderer
- The rowHeaderRenderer to set.org.eclipse.swt.SWTException
- public void setRowHeaderVisible(boolean show)
true
, and marks it invisible otherwise. When row headers are
visible, horizontal scrolling is always done by column rather than by
pixel.show
- the new visibility stateorg.eclipse.swt.SWTException
- public void setSelection(int index)
If cell selection is enabled, all cells within the item at the given index are selected.
index
- the index of the item to selectorg.eclipse.swt.SWTException
- 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.
If cell selection is enabled, all cells within the given range are selected.
start
- the start index of the items to selectend
- the end index of the items to selectorg.eclipse.swt.SWTException
- deselectAll()
,
select(int,int)
public boolean isVisibleLinesColumnPack()
true
, column pack is based only with the visible lines (from topIndex
to bottomIndex).
false
pack is in default mode.public void setVisibleLinesColumnPack(boolean visibleLinesBasedColumnPack)
true
for column pack based only with the
visible lines.visibleLinesBasedColumnPack
- 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.
If cell selection is enabled, all cells within the given indices are selected.
indices
- the indices of the items to selectjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- deselectAll()
,
select(int[])
public void setSelection(GridItem[] _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. If cell selection is enabled, all cells within the given items are selected.
_items
- the array of itemsjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- deselectAll()
,
select(int[])
,
setSelection(int[])
public void setTopIndex(int index)
index
- the index of the top itemorg.eclipse.swt.SWTException
- public void setTopLeftRenderer(IRenderer topLeftRenderer)
topLeftRenderer
- The topLeftRenderer to set.org.eclipse.swt.SWTException
- public void setBottomLeftRenderer(IRenderer bottomLeftRenderer)
bottomLeftRenderer
- The topLeftRenderer to set.org.eclipse.swt.SWTException
- public void showColumn(GridColumn col)
col
- the column to be shownorg.eclipse.swt.SWTException
- public void showItem(GridItem item)
item
- the item to be shownorg.eclipse.swt.SWTException
- public void showSelection()
org.eclipse.swt.SWTException
- public void setSelectionEnabled(boolean selectionEnabled)
true
.selectionEnabled
- the selection enabled stateorg.eclipse.swt.SWTException
- public boolean getSelectionEnabled()
true
if selection is enabled, false otherwise.org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Point getCell(org.eclipse.swt.graphics.Point point)
point
- the point used to locate the itemjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void disableDefaultKeyListener()
public void enableDefaultKeyListener()
public GridItem getFocusItem()
null
.org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Point getFocusCell()
null
. x represents the column and y the row the cell is inorg.eclipse.swt.SWTException
- public void setFocusItem(GridItem item)
item
- item to focus.java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setFocusColumn(GridColumn column)
column
- column to focus.java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public boolean getColumnScrolling()
org.eclipse.swt.SWTException
- public void setColumnScrolling(boolean columnScrolling)
columnScrolling
- true to horizontally scroll by column, false to
scroll by pixelorg.eclipse.swt.SWTException
- public boolean getCellSelectionEnabled()
org.eclipse.swt.SWTException
- public void setCellSelectionEnabled(boolean cellSelection)
cellSelection
- the cellSelection to setorg.eclipse.swt.SWTException
- public boolean isCellSelectionEnabled()
true
if cell selection is enabledpublic void deselectCell(org.eclipse.swt.graphics.Point cell)
cell
- cell to deselect.java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void deselectCells(org.eclipse.swt.graphics.Point[] cells)
cells
- the cells to deselect.java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void deselectAllCells()
org.eclipse.swt.SWTException
- public void selectCell(org.eclipse.swt.graphics.Point cell)
cell
- point whose x values is a column index and y value is an item indexjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void selectCells(org.eclipse.swt.graphics.Point[] cells)
cells
- an arry of points whose x value is a column index and y value is an item indexjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void selectAllCells()
org.eclipse.swt.SWTException
- public void selectColumn(int col)
col
- org.eclipse.swt.SWTException
- public void selectColumnGroup(int colGroup)
colGroup
- the column grouporg.eclipse.swt.SWTException
- public void selectColumnGroup(GridColumnGroup colGroup)
colGroup
- the column grouporg.eclipse.swt.SWTException
- public void setCellSelection(org.eclipse.swt.graphics.Point cell)
cell
- point whose x values is a column index and y value is an item indexjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setCellSelection(org.eclipse.swt.graphics.Point[] cells)
cells
- point array whose x values is a column index and y value is an item indexjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Point[] getCellSelection()
Note: This is not the actual structure used by the receiver to maintain its selection, so modifying the array will not affect the receiver.
org.eclipse.swt.SWTException
- public void setFont(org.eclipse.swt.graphics.Font font)
setFont
in class org.eclipse.swt.widgets.Canvas
public int getItemHeaderWidth()
org.eclipse.swt.SWTException
- public void setItemHeaderWidth(int width)
width
- the width of the row headergetItemHeaderWidth()
,
setAutoWidth(boolean)
public void setItemCount(int count)
count
- the number of itemsorg.eclipse.swt.SWTException
- public java.lang.String getToolTipText()
getToolTipText
in class org.eclipse.swt.widgets.Control
org.eclipse.swt.SWTException
- public void setToolTipText(java.lang.String string)
setToolTipText
in class org.eclipse.swt.widgets.Control
string
- the new tool tip text (or null)org.eclipse.swt.SWTException
- public void clear(int index, boolean allChildren)
SWT.VIRTUAL
style,
these attributes are requested again as needed.index
- the index of the item to clearallChildren
- true
if all child items of the indexed item should be
cleared recursively, and false
otherwisejava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SWT.VIRTUAL
,
SWT.SetData
public void clear(int start, int end, boolean allChildren)
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 clearallChildren
- true
if all child items of the range of items should be
cleared recursively, and false
otherwisejava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SWT.VIRTUAL
,
SWT.SetData
public void clear(int[] indices, boolean allChildren)
SWT.VIRTUAL
style,
these attributes are requested again as needed.indices
- the array of indices of the itemsallChildren
- true
if all child items of the indexed items should be
cleared recursively, and false
otherwisejava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SWT.VIRTUAL
,
SWT.SetData
public void clearAll(boolean allChildren)
SWT.VIRTUAL
style, these
attributes are requested again as needed.allChildren
- true
if all child items of each item should be
cleared recursively, and false
otherwiseorg.eclipse.swt.SWTException
- SWT.VIRTUAL
,
SWT.SetData
public void recalculateHeader()
public Grid.GridVisibleRange getVisibleRange()
This support is provisional and may change
public int getRowHeaderWidth()
org.eclipse.swt.SWTException
- public void setAutoHeight(boolean enabled)
enabled
- Set to true to enable this feature, false (default) otherwise.public boolean isAutoHeight()
setAutoHeight(boolean)
public void setAutoWidth(boolean enabled)
enabled
- Set to true to enable this feature, false (default) otherwise.isAutoWidth()
public boolean isAutoWidth()
setAutoWidth(boolean)
public void setWordWrapHeader(boolean enabled)
enabled
- Set to true to enable this feature, false (default) otherwise.isWordWrapHeader()
public void setForeground(org.eclipse.swt.graphics.Color color)
setForeground
in class org.eclipse.swt.widgets.Control
Control.setForeground(org.eclipse.swt.graphics.Color)
public boolean isWordWrapHeader()
setWordWrapHeader(boolean)
public void refreshData()