public class GridColumn extends 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(ControlListener listener)
Adds a listener to the list of listeners notified when the column is
moved or resized.
|
void |
addSelectionListener(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()
Disposes of the operating system resources associated with
the receiver and all its descendents.
|
<T> T |
getAdapter(java.lang.Class<T> adapter)
Implementation of the
Adaptable interface. |
int |
getAlignment()
Returns the column alignment.
|
boolean |
getCheckable()
Returns the checkable state.
|
GridColumnGroup |
getColumnGroup()
Returns the column group if this column was created inside a group, or
null otherwise. |
Font |
getFooterFont()
Returns the font that the receiver will use to paint textual information
for the footer.
|
Image |
getFooterImage()
Returns the receiver's footer image if it has one, or null if it does
not.
|
java.lang.String |
getFooterText()
Returns the receiver's footer text, which will be an empty string if it
has never been set.
|
Font |
getHeaderFont()
Returns the font that the receiver will use to paint textual information
for the header.
|
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.
|
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(ControlListener listener)
Removes the given control listener.
|
void |
removeSelectionListener(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 |
setCheckable(boolean checkable)
Sets the checkable state.
|
void |
setData(java.lang.String key,
java.lang.Object value)
Sets the application defined property of the receiver
with the specified name to the given value.
|
void |
setDetail(boolean detail)
Sets the column as a detail column in a column group.
|
void |
setFooterFont(Font font)
Sets the Font to be used when displaying the Footer text.
|
void |
setFooterImage(Image image)
Sets the receiver's footer image to the argument, which may be null
indicating that no image should be displayed.
|
void |
setFooterText(java.lang.String text)
Sets the receiver's footer text.
|
void |
setHeaderFont(Font font)
Sets the Font to be used when displaying the Header text.
|
void |
setHeaderTooltip(java.lang.String toolTipText)
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 |
setImage(Image image)
Sets the receiver's image to the argument, which may be
null indicating that no image should be displayed.
|
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 |
setText(java.lang.String text)
Sets the receiver's text.
|
void |
setVisible(boolean visible)
Sets the column's visibility.
|
void |
setWidth(int width)
Sets the width of the column.
|
void |
setWordWrap(boolean wordWrap)
If the argument is true, wraps the text in the receiver's cells.
|
addDisposeListener, addListener, checkSubclass, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, 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
- 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
- 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
- SWTException
- public void dispose()
true
when sent the message isDisposed()
.
Any internal connections between the widgets in the tree will
have been removed to facilitate garbage collection.
NOTE: This method is not called recursively on the descendents
of the receiver. This means that, widget implementers can not
detect when a widget is being disposed of by re-implementing
this method, but should instead listen for the Dispose
event.
public Grid getParent()
SWTException
- public GridColumnGroup getColumnGroup()
null
otherwise.SWTException
- public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- public void removeSelectionListener(SelectionListener listener)
listener
- the listener which should no longer be notifiedSWTException
- SelectionListener
,
addSelectionListener(SelectionListener)
public void addControlListener(ControlListener listener)
listener
- listenerjava.lang.IllegalArgumentException
- SWTException
- public void removeControlListener(ControlListener listener)
listener
- listener.java.lang.IllegalArgumentException
- SWTException
- public void setWidth(int width)
width
- new widthSWTException
- public int getWidth()
SWTException
- public void setMinimumWidth(int minimumWidth)
minimumWidth
- the minimum widthpublic int getMinimumWidth()
public void setText(java.lang.String text)
Item
public void setImage(Image image)
Item
public void setSort(int style)
style
- SWT.UP, SWT.DOWN, SWT.NONESWTException
- public int getSort()
SWTException
- public void setMoveable(boolean moveable)
moveable
- true to enable column movingSWTException
- public boolean getMoveable()
SWTException
- public void setResizeable(boolean resizeable)
resizeable
- true to make the column resizeableSWTException
- public boolean getResizeable()
SWTException
- public void setCheckable(boolean checkable)
checkable
- the new checkable state.SWTException
- public boolean getCheckable()
SWTException
- public void setDetail(boolean detail)
detail
- true to show this column when the group is expanded.SWTException
- public boolean isDetail()
SWTException
- public void setSummary(boolean summary)
summary
- true to show this column when the group is collapsed.SWTException
- public boolean isSummary()
SWTException
- public void setVisible(boolean visible)
visible
- the visible to setSWTException
- public boolean getVisible()
setVisible
.SWTException
- public boolean isVisible()
SWTException
- public boolean isCheck()
SWTException
- public boolean isTree()
SWTException
- public void setAlignment(int alignment)
alignment
- SWT.LEFT, SWT.RIGHT, SWT.CENTERSWTException
- public int getAlignment()
SWTException
- public boolean getWordWrap()
SWTException
- public void setWordWrap(boolean wordWrap)
Grid#setItemHeight
to change the
height of each row.wordWrap
- true to make cells wrap their text.SWTException
- public void setHeaderFont(Font font)
font
- the new header font (or null)java.lang.IllegalArgumentException
- SWTException
- public Font getHeaderFont()
SWTException
- public void setHeaderTooltip(java.lang.String toolTipText)
toolTipText
- the tooltip textSWTException
- public java.lang.String getHeaderTooltip()
SWTException
- public void setHeaderWordWrap(boolean wordWrap)
wordWrap
- Set to true to wrap the text, false otherwisegetHeaderWordWrap()
public boolean getHeaderWordWrap()
setHeaderWordWrap(boolean)
public void setFooterText(java.lang.String text)
text
- the new textjava.lang.IllegalArgumentException
- SWTException
- public java.lang.String getFooterText()
SWTException
- public void setFooterImage(Image image)
image
- the image to display on the receiver (may be null)java.lang.IllegalArgumentException
- SWTException
- public Image getFooterImage()
SWTException
- public void setFooterFont(Font font)
font
- the new footer font (or null)java.lang.IllegalArgumentException
- SWTException
- public Font getFooterFont()
SWTException
- public void pack()
SWTException
- public void setData(java.lang.String key, java.lang.Object value)
Widget
Applications may associate arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.
setData
in class Widget
key
- the name of the propertyvalue
- the new value for the propertyWidget.getData(String)
public <T> T getAdapter(java.lang.Class<T> adapter)
Widget
Adaptable
interface.
IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code.
getAdapter
in interface Adaptable
getAdapter
in class Widget
adapter
- the lookup classnull
if
there is no adapter associated with the given class.protected boolean isTableCheck()
protected void setTableCheck(boolean tableCheck)
Copyright (c) EclipseSource and others 2002, 2016.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0