public class GridColumn
extends org.eclipse.swt.widgets.Item
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 represent a column in a grid widget.
Constructor and Description |
---|
GridColumn(GridColumnGroup parent,
int style)
Constructs a new instance of this class given its parent column group
(which must be a
GridColumnGroup ), a style value describing
its behavior and appearance, and the index at which to place it in the
items maintained by its parent. |
GridColumn(Grid parent,
int style)
Constructs a new instance of this class given its parent (which must be a
Grid ) and a style value describing its behavior and
appearance. |
GridColumn(Grid parent,
int style,
int index)
Constructs a new instance of this class given its parent (which must be a
Grid ), a style value describing its behavior and appearance,
and the index at which to place it in the items maintained by its parent. |
Modifier and Type | Method and Description |
---|---|
void |
addControlListener(org.eclipse.swt.events.ControlListener listener)
Adds a listener to the list of listeners notified when the column is
moved or resized.
|
void |
addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Adds the listener to the collection of listeners who will be notified
when the receiver's is pushed, by sending it one of the messages defined
in the
SelectionListener interface. |
void |
dispose() |
(package private) void |
fireListeners()
Fires selection listeners.
|
(package private) void |
fireMoved()
Fires moved event.
|
(package private) void |
fireResized()
Fires resized event.
|
int |
getAlignment()
Returns the column alignment.
|
(package private) org.eclipse.swt.graphics.Rectangle |
getBounds()
Returns the bounds of this column's header.
|
GridCellRenderer |
getCellRenderer()
Returns the cell renderer.
|
boolean |
getCellSelectionEnabled()
Returns true if cells in the receiver can be selected.
|
boolean |
getCheckable()
Returns the checkable state.
|
GridColumnGroup |
getColumnGroup()
Returns the column group if this column was created inside a group, or
null otherwise. |
org.eclipse.swt.graphics.Font |
getFooterFont()
Returns the font that the receiver will use to paint textual information
for the footer.
|
(package private) int |
getFooterHeight(org.eclipse.swt.graphics.GC gc) |
org.eclipse.swt.graphics.Image |
getFooterImage()
Returns the receiver's footer image if it has one, or null if it does
not.
|
(package private) GridFooterRenderer |
getFooterRenderer() |
java.lang.String |
getFooterText()
Returns the receiver's footer text, which will be an empty string if it
has never been set.
|
org.eclipse.swt.widgets.Control |
getHeaderControl() |
org.eclipse.swt.graphics.Font |
getHeaderFont()
Returns the font that the receiver will use to paint textual information
for the header.
|
(package private) int |
getHeaderHeight(org.eclipse.swt.graphics.GC gc) |
GridHeaderRenderer |
getHeaderRenderer()
Returns the header renderer.
|
java.lang.String |
getHeaderTooltip()
Returns the tooltip of the column header.
|
boolean |
getHeaderWordWrap()
Returns whether or not text is word-wrapped in the header for this
column.
|
int |
getMinimumWidth() |
boolean |
getMoveable()
Returns true if this column is moveable.
|
Grid |
getParent()
Returns the parent grid.
|
boolean |
getResizeable()
Returns true if the column is resizeable.
|
int |
getSort()
Returns the sort indicator value.
|
int |
getVerticalAlignment()
Returns the vertical alignment.
|
boolean |
getVisible()
Returns the visibility state as set with
setVisible . |
int |
getWidth()
Returns the width of the column.
|
boolean |
getWordWrap()
Returns the true if the cells in receiver wrap their text.
|
boolean |
isCheck()
Returns true if the column includes a check box.
|
boolean |
isDetail()
Returns true if this column is set as a detail column in a column group.
|
boolean |
isSummary()
Returns true if this column is set as a summary column in a column group.
|
protected boolean |
isTableCheck() |
boolean |
isTree()
Returns true if this column includes a tree toggle.
|
boolean |
isVisible()
Returns true if the column is visible, false otherwise.
|
void |
pack()
Causes the receiver to be resized to its preferred size.
|
void |
removeControlListener(org.eclipse.swt.events.ControlListener listener)
Removes the given control listener.
|
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 |
setAlignment(int alignment)
Sets the column alignment.
|
void |
setCellRenderer(GridCellRenderer cellRenderer)
Sets the cell renderer.
|
void |
setCellSelectionEnabled(boolean cellSelectionEnabled)
Sets whether cells in the receiver can be selected.
|
void |
setCheckable(boolean checkable)
Sets the checkable state.
|
(package private) void |
setColumnIndex(int newIndex) |
void |
setDetail(boolean detail)
Sets the column as a detail column in a column group.
|
void |
setFooterFont(org.eclipse.swt.graphics.Font font)
Sets the Font to be used when displaying the Footer text.
|
void |
setFooterImage(org.eclipse.swt.graphics.Image image)
Sets the receiver's footer image to the argument, which may be null
indicating that no image should be displayed.
|
void |
setFooterRenderer(GridFooterRenderer footerRenderer)
Sets the header renderer.
|
void |
setFooterText(java.lang.String string)
Sets the receiver's footer text.
|
void |
setHeaderControl(org.eclipse.swt.widgets.Control control)
Set a new editor at the top of the control.
|
void |
setHeaderFont(org.eclipse.swt.graphics.Font font)
Sets the Font to be used when displaying the Header text.
|
void |
setHeaderRenderer(GridHeaderRenderer headerRenderer)
Sets the header renderer.
|
void |
setHeaderTooltip(java.lang.String tooltip)
Sets the tooltip text of the column header.
|
void |
setHeaderWordWrap(boolean wordWrap)
Sets whether or not text is word-wrapped in the header for this column.
|
void |
setMinimumWidth(int minimumWidth)
Set the minimum width of the column
|
void |
setMoveable(boolean moveable)
Sets the column moveable or fixed.
|
void |
setResizeable(boolean resizeable)
Sets the column resizeable.
|
void |
setSort(int style)
Sets the sort indicator style for the column.
|
void |
setSummary(boolean summary)
Sets the column as a summary column in a column group.
|
protected void |
setTableCheck(boolean tableCheck) |
void |
setTree(boolean tree)
Adds or removes the columns tree toggle.
|
void |
setVerticalAlignment(int alignment)
Sets the column's vertical text alignment.
|
void |
setVisible(boolean visible)
Sets the column's visibility.
|
void |
setWidth(int width)
Sets the width of the column.
|
(package private) void |
setWidth(int width,
boolean redraw) |
void |
setWordWrap(boolean wordWrap)
If the argument is true, wraps the text in the receiver's cells.
|
checkSubclass, getImage, getText, setImage, setText
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public GridColumn(Grid parent, int style)
Grid
) and a style value describing its behavior and
appearance. The item is added to the end of the items maintained by its
parent.parent
- an Grid 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
- public GridColumn(Grid parent, int style, int index)
Grid
), a style value describing its behavior and appearance,
and the index at which to place it in the items maintained by its parent.parent
- an Grid control which will be the parent of the new instance
(cannot be null)style
- the style of control to constructindex
- the index to store the receiver in its parentjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public GridColumn(GridColumnGroup parent, int style)
GridColumnGroup
), a style value describing
its behavior and appearance, and the index at which to place it in the
items maintained by its parent.parent
- an Grid 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
- int getFooterHeight(org.eclipse.swt.graphics.GC gc)
int getHeaderHeight(org.eclipse.swt.graphics.GC gc)
public void dispose()
dispose
in class org.eclipse.swt.widgets.Widget
public GridHeaderRenderer getHeaderRenderer()
GridFooterRenderer getFooterRenderer()
public GridCellRenderer getCellRenderer()
public int getWidth()
org.eclipse.swt.SWTException
- public void setWidth(int width)
width
- new widthorg.eclipse.swt.SWTException
- void setWidth(int width, boolean redraw)
public void setSort(int style)
style
- SWT.UP, SWT.DOWN, SWT.NONEorg.eclipse.swt.SWTException
- public int getSort()
org.eclipse.swt.SWTException
- public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
SelectionListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
listener
- the listener which should no longer be notifiedorg.eclipse.swt.SWTException
- SelectionListener
,
addSelectionListener(SelectionListener)
void fireListeners()
public boolean isVisible()
org.eclipse.swt.SWTException
- public boolean getVisible()
setVisible
.org.eclipse.swt.SWTException
- public void setVisible(boolean visible)
visible
- the visible to setorg.eclipse.swt.SWTException
- public void pack()
org.eclipse.swt.SWTException
- public boolean isTree()
org.eclipse.swt.SWTException
- public boolean isCheck()
org.eclipse.swt.SWTException
- public void setCellRenderer(GridCellRenderer cellRenderer)
cellRenderer
- The cellRenderer to set.org.eclipse.swt.SWTException
- public void setHeaderRenderer(GridHeaderRenderer headerRenderer)
headerRenderer
- The headerRenderer to set.org.eclipse.swt.SWTException
- public void setFooterRenderer(GridFooterRenderer footerRenderer)
footerRenderer
- The footerRenderer to set.org.eclipse.swt.SWTException
- public void addControlListener(org.eclipse.swt.events.ControlListener listener)
listener
- listenerjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void removeControlListener(org.eclipse.swt.events.ControlListener listener)
listener
- listener.java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- void fireMoved()
void fireResized()
public void setTree(boolean tree)
tree
- true to add toggle.org.eclipse.swt.SWTException
- public int getAlignment()
org.eclipse.swt.SWTException
- public void setAlignment(int alignment)
alignment
- SWT.LEFT, SWT.RIGHT, SWT.CENTERorg.eclipse.swt.SWTException
- public int getVerticalAlignment()
org.eclipse.swt.SWTException
- public void setVerticalAlignment(int alignment)
alignment
- SWT.TOP (default), SWT.CENTER, SWT.BOTTOMorg.eclipse.swt.SWTException
- public boolean getMoveable()
org.eclipse.swt.SWTException
- public void setMoveable(boolean moveable)
moveable
- true to enable column movingorg.eclipse.swt.SWTException
- public boolean getResizeable()
org.eclipse.swt.SWTException
- public void setResizeable(boolean resizeable)
resizeable
- true to make the column resizeableorg.eclipse.swt.SWTException
- public GridColumnGroup getColumnGroup()
null
otherwise.org.eclipse.swt.SWTException
- public boolean isDetail()
org.eclipse.swt.SWTException
- public void setDetail(boolean detail)
detail
- true to show this column when the group is expanded.org.eclipse.swt.SWTException
- public boolean isSummary()
org.eclipse.swt.SWTException
- public void setSummary(boolean summary)
summary
- true to show this column when the group is collapsed.org.eclipse.swt.SWTException
- org.eclipse.swt.graphics.Rectangle getBounds()
protected boolean isTableCheck()
protected void setTableCheck(boolean tableCheck)
tableCheck
- the tableCheck to setpublic boolean getCellSelectionEnabled()
org.eclipse.swt.SWTException
- public void setCellSelectionEnabled(boolean cellSelectionEnabled)
cellSelectionEnabled
- the cellSelectionEnabled to setorg.eclipse.swt.SWTException
- public Grid getParent()
org.eclipse.swt.SWTException
- public boolean getCheckable()
org.eclipse.swt.SWTException
- public void setCheckable(boolean checkable)
checkable
- the new checkable state.org.eclipse.swt.SWTException
- void setColumnIndex(int newIndex)
public boolean getWordWrap()
org.eclipse.swt.SWTException
- public void setWordWrap(boolean wordWrap)
Grid#setItemHeight
to change the
height of each row.wordWrap
- true to make cells wrap their text.org.eclipse.swt.SWTException
- public void setHeaderWordWrap(boolean wordWrap)
wordWrap
- Set to true to wrap the text, false otherwisegetHeaderWordWrap()
public boolean getHeaderWordWrap()
setHeaderWordWrap(boolean)
public void setHeaderControl(org.eclipse.swt.widgets.Control control)
control
- the control to be displayed in the headerpublic org.eclipse.swt.widgets.Control getHeaderControl()
public java.lang.String getHeaderTooltip()
public void setHeaderTooltip(java.lang.String tooltip)
tooltip
- the tooltip textpublic void setFooterImage(org.eclipse.swt.graphics.Image image)
image
- the image to display on the receiver (may be null)java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setFooterText(java.lang.String string)
string
- the new textjava.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Image getFooterImage()
org.eclipse.swt.SWTException
- public java.lang.String getFooterText()
org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Font getHeaderFont()
org.eclipse.swt.SWTException
- public void setHeaderFont(org.eclipse.swt.graphics.Font font)
font
- public org.eclipse.swt.graphics.Font getFooterFont()
org.eclipse.swt.SWTException
- public void setFooterFont(org.eclipse.swt.graphics.Font font)
font
- public int getMinimumWidth()
public void setMinimumWidth(int minimumWidth)
minimumWidth
- the minimum width