Package org.eclipse.nebula.widgets.grid
Class GridColumnGroup
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Item
-
- org.eclipse.nebula.widgets.grid.GridColumnGroup
-
- All Implemented Interfaces:
Adaptable
public class GridColumnGroup extends Item
Instances of this class represent a column group in a grid widget. A column group header is displayed above grouped columns. The column group can optionally be configured to expand and collapse. A column group in the expanded state showsGridColumns whose detail property is true. A column group in the collapsed state showsGridColumns whose summary property is true.- Styles:
- SWT.TOGGLE
- Events:
- Expand, Collapse
-
-
Constructor Summary
Constructors Constructor Description GridColumnGroup(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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTreeListener(TreeListener listener)Adds the listener to the collection of listeners who will be notified when an item in the receiver is expanded or collapsed by sending it one of the messages defined in theTreeListenerinterface.voiddispose()Disposes of the operating system resources associated with the receiver and all its descendents.<T> TgetAdapter(java.lang.Class<T> adapter)Implementation of theAdaptableinterface.GridColumn[]getColumns()Returns the columns within this group.booleangetExpanded()Returns true if the receiver is expanded, false otherwise.FontgetHeaderFont()Returns the font that the receiver will use to paint textual information for the header.booleangetHeaderWordWrap()Returns whether or not text is word-wrapped in the header for this column group.GridgetParent()Returns the parent grid.voidremoveTreeListener(TreeListener listener)Removes the listener from the collection of listeners who will be notified when items in the receiver are expanded or collapsed.voidsetExpanded(boolean expanded)Sets the expanded state of the receiver.voidsetHeaderFont(Font font)Sets the Font to be used when displaying the Header text.voidsetHeaderWordWrap(boolean wordWrap)Sets whether or not text is word-wrapped in the header for this column group.voidsetImage(Image image)Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.voidsetText(java.lang.String text)Sets the receiver's text.-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkSubclass, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
-
-
-
Constructor Detail
-
GridColumnGroup
public GridColumnGroup(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.- Parameters:
parent- the parent tablestyle- the style of the group- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
-
-
Method Detail
-
dispose
public void dispose()
Description copied from class:WidgetDisposes of the operating system resources associated with the receiver and all its descendents. After this method has been invoked, the receiver and all descendents will answertruewhen sent the messageisDisposed(). 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
Disposeevent.
-
getParent
public Grid getParent()
Returns the parent grid.- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
addTreeListener
public void addTreeListener(TreeListener listener)
Adds the listener to the collection of listeners who will be notified when an item in the receiver is expanded or collapsed by sending it one of the messages defined in theTreeListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
TreeListener,removeTreeListener(org.eclipse.swt.events.TreeListener)
-
removeTreeListener
public void removeTreeListener(TreeListener listener)
Removes the listener from the collection of listeners who will be notified when items in the receiver are expanded or collapsed.- Parameters:
listener- the listener which should no longer be notified- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
TreeListener,addTreeListener(org.eclipse.swt.events.TreeListener)
-
getColumns
public GridColumn[] getColumns()
Returns the columns within this group.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.
- Returns:
- the columns
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setExpanded
public void setExpanded(boolean expanded)
Sets the expanded state of the receiver.- Parameters:
expanded- the expanded to set- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getExpanded
public boolean getExpanded()
Returns true if the receiver is expanded, false otherwise.- Returns:
- the expanded attribute
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getHeaderFont
public Font getHeaderFont()
Returns the font that the receiver will use to paint textual information for the header.- Returns:
- the receiver's font
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setHeaderFont
public void setHeaderFont(Font font)
Sets the Font to be used when displaying the Header text.- Parameters:
font- the new header font (or null)- Throws:
java.lang.IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the argument has been disposed
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setText
public void setText(java.lang.String text)
Description copied from class:ItemSets the receiver's text.
-
setImage
public void setImage(Image image)
Description copied from class:ItemSets the receiver's image to the argument, which may be null indicating that no image should be displayed.
-
setHeaderWordWrap
public void setHeaderWordWrap(boolean wordWrap)
Sets whether or not text is word-wrapped in the header for this column group. If Grid.setAutoHeight(true) is set, the row height is adjusted to accommodate word-wrapped text.- Parameters:
wordWrap- Set to true to wrap the text, false otherwise- See Also:
getHeaderWordWrap()
-
getHeaderWordWrap
public boolean getHeaderWordWrap()
Returns whether or not text is word-wrapped in the header for this column group.- Returns:
- true if the header wraps its text.
- See Also:
GridColumn.setHeaderWordWrap(boolean)
-
getAdapter
public <T> T getAdapter(java.lang.Class<T> adapter)
Description copied from class:WidgetImplementation of theAdaptableinterface.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.
- Specified by:
getAdapterin interfaceAdaptable- Overrides:
getAdapterin classWidget- Parameters:
adapter- the lookup class- Returns:
- an object that can be cast to the given class or
nullif there is no adapter associated with the given class.
-
-