提交 274dfe3d 编写于 作者: S serge-rider

Checkbox cell editor/renderer


Former-commit-id: e1155f27
上级 0658536f
......@@ -47,7 +47,7 @@ public class CustomCheckboxCellEditor extends CellEditor {
@Override
protected Control createControl(Composite parent) {
Composite placeholder = new Composite(parent, SWT.NONE);
placeholder.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
//placeholder.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
GridLayout gl = new GridLayout(1, false);
gl.verticalSpacing = 0;
gl.horizontalSpacing = 0;
......@@ -56,10 +56,10 @@ public class CustomCheckboxCellEditor extends CellEditor {
placeholder.setLayout(gl);
combo = new Button(placeholder, SWT.CHECK);
final GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER);
gd.verticalIndent = 2;
final GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_CENTER);
gd.verticalIndent = 1;
gd.horizontalIndent = 4;
gd.grabExcessHorizontalSpace = true;
//gd.grabExcessHorizontalSpace = true;
//combo.add(DBConstants.BOOLEAN_PROP_NO);
//combo.add(DBConstants.BOOLEAN_PROP_YES);
combo.setLayoutData(gd);
......
......@@ -179,7 +179,7 @@ public abstract class ObjectViewerRenderer {
//(editable ? ImageUtils.getImageCheckboxEnabledOn() : ImageUtils.getImageCheckboxDisabledOn()) :
//(editable ? ImageUtils.getImageCheckboxEnabledOff() : ImageUtils.getImageCheckboxDisabledOff());
final Rectangle imageBounds = image.getBounds();
gc.drawImage(image, event.x + 4 /*+ (columnWidth - imageBounds.width) / 2*/, event.y + (columnHeight - imageBounds.height) / 2);
gc.drawImage(image, event.x + 4 /*+ (columnWidth - imageBounds.width) / 2*/, event.y + 2);
event.doit = false;
// System.out.println("PAINT " + cellValue + " " + System.currentTimeMillis());
} else if (isHyperlink(cellValue)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册