org.eclipse.jface.viewers.ComboBoxViewerCellEditor Java Examples

The following examples show how to use org.eclipse.jface.viewers.ComboBoxViewerCellEditor. 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: JFaceViewerIntegrationExample.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
public GenderEditingSupport(ColumnViewer viewer) {
	super(viewer);
	cellEditor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl(), SWT.READ_ONLY);
	cellEditor.setLabelProvider(new LabelProvider());
	cellEditor.setContentProvider(new ArrayContentProvider());
	cellEditor.setInput(Person.Gender.values());
}
 
Example #2
Source File: FieldTypeEditingSupport.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
 protected CellEditor getCellEditor(Object element) {
     ComboBoxViewerCellEditor cellEditor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl(),
             SWT.READ_ONLY);
     cellEditor.getControl().setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, TYPE_COMBO_EDITOR_ID);
     cellEditor.setContentProvider(ArrayContentProvider.getInstance());
 //    if(!GTKStyleHandler.isGTK3()) {
         cellEditor.setActivationStyle(ComboBoxViewerCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION);
//     }
     cellEditor.getControl().addListener(SWT.Selection, e -> getViewer().getControl().getParent().setFocus());
     cellEditor.setLabelProvider(labelProvider);
     cellEditor.setInput(getInput());
     return cellEditor;
 }
 
Example #3
Source File: QueryParameterTypeEditingSupport.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected CellEditor getCellEditor(Object element) {
    ComboBoxViewerCellEditor cellEditor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl(),
            SWT.READ_ONLY);
    cellEditor.getControl().setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, QUERY_PARAM_TYPE_COMBO_EDITOR_ID);
    cellEditor.setContentProvider(ArrayContentProvider.getInstance());
    cellEditor.setActivationStyle(ComboBoxViewerCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION);
    cellEditor.getControl().addListener(SWT.Selection, e -> getViewer().getControl().getParent().setFocus());
    cellEditor.setLabelProvider(new LabelProviderBuilder<QueryParameterTypes>()
            .withTextProvider(QueryParameterTypes::getName)
            .createLabelProvider());
    cellEditor.setInput(QueryParameterTypes.values());
    return cellEditor;
}
 
Example #4
Source File: ParameterTypeEditingSupport.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected CellEditor getCellEditor(final Object element) {
    final ComboBoxViewerCellEditor editor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl(), SWT.READ_ONLY) ;
    editor.setContentProvider(new ArrayContentProvider()) ;
    editor.setLabelProvider(new ParameterTypeLabelProvider()) ;
    editor.setInput(types) ;
    return editor ;
}
 
Example #5
Source File: ContractInputTypeEditingSupport.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected CellEditor getCellEditor(Object element) {
    final ComboBoxViewerCellEditor comboBoxViewerCellEditor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl());
    comboBoxViewerCellEditor.setContentProvider(ArrayContentProvider.getInstance());
    comboBoxViewerCellEditor.setInput(SELECTABLE_TYPES);
    return comboBoxViewerCellEditor;
}
 
Example #6
Source File: ComboBoxEditingSupportBuilder.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public ComboBoxEditingSupportBuilder(ColumnViewer viewer) {
    this.viewer = viewer;
    this.editor = new ComboBoxViewerCellEditor((Composite) viewer.getControl(), SWT.BORDER | SWT.READ_ONLY);
}
 
Example #7
Source File: CellEditorViewerProperties.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
protected Object doGetValue(Object source) {
	if(source instanceof ComboBoxViewerCellEditor){
		return ((ComboBoxViewerCellEditor) source).getViewer();
	}
	return null;
}
 
Example #8
Source File: CellEditorViewerProperties.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
protected void doSetValue(Object source, Object value) {
	((ComboBoxViewerCellEditor) source).getViewer().setSelection(new StructuredSelection(value));
}