当前位置: 首页>>代码示例>>Java>>正文


Java ComboBoxViewerCellEditor类代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.ComboBoxViewerCellEditor的典型用法代码示例。如果您正苦于以下问题:Java ComboBoxViewerCellEditor类的具体用法?Java ComboBoxViewerCellEditor怎么用?Java ComboBoxViewerCellEditor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ComboBoxViewerCellEditor类属于org.eclipse.jface.viewers包,在下文中一共展示了ComboBoxViewerCellEditor类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBooleanComboBox

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
/**
 * createBooleanComboBox
 *   void
 */
private void createBooleanComboBox() {
    cellEditor = new ComboBoxViewerCellEditor(tableViewer.getTable(), SWT.READ_ONLY);
    ((ComboBoxViewerCellEditor) cellEditor).setContenProvider(new IStructuredContentProvider() {
        /**
         * @see org.eclipse.jface.viewers.IContentProvider#dispose()
         */
        public void dispose() {
        }

        /**
         * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
         */
        public Object[] getElements(Object inputElement) {
            return (Object[]) inputElement;
        }

        /**
         * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
         *      java.lang.Object, java.lang.Object)
         */
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
    });
    ((ComboBoxViewerCellEditor) cellEditor).setInput(UICoreConstant.UMLSECTION_CONSTANTS__DEFAULT_VALUES_BOOLEAN);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:30,代码来源:AttributeSection.java

示例2: YesNoEditingSupport

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
public YesNoEditingSupport(ColumnViewer viewer, BooleanChangeValues type) {
    super(viewer);
    cellEditor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl(), SWT.READ_ONLY);
    cellEditor.setLabelProvider(new LabelProvider());
    cellEditor.setContentProvider(ArrayContentProvider.getInstance());
    cellEditor.setInput(YesNoValues.values());
    this.type = type;
    this.viewer = viewer;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:10,代码来源:YesNoEditingSupport.java

示例3: createBooleanComboBox

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
/**
 * createBooleanComboBox
 *   void
 */
private void createBooleanComboBox() {
    cellEditor = new ComboBoxViewerCellEditor(tableViewer.getTable(), SWT.READ_ONLY);
    ((ComboBoxViewerCellEditor) cellEditor).setContenProvider(new IStructuredContentProvider() {
        /**
         * @see org.eclipse.jface.viewers.IContentProvider#dispose()
         */
        public void dispose() {
        }

        /**
         * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
         */
        public Object[] getElements(Object inputElement) {
            return (Object[]) inputElement;
        }

        /**
         * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
         *      java.lang.Object, java.lang.Object)
         */
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
    });
    ((ComboBoxViewerCellEditor) cellEditor).setInput(UICoreConstant.UMLSECTION_CONSTANTS__DEFAULT_VALUES_BOOLEAN);

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:31,代码来源:OwnedParameterDialog.java

示例4: StateEditingSupport

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
private StateEditingSupport(ColumnViewer viewer) {
    super(viewer);
    cellEditor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl(), SWT.READ_ONLY);
    cellEditor.setLabelProvider(new LabelProvider());
    cellEditor.setContentProvider(new ArrayContentProvider());
    cellEditor.setInput(Commanding.QueueState.values());
}
 
开发者ID:yamcs,项目名称:yamcs-studio,代码行数:8,代码来源:CommandQueuesTableViewer.java

示例5: GenderEditingSupport

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
public GenderEditingSupport(ColumnViewer viewer) {
	super(viewer);
	cellEditor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl());
	cellEditor.setLabelProvider(new LabelProvider());
       cellEditor.setContentProvider(new ArrayContentProvider());
       cellEditor.setInput(Arrays.asList(Gender.FEMALE, Gender.MALE));
}
 
开发者ID:fipro78,项目名称:e4-cookbook-migration-guide,代码行数:8,代码来源:GenderEditingSupport.java

