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
-
public class GridColumnGroup extends org.eclipse.swt.widgets.ItemNOTE: 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 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
-
-
Field Summary
Fields Modifier and Type Field Description private GridColumn[]columnsprivate booleanexpandedprivate org.eclipse.swt.graphics.FontheaderFontprivate GridHeaderRendererheaderRendererHeader renderer.private Gridparent
-
Constructor Summary
Constructors Constructor Description GridColumnGroup(Grid parent, int style)Constructs a new instance of this class given its parent (which must be a Table) and a style value describing its behavior and appearance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTreeListener(org.eclipse.swt.events.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()intgetAlignment()Returns the column group header alignment.(package private) org.eclipse.swt.graphics.RectanglegetBounds()GridColumn[]getColumns()Returns the columns within this group.booleangetExpanded()Returns true if the receiver is expanded, false otherwise.(package private) GridColumngetFirstVisibleColumn()Returns the first visible column in this column group.org.eclipse.swt.graphics.FontgetHeaderFont()Returns the font that the receiver will use to paint textual information for the header.GridHeaderRenderergetHeaderRenderer()booleangetHeaderWordWrap()Returns whether or not text is word-wrapped in the header for this column group.(package private) GridColumngetLastVisibleColumn()Returns the last visible column in this column group.(package private) intgetNewColumnIndex()GridgetParent()private voidinit(int style)(package private) voidnewColumn(GridColumn column, int index)(package private) voidremoveColumn(GridColumn col)voidremoveTreeListener(org.eclipse.swt.events.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(org.eclipse.swt.graphics.Font font)Sets the Font to be used when displaying the Header text.voidsetHeaderRenderer(GridHeaderRenderer headerRenderer)Sets the header renderer.voidsetHeaderWordWrap(boolean wordWrap)Sets whether or not text is word-wrapped in the header for this column group.-
Methods inherited from class org.eclipse.swt.widgets.Item
checkSubclass, getImage, getText, setImage, setText
-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
-
-
-
Field Detail
-
parent
private Grid parent
-
columns
private GridColumn[] columns
-
expanded
private boolean expanded
-
headerFont
private org.eclipse.swt.graphics.Font headerFont
-
headerRenderer
private GridHeaderRenderer headerRenderer
Header renderer.
-
-
Constructor Detail
-
GridColumnGroup
public GridColumnGroup(Grid parent, int style)
Constructs a new instance of this class given its parent (which must be a Table) 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
org.eclipse.swt.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
-
init
private void init(int style)
-
addTreeListener
public void addTreeListener(org.eclipse.swt.events.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
org.eclipse.swt.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(org.eclipse.swt.events.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
org.eclipse.swt.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)
-
getParent
public Grid getParent()
- Returns:
- the parent grid
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getNewColumnIndex
int getNewColumnIndex()
-
newColumn
void newColumn(GridColumn column, int index)
-
removeColumn
void removeColumn(GridColumn col)
-
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:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
dispose
public void dispose()
- Overrides:
disposein classorg.eclipse.swt.widgets.Widget
-
getHeaderRenderer
public GridHeaderRenderer getHeaderRenderer()
- Returns:
- the header renderer.
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setHeaderRenderer
public void setHeaderRenderer(GridHeaderRenderer headerRenderer)
Sets the header renderer.- Parameters:
headerRenderer- The headerRenderer to set.- Throws:
java.lang.IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the renderer is null
org.eclipse.swt.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:
org.eclipse.swt.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:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getFirstVisibleColumn
GridColumn getFirstVisibleColumn()
Returns the first visible column in this column group.- Returns:
- first visible column
-
getLastVisibleColumn
GridColumn getLastVisibleColumn()
Returns the last visible column in this column group.- Returns:
- last visible column
-
getBounds
org.eclipse.swt.graphics.Rectangle getBounds()
-
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)
-
getHeaderFont
public org.eclipse.swt.graphics.Font getHeaderFont()
Returns the font that the receiver will use to paint textual information for the header.- Returns:
- the receiver's font
- Throws:
org.eclipse.swt.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(org.eclipse.swt.graphics.Font font)
Sets the Font to be used when displaying the Header text.- Parameters:
font-
-
getAlignment
public int getAlignment()
Returns the column group header alignment.- Returns:
- SWT.LEFT, SWT.RIGHT, SWT.CENTER
- Throws:
org.eclipse.swt.SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
-