org.eclipse.jface.viewers.CheckboxCellEditor Java Examples
The following examples show how to use
org.eclipse.jface.viewers.CheckboxCellEditor.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ModuleTableViewer.java From hybris-commerce-eclipse-plugin with Apache License 2.0 | 6 votes |
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)); }
Example #2
Source File: ModifySupport.java From olca-app with Mozilla Public License 2.0 | 6 votes |
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; } }
Example #3
Source File: ConnectionDialog.java From olca-app with Mozilla Public License 2.0 | 6 votes |
@Override protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); UI.gridLayout(container, 1); viewer = Tables.createViewer(container, LABELS.ALL); double w = 1 / 6d; Tables.bindColumnWidths(viewer, w, w, w, w, w, w); viewer.setLabelProvider(new ConnectionLabelProvider(this)); Table table = viewer.getTable(); viewer.setInput(candidates); 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); return container; }
Example #4
Source File: AttributeEditionControl.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
private void createMultipleColumn(TableViewer viewer) { TableViewerColumn column = new TableViewerColumn(viewer, SWT.CENTER); column.getColumn().setText(Messages.multiple); column.setLabelProvider(new CheckboxLabelProviderBuilder<Field>() .withIsSelectedProvider(Field::isCollection) .createCheckboxLabelProvider(viewer)); column.setEditingSupport(new EditingSupportBuilder<Field>(viewer) .withCellEditorProvider(field -> new CheckboxCellEditor((Composite) viewer.getControl(), SWT.CHECK)) .withValueProvider(field -> field.isCollection()) .withValueUpdater((field, multiple) -> { field.setCollection((boolean) multiple); if ((boolean) multiple) { field.setNullable(true); } }) .create()); }
Example #5
Source File: ModuleTableViewer.java From hybris-commerce-eclipse-plugin with Apache License 2.0 | 6 votes |
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)); }
Example #6
Source File: EdgeMatcherTableControl.java From depan with Apache License 2.0 | 5 votes |
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(); } })); }
Example #7
Source File: RelationSetTableControl.java From depan with Apache License 2.0 | 5 votes |
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); }
Example #8
Source File: NodeDisplayTableControl.java From depan with Apache License 2.0 | 5 votes |
@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; }
Example #9
Source File: AttributeEditionControl.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
private void createMandatoryColumn(TableViewer viewer) { TableViewerColumn column = new TableViewerColumn(viewer, SWT.CENTER); column.getColumn().setText(Messages.mandatory); column.setLabelProvider(new CheckboxLabelProviderBuilder<Field>() .withIsSelectedProvider(field -> !field.isNullable()) .withIsEnableProvider(field -> !field.isCollection()) .withTooltipProvider(field -> field.isCollection() ? Messages.disabledMandatoryTooltip : null) .createCheckboxLabelProvider(viewer)); column.setEditingSupport(new EditingSupportBuilder<Field>(viewer) .withCanEditProvider(field -> !field.isCollection()) .withCellEditorProvider(field -> new CheckboxCellEditor((Composite) viewer.getControl(), SWT.CHECK)) .withValueProvider(field -> !field.isNullable()) .withValueUpdater((field, mandatory) -> field.setNullable(!(boolean) mandatory)) .create()); }
Example #10
Source File: PyEditorHoverConfigurationBlock.java From Pydev with Eclipse Public License 1.0 | 5 votes |
@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; }
Example #11
Source File: PromptParameterDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
public ParameterEditingSupport( ColumnViewer viewer, Map isSelectedMap ) { super( viewer ); this.viewer = viewer; editor = new CheckboxCellEditor(null, SWT.CHECK | SWT.READ_ONLY); this.selectedStatusMap = isSelectedMap; }
Example #12
Source File: JFaceViewerIntegrationExample.java From nebula with Eclipse Public License 2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor((Composite) getViewer().getControl(), SWT.CHECK); }
Example #13
Source File: TextTemplateView.java From elexis-3-core with Eclipse Public License 1.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element){ //Native Checkboxes not available: https://bugs.eclipse.org/bugs/show_bug.cgi?id=260061 return new CheckboxCellEditor(tableViewer.getTable(), SWT.CHECK | SWT.READ_ONLY); }
Example #14
Source File: CheckboxPropertyEditingSupportTest.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Test public void should_getCellEditor_returns_a_CheckboxCellEditor() throws Exception { assertThat(editingSupport.getCellEditor(null)).isInstanceOf(CheckboxCellEditor.class); }
Example #15
Source File: CheckboxPropertyEditingSupport.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Override protected CellEditor getCellEditor(final Object element) { return new CheckboxCellEditor((Composite) getViewer().getControl(), SWT.CHECK); }
Example #16
Source File: BooleanEditingSupport.java From statecharts with Eclipse Public License 1.0 | 4 votes |
@Override public CellEditor getCellEditor(Object element) { return new CheckboxCellEditor((Composite) getViewer().getControl(), SWT.READ_ONLY); }
Example #17
Source File: NewProjectTmPage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor(null, SWT.CHECK); }
Example #18
Source File: ProjectSettingTMPage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor(null, SWT.CHECK); }
Example #19
Source File: NewProjectTbPage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor(null, SWT.CHECK); }
Example #20
Source File: ProjectSettingTBPage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor(null, SWT.CHECK); }
Example #21
Source File: WizardStartPage.java From XPagesExtensionLibrary with Apache License 2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor(null, SWT.CHECK | SWT.READ_ONLY); }
Example #22
Source File: NewProjectTmPage.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor(null, SWT.CHECK); }
Example #23
Source File: ProjectSettingTMPage.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor(null, SWT.CHECK); }
Example #24
Source File: NewProjectTbPage.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor(null, SWT.CHECK); }
Example #25
Source File: ProjectSettingTBPage.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
@Override protected CellEditor getCellEditor(Object element) { return new CheckboxCellEditor(null, SWT.CHECK); }
Example #26
Source File: ValidationPreferencePage.java From APICloud-Studio with GNU General Public License v3.0 | 4 votes |
private Control createValidators(Composite parent) { Composite main = new Composite(parent, SWT.NONE); main.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); Composite labelComp = new Composite(main, SWT.NONE); labelComp.setLayout(GridLayoutFactory.fillDefaults().extendedMargins(5, 0, 0, 0).numColumns(2) .spacing(2, SWT.DEFAULT).create()); labelComp.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).create()); Label label = new Label(labelComp, SWT.NONE); label.setText(Messages.ValidationPreferencePage_LBL_Validators); Label helpImage = new Label(labelComp, SWT.NONE); helpImage.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_LCL_LINKTO_HELP)); helpImage.setToolTipText(Messages.ValidationPreferencePage_EnablingValidatorWarning); Group group = new Group(main, SWT.NONE); group.setLayout(GridLayoutFactory.swtDefaults().margins(4, 4).create()); group.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); Table table = new Table(group, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION); table.setLayoutData(GridDataFactory.fillDefaults().hint(300, 100).grab(true, false).create()); table.setLinesVisible(true); table.setHeaderVisible(true); // set up columns // Name column TableColumn name = new TableColumn(table, SWT.LEFT); name.setWidth(250); name.setText(Messages.ValidationPreferencePage_NameColumn); name.setToolTipText(Messages.ValidationPreferencePage_NameColumn); // Build column TableColumn build = new TableColumn(table, SWT.CENTER); build.setWidth(40); build.setText(Messages.ValidationPreferencePage_BuildColumn); build.setToolTipText(Messages.ValidationPreferencePage_BuildColumn); // Reconcile column TableColumn reconcile = new TableColumn(table, SWT.CENTER); reconcile.setWidth(75); reconcile.setText(Messages.ValidationPreferencePage_ReconcileColumn); reconcile.setToolTipText(Messages.ValidationPreferencePage_ReconcileColumn); // Now set up table viewer! validatorsViewer = new TableViewer(table); // validatorsViewer.setUseHashlookup(true); validatorsViewer.setColumnProperties(new String[] { NAME, BUILD, RECONCILE }); // Assign the cell editors to the viewer validatorsViewer.setCellEditors(new CellEditor[] { null, new CheckboxCellEditor(table), new CheckboxCellEditor(table) }); // Set the cell modifier for the viewer validatorsViewer.setCellModifier(new ParticipantCellModifier(validatorsViewer)); // Now set up content/label providers validatorsViewer.setContentProvider(ArrayContentProvider.getInstance()); validatorsViewer.setLabelProvider(new ParticipantLabelProvider()); // Hide required participants validatorsViewer.addFilter(new RequiredParticipantFilter()); // check the selected build participant, show it's filters validatorsViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { updateFilterExpressions(); } }); // Now set input validatorsViewer.setInput(this.participants); return main; }