示例6: getCellEditor

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public CellEditor getCellEditor(Composite parent, ParameterFacet<T> facet) {
	EStructuralFeature feature = facet.getFeature();
	EClassifier type = feature.getEType();
	if (isCheckboxType(type)) {
		return new CheckboxNullCellEditor(parent);
	}
	EPlanElement element = facet.getElement();
	if (feature.isMany()) {
		return new MultiselectCellEditor(parent, element, feature);
	}
	if (type instanceof EEnumImpl) {
		return new EEnumComboBoxCellEditor(parent, (EEnumImpl) type);
	}
	if (feature instanceof EAttributeParameter) {
		EAttributeParameter def = (EAttributeParameter) feature;
		List<EChoice> choices = def.getChoices();
		if (DictionaryUtil.containsOnlyValues(choices)) {
			return new ChoicesCellEditor(parent, def, choices);
		}
	}
	if (feature instanceof EReference) {
		final EReference reference = (EReference) feature;
		ComboBoxViewerCellEditor comboBoxViewerCellEditor = new EReferenceCellEditor(parent, element, reference);
		return comboBoxViewerCellEditor;
	}
	IStringifier<Object> stringifier = null;
	if (feature instanceof EAttribute) {
		stringifier = ParameterStringifierUtils.getStringifier((EAttribute) feature);
	}
	if (stringifier == null) {
		return new CocoaCompatibleTextCellEditor(parent);
	}
	return new StringifierCellEditor(parent, stringifier);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:37,代码来源:ParameterColumn.java

示例7: TableEditingSupport

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
private TableEditingSupport(ColumnViewer viewer) {
    super(viewer);
    cellEditor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl(), SWT.READ_ONLY);
    cellEditor.setLabelProvider(new LabelProvider());
    cellEditor.setContentProvider(new ArrayContentProvider());    
    cellEditor.setInput(config.getAllLicenses());
    cellEditor.setActivationStyle(ComboBoxViewerCellEditor.DROP_DOWN_ON_KEY_ACTIVATION
            | ComboBoxViewerCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION
            | ComboBoxViewerCellEditor.DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION
            | ComboBoxViewerCellEditor.DROP_DOWN_ON_TRAVERSE_ACTIVATION);
    CASLicenseHandlerConfiguration.getInstance().getVariantToLicenseMap().clear();
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:13,代码来源:MappingDialog.java

示例8: CellEditorDropdown

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
public CellEditorDropdown(final Composite parent, TreeCell treeCell, final List<?> choices) {
	super(parent);
	
	this.choices = choices;
	
	this.setContentProvider(new ContentProvider());
	this.setLabelProvider(new LabelProvider());
       
       this.setActivationStyle(ComboBoxViewerCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION 
       		| ComboBoxViewerCellEditor.DROP_DOWN_ON_KEY_ACTIVATION
       		| ComboBoxViewerCellEditor.DROP_DOWN_ON_TRAVERSE_ACTIVATION);
       this.setInput(treeCell);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:14,代码来源:CellEditorDropdown.java

示例9: TestSuiteObligationEditingSupport

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
private TestSuiteObligationEditingSupport(ColumnViewer viewer) {
    super(viewer);
    cellEditor = new ComboBoxViewerCellEditor((Composite) getViewer().getControl(), SWT.READ_ONLY);
    cellEditor.setLabelProvider(new LabelProvider());
    cellEditor.setContenProvider(new ArrayContentProvider());
    cellEditor.setInput(Value.values());
}
 
开发者ID:smaccm,项目名称:smaccm,代码行数:8,代码来源:TestSuiteObligationEditingSupport.java

示例10: createTargetTable

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
private void createTargetTable(Composite container) {
	targetTableViewer = new TableViewer(container, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
	targetTable = targetTableViewer.getTable();
	GridData gd_table_1 = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2);
	gd_table_1.heightHint = 401;
	
	if(OSValidator.isMac()){
		gd_table_1.widthHint = 363;
	}else{
		gd_table_1.widthHint = 352;
	}
	targetTable.setLayoutData(gd_table_1);

	attachTargetTableListeners();

	targetTableViewer.setContentProvider(new SecondaryColumnKeysContentProvider());
	targetTableViewer.setLabelProvider(new SecondaryColumnKeysLabelProvider());
	targetTableViewer.setInput(propertyList);

	TableColumn targetTableColumnFieldName = new TableColumn(targetTable, SWT.LEFT);
	targetTableColumnFieldName.setText(COLUMNNAME); //$NON-NLS-1$
	TableColumn targetTableColumnSortOrder = new TableColumn(targetTable, SWT.LEFT_TO_RIGHT);
	targetTableColumnSortOrder.setText(SORTORDER); //$NON-NLS-1$

	for (int i = 0, n = targetTable.getColumnCount(); i < n; i++) {
		targetTable.getColumn(i).pack();
	}
	targetTableColumnFieldName.setWidth(175);
	
	if(OSValidator.isMac()){
		targetTableColumnSortOrder.setWidth(128);
	}else{
		targetTableColumnSortOrder.setWidth(116);
	}
	
	targetTable.setHeaderVisible(true);
	targetTable.setLinesVisible(true);

	// enables the tab functionality
	TableViewerEditor.create(targetTableViewer, new ColumnViewerEditorActivationStrategy(targetTableViewer),
			ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.TABBING_HORIZONTAL
					| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL);

	final CellEditor propertyNameeditor = new TextCellEditor(targetTable);

	ComboBoxViewerCellEditor propertyValueeditor = new ComboBoxViewerCellEditor(targetTable, SWT.READ_ONLY);
	propertyValueeditor.setContentProvider(new ArrayContentProvider());
	propertyValueeditor.setLabelProvider(new LabelProvider());
	propertyValueeditor.setInput(new String[] { Constants.ASCENDING_SORT_ORDER, Constants.DESCENDING_SORT_ORDER, Constants.NONE_SORT_ORDER });

	CellEditor[] editors = new CellEditor[] { propertyNameeditor, propertyValueeditor };

	propertyNameeditor.setValidator(createNameEditorValidator(Messages.EmptyColumnNotification));
	propertyValueeditor.setValidator(createValueEditorValidator(Messages.EmptySortOrderNotification));

	targetTableViewer.setColumnProperties(PROPS);
	targetTableViewer.setCellModifier(new SecondaryColumnKeysWidgetCellModifier(targetTableViewer));
	targetTableViewer.setCellEditors(editors);

	loadProperties(targetTableViewer);
	
	if (propertyList.size() != 0) {
		deleteButton.setEnabled(true);
	}
	if (propertyList.size() >= 2) {
		upButton.setEnabled(true);
		downButton.setEnabled(true);
	}

	dropTarget = new DropTarget(targetTable, DND.DROP_MOVE);
	dropTarget.setTransfer(new Transfer[] { TextTransfer.getInstance() });
	dropTarget.addDropListener(new DropTargetAdapter() {
		public void drop(DropTargetEvent event) {
			for (String fieldName : getformatedData((String) event.data))
					addNewProperty(targetTableViewer, fieldName);
			enableControlButtons();
		}
	});

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:81,代码来源:SecondaryColumnKeysDialog.java

示例11: createBooleanComboBox

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
/**
 * createBooleanComboBox
 *   void
 */
private void createBooleanComboBox() {
    cellEditor = new ComboBoxViewerCellEditor(tableViewer.getTable(), SWT.READ_ONLY);
    ((ComboBoxViewerCellEditor) cellEditor).setContenProvider(getContentProvider());
    ((ComboBoxViewerCellEditor) cellEditor).setInput(UICoreConstant.UMLSECTION_CONSTANTS__DEFAULT_VALUES_BOOLEAN);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:10,代码来源:ParameterSection.java

示例12: createDialogArea

import org.eclipse.jface.viewers.ComboBoxViewerCellEditor; //导入依赖的package包/类
/**
	 * Create contents of the dialog.
	 * @param parent
	 */
	@Override
	protected Control createDialogArea(Composite parent) {
		Composite composite = new Composite(parent, SWT.NONE);
	    composite.setLayout(new GridLayout(1, false));
	    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	    // Add a button to create the new person
	    Button newProperty = new Button(composite, SWT.PUSH);
	    newProperty.setText("Create New Property");

	    // Add the TableViewer
	    final TableViewer tv = new TableViewer(composite, SWT.FULL_SELECTION | SWT.BORDER);
	    tv.setContentProvider(new PropertiesContentProvider());
	    tv.setLabelProvider(new PropertiesLabelProvider());
	    tv.setInput(properties);

	    // Set up the table
	    Table table = tv.getTable();
	    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	    TableColumn kc = new TableColumn(table, SWT.CENTER);
	    kc.setText(KEY);
	    kc.setWidth( 150);
	    TableColumn kv = new TableColumn(table, SWT.CENTER);
	    kv.setText(VALUE);
	    kv.setWidth(250);
//
//	    for (int i = 0, n = table.getColumnCount(); i < n; i++) {
//	      table.getColumn(i).pack();
//	    }

	    table.setHeaderVisible(true);
	    table.setLinesVisible(true);

	    // Add a new person when the user clicks button
	    newProperty.addSelectionListener(new SelectionAdapter() {
	      public void widgetSelected(SelectionEvent event) {
	        List<String> prop = new ArrayList<String>(2);
	        prop.add("key");
	        prop.add("value");
	        properties.add(prop);
	        tv.refresh();
	      }
	    });

	    // Create the cell editors
	    CellEditor[] editors = new CellEditor[2];
	    ComboBoxViewerCellEditor comboEditor = new ComboBoxViewerCellEditor(table);
	    comboEditor.setContentProvider(new ArrayContentProvider());
	    comboEditor.setLabelProvider(new LabelProvider ());
	    comboEditor.setInput(PROPERTY_PROPOSALS);

	    editors[0] = comboEditor;
	    editors[1] = new TextCellEditor(table);
	    

	    // Set the editors, cell modifier, and column properties
	    tv.setColumnProperties(PROPS);
	    tv.setCellModifier(new PropertyCellModifier(tv));
	    tv.setCellEditors(editors);

	    tv.refresh();
	    return composite;

	}
 
开发者ID:cplutte,项目名称:bts,代码行数:69,代码来源:EditPropertiesDialog.java


注:本文中的org.eclipse.jface.viewers.ComboBoxViewerCellEditor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。