|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.widgets.Widget org.eclipse.swt.widgets.Item org.eclipse.swt.widgets.TreeColumn com.ibm.commons.swt.controls.custom.CustomTreeColumn
public class CustomTreeColumn
An extension of the standard SWT TreeColumn class. Used in conjunction with com.ibm.commons.swt.controls.custom.CustomTree
This class automatically takes care of many of the sizing issues that are normally associated with SWT Trees, such as sizing columns appropriately. This extension allows
columns to define how they are to be sized within the tree. Columns can control the amount of space they take up within the table by defining if they are to take up:
com.ibm.commons.swt.controls.custom.CustomTableColumn}
Field Summary | |
---|---|
static int |
UNIT_COLWIDTH
Type constant used for columns with a predefined width |
static int |
UNIT_PERCENT
Type constant used for columns with a predefined percentage width |
static int |
UNIT_PIXEL
Type constant used for columns with a predefined pixel width |
static int |
UNIT_REMAINDER
Type constant used for columns without a predefined width. |
Constructor Summary | |
---|---|
CustomTreeColumn(CustomTree parent,
int style,
java.lang.String id)
Constructs a new instance of the class given the parent table, a style value describing its behavior and appearance, and id which can be used to later identify this control. |
Method Summary | |
---|---|
protected void |
checkSubclass()
|
int |
getColWidth()
Returns the column's width. |
java.lang.String |
getId()
|
int |
getWidthUnit()
Can be any one of: com.ibm.commons.swt.controls.custom.CustomTreeColumn.UNIT_COLWIDTH com.ibm.commons.swt.controls.custom.CustomTreeColumn.UNIT_PERCENT com.ibm.commons.swt.controls.custom.CustomTreeColumn.UNIT_PIXEL com.ibm.commons.swt.controls.custom.CustomTreeColumn.UNIT_REMAINDER |
boolean |
isEditable()
Determines whether or not the values of the column can be edited. |
boolean |
isResizable()
Determines if the current column is resizable. |
void |
setColWidth(int colWidth)
Sets the width of the current column. |
void |
setEditable(boolean editable)
Sets whether or not the values of the column can be edited |
void |
setId(java.lang.String id)
|
void |
setResizable(boolean resizable)
Sets whether or not the current column can be resized in the context of the entire table. |
void |
setWidth(int width)
Programatically sets the width of the current column. |
void |
setWidthUnit(int widthUnit)
Specifies the units to be used when sizing this column. |
Methods inherited from class org.eclipse.swt.widgets.TreeColumn |
---|
addControlListener, addSelectionListener, getAlignment, getMoveable, getParent, getResizable, getToolTipText, getWidth, pack, removeControlListener, removeSelectionListener, setAlignment, setImage, setMoveable, setText, setToolTipText |
Methods inherited from class org.eclipse.swt.widgets.Item |
---|
getImage, getText |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNIT_COLWIDTH
public static final int UNIT_PIXEL
public static final int UNIT_PERCENT
public static final int UNIT_REMAINDER
Constructor Detail |
---|
public CustomTreeColumn(CustomTree parent, int style, java.lang.String id)
parent
- - a CustomTable control which will be the parent of the new instance (CANNOT be null).style
- - the style of the control to construct.id
- - the programmatic ID of the control once constructed.Method Detail |
---|
protected void checkSubclass()
checkSubclass
in class org.eclipse.swt.widgets.TreeColumn
public void setWidth(int width)
setWidthUnit(int)
PRIOR to calling
this method to ensure the correct units are used when calculating the width of the column.
setWidth
in class org.eclipse.swt.widgets.TreeColumn
public boolean isEditable()
public void setEditable(boolean editable)
editable
- public boolean isResizable()
public void setResizable(boolean resizable)
true
the other columns in the table
will be queried for their width and their width will be calculated accordingly.
setResizable
in class org.eclipse.swt.widgets.TreeColumn
com.ibm.commons.swt.controls.custom.CustomTreeColumn.UNIT_COLWIDTH}
{@link com.ibm.commons.swt.controls.custom.CustomTreeColumn.UNIT_PERCENT}
{@link com.ibm.commons.swt.controls.custom.CustomTreeColumn.UNIT_PIXEL}
{@link com.ibm.commons.swt.controls.custom.CustomTreeColumn.UNIT_REMAINDER}
public int getColWidth()
getWidthUnit()
public void setColWidth(int colWidth)
colWidth
- public int getWidthUnit()
public void setWidthUnit(int widthUnit)
widthUnit
- public java.lang.String getId()
public void setId(java.lang.String id)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |