|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.mdl.table.TableLayoutManager
TableLayoutManager implements a more sophisticated Layout for Table columns than just column widths.
For each column the follwing can be defined:
A default width for columns without absolut width or percentage definition may be defined.
Default minimum and maximun width for columns without individal limits may be defined, too.
One column may be specified to strech over the rest of the table width. Its absolute width
or percentage is ignored. Only its limits are respected.
| Field Summary | |
static int |
ABSOLUT
Use the currend width of the table as it's absolut width. |
static int |
MAX
Use the currend width of the table as it's maximum width. |
static int |
MIN
Use the currend width of the table as it's minimum width. |
static int |
NONE
Use no information from the table. |
static int |
PERCENT
Calculate the percentage of the column based on its current width and the current width of the table. |
| Constructor Summary | |
TableLayoutManager()
|
|
| Method Summary | |
void |
addColumn(int column)
Adds a column to the TableLayoutManager. |
void |
columnResized(org.eclipse.swt.widgets.TableColumn column)
Listener method called by SWT every time a column is resized via the GUI. |
void |
controlMoved(org.eclipse.swt.events.ControlEvent e)
Listener method called by SWT every time the table is moved. |
void |
controlResized(org.eclipse.swt.events.ControlEvent e)
Listener method called by SWT every time the table or a column is resized. |
int |
getAbsolutWidth(int column)
Get the absolute width of the given column in pixel. |
int |
getDefaultAbsolutWidth()
Get the default absolute width. |
int |
getDefaultMaxWidth()
Get the default maximum width. |
int |
getDefaultMinWidth()
Get the default minimum width. |
int |
getMaxWidth(int column)
Get the maximum width of the given column in pixel. |
int |
getMinLimit()
Return the lower limit for all column widths. |
int |
getMinWidth(int column)
Get the minimum width of the given column in pixel. |
float |
getPercent(int column)
Get the percentage of the given column. |
static int |
getTableClientWidth(org.eclipse.swt.widgets.Table table)
Get the width of the client area of the given table. |
void |
layout()
Recalculate the width of all columns according to the layout information of this TableLayoutManager. |
void |
layout(boolean force)
Recalculate the width of all columns according to the layout information of this TableLayoutManager. |
void |
manageTable(org.eclipse.swt.widgets.Table table,
int take)
Attaches the TableLayoutManager to an SWT-Table. |
void |
recalcLayoutInfoFromTable(int take)
Recalculates all layout informations from the current width of the columns of the attached table. |
void |
removeColumn(int column)
Removes a column to the TableLayoutManager. |
void |
scaleAllPercents(float factor)
Scale the percentages of all columns by the given factor |
void |
setAbsolutWidth(int column,
int width)
Set the absolute width of the given column in pixel. |
void |
setDefaultAbsolutWidth(int defaultAbsolutWidth)
Set the default absolute width. |
void |
setDefaultMaxWidth(int defaultMaxWidth)
Set the default maximum width, used for all columns without individual maximum width. |
void |
setDefaultMinWidth(int defaultMinWidth)
Set the default minimum width, used for all columns without individual maximum width. |
void |
setMaxWidth(int column,
int max)
Set the maximum width of the given column in pixel. |
void |
setMinLimit(int minLimit)
Set the lower limit for all column widths. |
void |
setMinWidth(int column,
int min)
Set the minimum width of the given column in pixel. |
void |
setPercent(int column,
float percent)
Set the width of the given column in percent of the table width. |
void |
setStrechColumn(int column)
Set the column, which should take the whole space of the table which remains after calculating the width of all other columns. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NONE
public static final int PERCENT
public static final int MIN
public static final int MAX
public static final int ABSOLUT
| Constructor Detail |
public TableLayoutManager()
| Method Detail |
public void manageTable(org.eclipse.swt.widgets.Table table,
int take)
table - to managetake - defines which layout information should be calculated from the current width of the columns.
possible values: PERCENT, MIN, MAX, ABSOLUT. These value may be ored
together to take more information.public void recalcLayoutInfoFromTable(int take)
manageTable(Table, int).
take - defines which layout information should be calculated from the current width of the columns.
possible values: PERCENT, MIN, MAX, ABSOLUT. These value may be ored
together to take more information.public void addColumn(int column)
manageTable(org.eclipse.swt.widgets.Table, int), you have to call this method to inform the TableLayoutManager about the
new column.
column - index of the new column in the SWT-Table.public void removeColumn(int column)
manageTable(org.eclipse.swt.widgets.Table, int), you have to call this method to inform the TableLayoutManager about the
removal of the column.
column - index of the column in the SWT-Table.public float getPercent(int column)
column - index of the column in the SWT-Table.
public void setPercent(int column,
float percent)
column - index of the column in the SWT-Table.percent - column width/table width * 100 public int getMinWidth(int column)
column - index of the column in the SWT-Table.
public void setMinWidth(int column,
int min)
column - index of the column in the SWT-Table.public int getMaxWidth(int column)
column - index of the column in the SWT-Table.
public void setMaxWidth(int column,
int max)
column - index of the column in the SWT-Table.public int getAbsolutWidth(int column)
column - index of the column in the SWT-Table.
public void setAbsolutWidth(int column,
int width)
column - index of the column in the SWT-Table.width - fixed witdh of the given column. -1 removes the fixed width information.public void setStrechColumn(int column)
column - index of the column to strech over the remaining space. -1 means strech no column.public void scaleAllPercents(float factor)
factor - to multiply to all percentagespublic int getMinLimit()
public void setMinLimit(int minLimit)
public int getDefaultAbsolutWidth()
public void setDefaultAbsolutWidth(int defaultAbsolutWidth)
public int getDefaultMaxWidth()
public void setDefaultMaxWidth(int defaultMaxWidth)
public int getDefaultMinWidth()
public void setDefaultMinWidth(int defaultMinWidth)
public static int getTableClientWidth(org.eclipse.swt.widgets.Table table)
public void layout()
layout(true).
public void layout(boolean force)
force - if false recalculate the column widths if the table width changed since the last calculation.
if true recalculate in any case.public void columnResized(org.eclipse.swt.widgets.TableColumn column)
column - which was resized by the GUIpublic void controlMoved(org.eclipse.swt.events.ControlEvent e)
controlMoved in interface org.eclipse.swt.events.ControlListenerpublic void controlResized(org.eclipse.swt.events.ControlEvent e)
controlResized in interface org.eclipse.swt.events.ControlListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||