本文整理汇总了Java中org.eclipse.jface.viewers.CheckboxCellEditor类的典型用法代码示例。如果您正苦于以下问题:Java CheckboxCellEditor类的具体用法?Java CheckboxCellEditor怎么用?Java CheckboxCellEditor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CheckboxCellEditor类属于org.eclipse.jface.viewers包,在下文中一共展示了CheckboxCellEditor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTableViewer
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
private void createTableViewer() {
tableViewer = new TableViewer(table);
tableViewer.setUseHashlookup(true);
tableViewer.setColumnProperties(columnNames);
// Create the cell editors
CellEditor[] editors = new CellEditor[columnNames.length];
// Column 1 : nothing
editors[0] = null;
// Columns 2 : checkbox
editors[1] = new CheckboxCellEditor(table);
// Assign the cell editors to the viewer
tableViewer.setCellEditors(editors);
// Set the cell modifier for the viewer
tableViewer.setCellModifier(new ExtensionCellModifier(this));
}
示例2: createTableViewer
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
private void createTableViewer() {
tableViewer = new TableViewer(table);
tableViewer.setUseHashlookup(true);
tableViewer.setColumnProperties(columnNames);
// Create the cell editors
CellEditor[] editors = new CellEditor[columnNames.length];
// Column 1 : nothing
editors[0] = null;
// Columns 2,3,4 : checkboxes
editors[1] = new CheckboxCellEditor(table);
editors[2] = new CheckboxCellEditor(table);
editors[3] = new CheckboxCellEditor(table);
// Assign the cell editors to the viewer
tableViewer.setCellEditors(editors);
// Set the cell modifier for the viewer
tableViewer.setCellModifier(new ExtensionCellModifier(this));
// Set the default sorter for the viewer
//tableViewer.setSorter(new ExtensionSorter(ExtensionSorter.NAME));
}
示例3: createPropertyEditor
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
public CellEditor createPropertyEditor(Composite parent)
{
final Class type = getter.getReturnType();
if (!type.isPrimitive() && type != String.class) return null;
if (type == boolean.class) return new CheckboxCellEditor(parent);
TextCellEditor editor = new TextCellEditor(parent);
if (type == String.class) return editor;
if (isNumeric(type))
{
editor.setValidator(new NumberValidator(type));
}
return editor;
}
示例4: setEditor
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
private void setEditor(ICellModifier<T> modifier, int index) {
switch (modifier.getCellEditingType()) {
case TEXTBOX:
if (modifier.getStyle() != SWT.NONE)
editors[index] = new TextCellEditor(getComponent(), modifier.getStyle());
else
editors[index] = new TextCellEditor(getComponent());
break;
case COMBOBOX:
editors[index] = new ComboEditor(getComponent(), new String[0]);
break;
case CHECKBOX:
if (modifier.getStyle() != SWT.NONE)
editors[index] = new CheckboxCellEditor(getComponent(), modifier.getStyle());
else
editors[index] = new CheckboxCellEditor(getComponent());
break;
default:
break;
}
}
示例5: createPropertyEditor
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
public CellEditor createPropertyEditor(Composite parent) {
CellEditor editor = new CheckboxCellEditor(parent);
if (getValidator() != null) {
editor.setValidator(getValidator());
}
return editor;
}
示例6: createTreeViewer
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected TreeViewer createTreeViewer(Composite parent) {
TreeViewer result = super.createTreeViewer(parent);
// Initialize the table.
Tree tree = result.getTree();
tree.setHeaderVisible(true);
tree.setToolTipText("Node Display Properties");
EditColTableDef.setupTree(TABLE_DEF, tree);
// Configure cell editing.
CellEditor[] cellEditors = new CellEditor[TABLE_DEF.length];
cellEditors[INDEX_NAME] = null;
cellEditors[INDEX_SELECTED] = new CheckboxCellEditor(tree);
cellEditors[INDEX_XPOS] = new TextCellEditor(tree);
cellEditors[INDEX_YPOS] = new TextCellEditor(tree);
cellEditors[INDEX_VISIBLE] = new CheckboxCellEditor(tree);
cellEditors[INDEX_SIZE] = new ComboBoxCellEditor(
tree, buildSizeOptions());
cellEditors[INDEX_COLOR] = new ColorCellEditor(tree);
result.setCellEditors(cellEditors);
result.setLabelProvider(new PartLabelProvider());
result.setColumnProperties(EditColTableDef.getProperties(TABLE_DEF));
result.setCellModifier(new PartCellModifier());
return result;
}
示例7: EdgeMatcherTableControl
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
public EdgeMatcherTableControl(Composite parent) {
super(parent, SWT.NONE);
setLayout(Widgets.buildContainerLayout(1));
viewer = new TableViewer(this,
SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
// Layout embedded table
Table relationTable = viewer.getTable();
relationTable.setLayoutData(Widgets.buildGrabFillData());
// initialize the table
relationTable.setHeaderVisible(true);
relationTable.setToolTipText("Edge Matcher Definition");
EditColTableDef.setupTable(TABLE_DEF, relationTable);
CellEditor[] cellEditors = new CellEditor[TABLE_DEF.length];
cellEditors[INDEX_RELATION] = null;
cellEditors[INDEX_FORWARD] = new CheckboxCellEditor(relationTable);
cellEditors[INDEX_BACKWARD] = new CheckboxCellEditor(relationTable);
// cell content
viewer.setCellEditors(cellEditors);
viewer.setLabelProvider(new CellLabelProvider());
viewer.setColumnProperties(EditColTableDef.getProperties(TABLE_DEF));
viewer.setCellModifier(new CellModifier());
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setComparator(new AlphabeticSorter(new ViewerObjectToString() {
@Override
public String getString(Object object) {
if (object instanceof Relation) {
return ((Relation) object).toString();
}
return object.toString();
}
}));
}
示例8: RelationSetTableControl
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
public RelationSetTableControl(Composite parent) {
super(parent, SWT.NONE);
setLayout(Widgets.buildContainerLayout(1));
// Layout embedded table
relSetViewer = new TableViewer(this,
SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);
// Set up layout properties
Table relSetTable = relSetViewer.getTable();
relSetTable.setLayoutData(Widgets.buildGrabFillData());
// initialize the table
relSetTable.setHeaderVisible(true);
relSetTable.setToolTipText("List of Relations");
EditColTableDef.setupTable(TABLE_DEF, relSetTable);
// Configure cell editing
CellEditor[] cellEditors = new CellEditor[TABLE_DEF.length];
cellEditors[INDEX_NAME] = null;
cellEditors[INDEX_SOURCE] = null;
cellEditors[INDEX_VISIBLE] = new CheckboxCellEditor(relSetTable);
// Configure table properties.
relSetViewer.setCellEditors(cellEditors);
relSetViewer.setLabelProvider(new ControlLabelProvider());
relSetViewer.setColumnProperties(EditColTableDef.getProperties(TABLE_DEF));
relSetViewer.setCellModifier(new ControlCellModifier());
relSetViewer.setContentProvider(ArrayContentProvider.getInstance());
configSorters(relSetTable);
}
示例9: createPropertyEditor
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
public CellEditor createPropertyEditor(Composite parent)
{
CellEditor editor = new CheckboxCellEditor(parent);
if (getValidator() != null)
{
editor.setValidator(getValidator());
}
return editor;
}
示例10: ParameterEditingSupport
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
public ParameterEditingSupport( ColumnViewer viewer, Map isSelectedMap )
{
super( viewer );
this.viewer = viewer;
editor = new CheckboxCellEditor(null, SWT.CHECK | SWT.READ_ONLY);
this.selectedStatusMap = isSelectedMap;
}
示例11: getCellEditor
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected CellEditor getCellEditor(Object element) {
if (this.column == PRIORITY_PROP) {
this.editor = new TextCellEditor(this.viewer.getTable());
editor.setValidator(new ICellEditorValidator() {
@Override
public String isValid(Object value) {
boolean valid = true;
if (!"".equals(value)) {
try {
int val = Integer.parseInt((String) value);
if (val <= 0) {
valid = false;
}
} catch (NumberFormatException | ClassCastException e) {
valid = false;
}
}
editor.getControl()
.setBackground(valid ? null : Display.getDefault().getSystemColor(SWT.COLOR_RED));
return (valid ? null : "positive integer required");
}
});
((Text) ((TextCellEditor) editor).getControl()).selectAll();
} else if (this.column == PREEMPT_PROP) {
this.editor = new CheckboxCellEditor(viewer.getTable());
}
return this.editor;
}
示例12: createDialogArea
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new FillLayout());
FormToolkit toolkit = new FormToolkit(Display.getCurrent());
Section selectObjectSection = toolkit.createSection(container, ExpandableComposite.TITLE_BAR
| ExpandableComposite.FOCUS_TITLE);
selectObjectSection.setText(selectProvider ? M.SelectProviders : M.SelectRecipients);
Composite composite = toolkit.createComposite(selectObjectSection, SWT.NONE);
UI.gridLayout(composite, 1);
selectObjectSection.setClient(composite);
toolkit.adapt(composite);
viewer = Tables.createViewer(composite, LABELS.ALL);
viewer.setLabelProvider(new ConnectionLabelProvider(this));
Table table = viewer.getTable();
createInternalModel();
if (availableConnections.size() > 0)
viewer.setInput(availableConnections.toArray(new AvailableConnection[availableConnections.size()]));
CellEditor[] editors = new CellEditor[5];
editors[1] = new CheckboxCellEditor(table);
editors[2] = new CheckboxCellEditor(table);
viewer.setColumnProperties(LABELS.ALL);
viewer.setCellModifier(new ConnectionCellModifier(this));
viewer.setCellEditors(editors);
toolkit.paintBordersFor(composite);
return container;
}
示例13: getCellEditor
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
public CellEditor getCellEditor(AvroNode node, ColumnViewer viewer) {
return new CheckboxCellEditor((Composite) viewer.getControl());
}
示例14: getCellEditor
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected CellEditor getCellEditor(Object element) {
return new CheckboxCellEditor(viewer.getTable(), SWT.CHECK);
}
示例15: getCellEditor
import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected CellEditor getCellEditor(final Object element) {
return new CheckboxCellEditor(null, SWT.CHECK | SWT.READ_ONLY);
}