public abstract class AbstractNativeHeader
extends org.eclipse.swt.widgets.Composite
Modifier and Type | Field and Description |
---|---|
(package private) org.eclipse.swt.widgets.Table |
headerTable |
(package private) java.util.List |
tableColumns |
Constructor and Description |
---|
AbstractNativeHeader(org.eclipse.swt.widgets.Composite parent,
int style)
A Header object for CompositeTable that can tell clients to re-sort,
and can move/resize the columns (if used with an appropriate layout
manager).
|
Modifier and Type | Method and Description |
---|---|
void |
addColumnControlListener(org.eclipse.swt.events.ControlListener c) |
org.eclipse.swt.graphics.Point |
computeSize(int wHint,
int hHint) |
org.eclipse.swt.graphics.Point |
computeSize(int wHint,
int hHint,
boolean changed) |
org.eclipse.swt.widgets.TableColumn[] |
getColumns() |
int |
getSortDirection()
Returns the current sort direction.
|
int[] |
getWeights()
Method getWeights.
|
int |
indexOfSortColumn()
The index of the currently sorted table column
|
boolean |
isFittingHorizontally()
Method isFittingHorizontally.
|
boolean |
isMovable()
Returns if the columns are movable.
|
boolean |
isResizable()
Returns if the columns are resizable.
|
void |
removeColumnControlListener(org.eclipse.swt.events.ControlListener c) |
void |
setColumnText(java.lang.String[] columnTextStrings)
Clients must call this method (or its overloaded cousin) exactly once
in their constructor to set the column text strings.
|
void |
setColumnText(java.lang.String[] columnTextStrings,
int[] alignments)
Clients must call this method (or its overloaded cousin) exactly once
in their constructor to set the column text strings and alignments.
|
AbstractNativeHeader |
setFittingHorizontally(boolean fittingHorizontally)
Method setFittingHorizontally.
|
void |
setMovable(boolean movable)
Sets if the columns are movable.
|
void |
setResizable(boolean resizable)
Sets if the columns are resizable.
|
void |
setSortColumn(int index)
Sets the sort indicator onto the specified column.
|
void |
setSortDirection(int direction)
Set the sort direction.
|
AbstractNativeHeader |
setWeights(int[] weights)
Method setWeights.
|
protected boolean |
sortOnColumn(int column,
int sortDirection)
Clients must override this method to reset the current sort column/order
if they want to support sorting.
|
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, 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, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
org.eclipse.swt.widgets.Table headerTable
java.util.List tableColumns
public AbstractNativeHeader(org.eclipse.swt.widgets.Composite parent, int style)
parent
- The SWT parentstyle
- SWT style bits. The same style bits accepted by Composite.protected boolean sortOnColumn(int column, int sortDirection)
column
- The column on which to sort.sortDirection
- SWT.NONE, SWT.UP, or SWT.DOWN.public void setMovable(boolean movable)
movable
- true if the columns are movable; false otherwise.public boolean isMovable()
public void setResizable(boolean resizable)
resizable
- true if the columns should be resizable; false otherwise.public boolean isResizable()
public void setColumnText(java.lang.String[] columnTextStrings)
columnTextStrings
- String[] The text strings to display in each columnpublic void setColumnText(java.lang.String[] columnTextStrings, int[] alignments)
columnTextStrings
- String[] The text strings to display in each columnalignments
- An array of SWT style bits. Each element is one of:
SWT.LEFT, SWT.CENTER, or SWT.RIGHT.public org.eclipse.swt.widgets.TableColumn[] getColumns()
public void setSortColumn(int index)
index
- the 0-based column index or -1 if no column is sortedsetSortDirection(int)
public int indexOfSortColumn()
public void setSortDirection(int direction)
direct
- one of SWT.UP, SWT.DOWN, SWT.NONEjava.lang.RuntimeException
- if direction has an invalid valuesetSortColumn(int);
public int getSortDirection()
public void addColumnControlListener(org.eclipse.swt.events.ControlListener c)
public void removeColumnControlListener(org.eclipse.swt.events.ControlListener c)
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint)
computeSize
in class org.eclipse.swt.widgets.Control
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)
computeSize
in class org.eclipse.swt.widgets.Control
public int[] getWeights()
If !isFittingHorizontally, returns an array where each element is the minimum width in pixels of the corresponding column.
public AbstractNativeHeader setWeights(int[] weights)
If !isFittingHorizontally, specifies an array where each element is the minimum width in pixels of the corresponding column.
This property is ignored if the programmer has set a layout manager on the header and/or the row prototype objects.
The number of elements in the array must match the number of columns and if isFittingHorizontally, the sum of all elements must equal 100. If either of these constraints is not true, this property will be ignored and all columns will be created equal in width.
weights
- the weights to use if the CompositeTable is automatically
laying out controls.public boolean isFittingHorizontally()
public AbstractNativeHeader setFittingHorizontally(boolean fittingHorizontally)
fittingHorizontally
- true if the table's actual width is set to equal the visible
width; false otherwise.