de.kupzog.ktable.renderers
Class FixedVerticalCellRenderer
java.lang.Object
de.kupzog.ktable.renderers.DefaultCellRenderer
de.kupzog.ktable.renderers.FixedCellRenderer
de.kupzog.ktable.renderers.FixedVerticalCellRenderer
- All Implemented Interfaces:
- KTableCellRenderer
public class FixedVerticalCellRenderer
- extends FixedCellRenderer
Draws a cell in fixed style (understanding all the flags used in
FixedCellRenderer
. Draws the text vertically instead
of horizontally.
Accepted styles:
- STYLE_FLAT for a flat look.
- STYLE_PUSH for a button-like look.
- INDICATION_SORT if a sort indicator should be painted. Has only an effect
when the
KTableModel
used is an
instance of KTableSortedModel
.
Can be combined with STYLE_FLAT
or STYLE_PUSH
by or-ing.
- INDICATION_FOCUS when a focus bit should be colored differently. Combine by or-ing.
Note that the focus is only set to fixed cells when
KTable.setHighlightSelectionInHeader(true)
is set.
- INDICATION_FOCUS_ROW when row-selection mode is on and the row highlighting should
be present in the fixed cell on the left.
- INDICATION_CLICKED shows a visible feedback when the user clicks on the cell.
Only applicable if STYLE_PUSH is used.
- SWT.BOLD Makes the renderer draw bold text.
- SWT.ITALIC Makes the renderer draw italic text
- Author:
- Lorenz Maierhofer
Fields inherited from class de.kupzog.ktable.renderers.DefaultCellRenderer |
COLOR_BACKGROUND, COLOR_BGFOCUS, COLOR_BGROWFOCUS, COLOR_COMMENTSIGN, COLOR_FGROWFOCUS, COLOR_FIXEDHIGHLIGHT, COLOR_LINE_DARKGRAY, COLOR_LINE_LIGHTGRAY, COLOR_TEXT, INDICATION_CLICKED, INDICATION_COMMENT, INDICATION_FOCUS, INDICATION_FOCUS_ROW, INDICATION_GRADIENT, INDICATION_SORT, STYLE_FLAT, STYLE_PUSH |
Method Summary |
int |
getOptimalWidth(org.eclipse.swt.graphics.GC gc,
int col,
int row,
java.lang.Object content,
boolean fixed,
KTableModel model)
Returns the optimal width of the given cell (used by column resizing) |
Methods inherited from class de.kupzog.ktable.renderers.DefaultCellRenderer |
getAlignment, getFont, getForeground, getStyle, setAlignment, setBackground, setDefaultBackground, setDefaultForeground, setFont, setForeground, setStyle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FixedVerticalCellRenderer
public FixedVerticalCellRenderer(int style)
- Parameters:
style
-
getOptimalWidth
public int getOptimalWidth(org.eclipse.swt.graphics.GC gc,
int col,
int row,
java.lang.Object content,
boolean fixed,
KTableModel model)
- Description copied from interface:
KTableCellRenderer
- Returns the optimal width of the given cell (used by column resizing)
- Specified by:
getOptimalWidth
in interface KTableCellRenderer
- Overrides:
getOptimalWidth
in class DefaultCellRenderer
- Returns:
- int