use of de.jaret.util.ui.table.renderer.ICellRenderer in project translationstudio8 by heartsome.
the class JaretTable method registerDefaultRenderers.
/**
* Register all default renderers.
*
*/
private void registerDefaultRenderers() {
ICellRenderer cellRenderer = new TextCellRenderer();
registerCellRenderer(void.class, cellRenderer);
registerCellRenderer(String.class, cellRenderer);
registerCellRenderer(Image.class, new ImageCellRenderer());
cellRenderer = new BooleanCellRenderer();
registerCellRenderer(Boolean.class, cellRenderer);
registerCellRenderer(Boolean.TYPE, cellRenderer);
cellRenderer = new DateCellRenderer();
registerCellRenderer(Date.class, cellRenderer);
registerCellRenderer(JaretDate.class, cellRenderer);
cellRenderer = new DoubleCellRenderer();
registerCellRenderer(Double.class, cellRenderer);
registerCellRenderer(Double.TYPE, cellRenderer);
}
use of de.jaret.util.ui.table.renderer.ICellRenderer in project translationstudio8 by heartsome.
the class JaretTable method drawCell.
/**
* Draw a single cell. Drawing is accomplished by the associated cell renderer. However the mark for fill dragging
* is drawn by this method.
*
* @param gc gc
* @param area drawing area the cell takes up
* @param row row of the cell
* @param col olumn of the cell
*/
private void drawCell(GC gc, Rectangle area, IRow row, IColumn col) {
ICellStyle bc = _tvs.getCellStyle(row, col);
ICellRenderer cellRenderer = getCellRenderer(row, col);
boolean hasFocus = false;
if (_focussedRow == row && _focussedColumn == col) {
// == is appropriate: these are really the same objects!
hasFocus = true;
}
boolean isSelected = isSelected(row, col);
cellRenderer.draw(gc, this, bc, area, row, col, hasFocus, isSelected, false);
if (_supportFillDragging && isSelected && isDragMarkerCell(row, col)) {
drawFillDragMark(gc, area);
}
}
Aggregations