|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.kupzog.ktable.renderers.DefaultCellRenderer
de.kupzog.ktable.renderers.FixedCellRenderer
public class FixedCellRenderer
Class that provides an easy way of rendering a fixed cell.
Provided styles are at the moment:
KTableModel
used is an
instance of KTableSortedModel
. STYLE_FLAT
or STYLE_PUSH
by or-ing.
KTable.setHighlightSelectionInHeader(true)
is set.
Field Summary | |
---|---|
static org.eclipse.swt.graphics.Color |
COLOR_FIXEDBACKGROUND
|
static org.eclipse.swt.graphics.Image |
IMAGE_ARROWDOWN
Small arrow pointing down. |
static org.eclipse.swt.graphics.Image |
IMAGE_ARROWUP
Small arrow pointing up. |
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 |
Fields inherited from interface de.kupzog.ktable.KTableCellRenderer |
---|
defaultRenderer |
Constructor Summary | |
---|---|
FixedCellRenderer(int style)
A constructor that lets the caller specify the style. |
Method Summary | |
---|---|
void |
drawCell(org.eclipse.swt.graphics.GC gc,
org.eclipse.swt.graphics.Rectangle rect,
int col,
int row,
java.lang.Object content,
boolean focus,
boolean fixed,
boolean clicked,
KTableModel model)
Paint a box with or without a checked symbol. |
org.eclipse.swt.graphics.Color |
getBackground()
|
Methods inherited from class de.kupzog.ktable.renderers.DefaultCellRenderer |
---|
getAlignment, getFont, getForeground, getOptimalWidth, getStyle, setAlignment, setBackground, setDefaultBackground, setDefaultForeground, setFont, setForeground, setStyle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.eclipse.swt.graphics.Image IMAGE_ARROWDOWN
public static final org.eclipse.swt.graphics.Image IMAGE_ARROWUP
public static final org.eclipse.swt.graphics.Color COLOR_FIXEDBACKGROUND
Constructor Detail |
---|
public FixedCellRenderer(int style)
style
- The style that should be used to paint.
- Use SWT.FLAT for a flat look.
- Use SWT.PUSH for a button-like look. (default)
The following additional indications can be activated:
- INDICATION_FOCUS changes the background color if the fixed cell has focus.
- INDICATION_FOCUS_ROW changes the background color so that it machtes with normal cells in rowselection mode.
- INDICATION_SORT shows the sort direction when using a KTableSortedModel.
- INDICATION_CLICKED shows a click feedback, if STYLE_PUSH is specified.
For text styles, the styles SWT.BOLD and SWT.ITALIC can be given.
Method Detail |
---|
public void drawCell(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rect, int col, int row, java.lang.Object content, boolean focus, boolean fixed, boolean clicked, KTableModel model)
drawCell
in interface KTableCellRenderer
drawCell
in class DefaultCellRenderer
gc
- The gc to draw onrect
- The coordinates and size of the cell (add 1 to width and hight
to include the borders)col
- The columnrow
- The rowcontent
- The content of the cell (as given by the table model)focus
- True if the cell is selectedfixed
- True if the cell is an unscrollable header cell (not an unscrollable body cell!)clicked
- True if the cell is currently clicked (useful e.g. to paint a
pressed button)
the case when fixed row and column elements should be highlighted because a cell in that
row and column has focus.model
- The KTableModel that holds the data for the cell. Note that this is only included
into the parameter list to allow more flexible cell renderers. Models might provide additional
information that can be requested when rendering.KTableCellRenderer.drawCell(GC, Rectangle, int, int, Object, boolean, boolean, boolean, KTableModel)
public org.eclipse.swt.graphics.Color getBackground()
getBackground
in class DefaultCellRenderer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |