Package org.csstudio.ui.util
Class MinSizeTableColumnLayout
java.lang.Object
org.eclipse.swt.widgets.Layout
org.eclipse.jface.layout.AbstractColumnLayout
org.eclipse.jface.layout.TableColumnLayout
org.csstudio.ui.util.MinSizeTableColumnLayout
TableColumnLayout
that enforces a minimum column width
Especially on Linux this avoids the "vanishing column" issue when users resize a column to nothing and then moan because it's gone.
Table needs to be created as usual for TableColumnLayout, assigning a ColumnWeightData to each column for automated resize.
Once the user manually adjusts a column, the TableColumnLayout replaces the ColumnWeightData for automated resizing with a ColumnPixelData to hold the exact user-selected width. The 'minimumWidth' of the original ColumnWeightData is lost. This class holds its own min_width which is applied to all columns even after a user manually adjusted a column.
-
Field Summary
Fields inherited from class org.eclipse.jface.layout.AbstractColumnLayout
LAYOUT_DATA
-
Constructor Summary
ConstructorDescriptionMinSizeTableColumnLayout
(int min_width) Initialize a TableColumnLayout that always enforces a minimum column size -
Method Summary
Methods inherited from class org.eclipse.jface.layout.TableColumnLayout
getColumnCount, getLayoutData, setColumnWidths
Methods inherited from class org.eclipse.jface.layout.AbstractColumnLayout
computeSize, getColumnTrim, layout, setColumnData
Methods inherited from class org.eclipse.swt.widgets.Layout
flushCache
-
Constructor Details
-
MinSizeTableColumnLayout
public MinSizeTableColumnLayout(int min_width) Initialize a TableColumnLayout that always enforces a minimum column size- Parameters:
min_width
- Minimum column size in pixels
-
-
Method Details
-
updateColumnData
- Overrides:
updateColumnData
in classTableColumnLayout
-