|
||||||||||
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.CheckableCellRenderer
public class CheckableCellRenderer
Cell renderer that expects a Boolean as content of a cell. It then represents the value by a checked or unchecked box.
It accepts the following style bits:
KTableCellEditorCheckbox
,
KTableCellEditorCheckbox2
Field Summary | |
---|---|
static org.eclipse.swt.graphics.Color |
BORDER_DARK
|
static org.eclipse.swt.graphics.Color |
BORDER_LIGHT
|
static org.eclipse.swt.graphics.Color |
COLOR_FILL
|
static org.eclipse.swt.graphics.Image |
IMAGE_CHECKED
Indicator for a checked entry / true boolean decision |
static org.eclipse.swt.graphics.Image |
IMAGE_CHECKED_CLICKED
Indicator for an checked entry / true boolean decision that is currently clicked. |
static org.eclipse.swt.graphics.Image |
IMAGE_UNCHECKED
Indicator for an unchecked entry / false boolean decision |
static org.eclipse.swt.graphics.Image |
IMAGE_UNCHECKED_CLICKED
Indicator for an unchecked entry / false boolean decision that is currently clicked. |
static int |
SIGN_CHECK
Makes the renterer draw a check sign as the symbol that signals the value true. |
static int |
SIGN_IMAGE
Style bit that forces that the renderer paints images instead of directly painting. |
static int |
SIGN_X
Makes the renderer draw an X as the symbol that signals the value is true. |
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 | |
---|---|
CheckableCellRenderer(int style)
Creates a cellrenderer that shows boolean values with the given 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. |
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) |
void |
setCommentIndication(boolean value)
|
Methods inherited from class de.kupzog.ktable.renderers.DefaultCellRenderer |
---|
getAlignment, getBackground, 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 |
Field Detail |
---|
public static final int SIGN_IMAGE
Note that when using images, drawing is 2-3 times slower than when using direct painting. It might be visible if many cells should be rendered that way. So this is not default.
public static final int SIGN_X
public static final int SIGN_CHECK
public static final org.eclipse.swt.graphics.Image IMAGE_CHECKED
public static final org.eclipse.swt.graphics.Image IMAGE_UNCHECKED
public static final org.eclipse.swt.graphics.Image IMAGE_CHECKED_CLICKED
public static final org.eclipse.swt.graphics.Image IMAGE_UNCHECKED_CLICKED
public static final org.eclipse.swt.graphics.Color COLOR_FILL
public static final org.eclipse.swt.graphics.Color BORDER_DARK
public static final org.eclipse.swt.graphics.Color BORDER_LIGHT
Constructor Detail |
---|
public CheckableCellRenderer(int style)
style
- Honored style bits are:
Styles that influence the sign painted when cell value is true:
- SIGN_IMAGE
- SIGN_X
- SIGN_CHECK (default)
Method Detail |
---|
public int getOptimalWidth(org.eclipse.swt.graphics.GC gc, int col, int row, java.lang.Object content, boolean fixed, KTableModel model)
KTableCellRenderer
getOptimalWidth
in interface KTableCellRenderer
getOptimalWidth
in class DefaultCellRenderer
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 void setCommentIndication(boolean value)
value
- If true, the comment sign is painted.
Else it is omitted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |