org.eclipse.jface.viewers.ICellModifier Java Examples

The following examples show how to use org.eclipse.jface.viewers.ICellModifier. 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: PullUpMemberPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void setupCellEditors(final Table table) {
	final ComboBoxCellEditor editor= new ComboBoxCellEditor();
	editor.setStyle(SWT.READ_ONLY);
	fTableViewer.setCellEditors(new CellEditor[] { null, editor});
	fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {

		public void selectionChanged(final SelectionChangedEvent event) {
			if (editor.getControl() == null & !table.isDisposed())
				editor.create(table);
			final ISelection sel= event.getSelection();
			if (!(sel instanceof IStructuredSelection))
				return;
			final IStructuredSelection structured= (IStructuredSelection) sel;
			if (structured.size() != 1)
				return;
			final MemberActionInfo info= (MemberActionInfo) structured.getFirstElement();
			editor.setItems(info.getAllowedLabels());
			editor.setValue(new Integer(info.getAction()));
		}
	});

	final ICellModifier cellModifier= new MemberActionCellModifier();
	fTableViewer.setCellModifier(cellModifier);
	fTableViewer.setColumnProperties(new String[] { MEMBER_PROPERTY, ACTION_PROPERTY});
}
 
Example #2
Source File: PushDownWizard.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void setupCellEditors(final Table table) {
	final ComboBoxCellEditor comboBoxCellEditor= new ComboBoxCellEditor();
	comboBoxCellEditor.setStyle(SWT.READ_ONLY);
	fTableViewer.setCellEditors(new CellEditor[] { null, comboBoxCellEditor});
	fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {

		public void selectionChanged(final SelectionChangedEvent event) {
			if (comboBoxCellEditor.getControl() == null & !table.isDisposed())
				comboBoxCellEditor.create(table);
			Assert.isTrue(event.getSelection() instanceof IStructuredSelection);
			final IStructuredSelection ss= (IStructuredSelection) event.getSelection();
			if (ss.size() != 1)
				return;
			final MemberActionInfo mac= (MemberActionInfo) ss.getFirstElement();
			comboBoxCellEditor.setItems(MemberActionInfoLabelProvider.getAvailableActionLabels(mac));
			comboBoxCellEditor.setValue(new Integer(mac.getAction()));
		}
	});

	final ICellModifier cellModifier= new PushDownCellModifier();
	fTableViewer.setCellModifier(cellModifier);
	fTableViewer.setColumnProperties(new String[] { MEMBER_PROPERTY, ACTION_PROPERTY});
}
 
Example #3
Source File: CContainerViewer.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * not yet implemented
 * <p>post a feature request if you need it enabled</p>
 */
public ICellModifier getCellModifier() {
	// TODO Auto-generated method stub
	return null;
}
 
Example #4
Source File: CContainerViewer.java    From nebula with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * not yet implemented
 * <p>post a feature request if you need it enabled</p>
 */
public void setCellModifier(ICellModifier modifier) {
	// TODO Auto-generated method stub
}
 
Example #5
Source File: AbstractConversionTable.java    From sarl with Apache License 2.0 2 votes vote down vote up
/** Replies the cell modifier for all the columns.
 *
 * @return the cell modifier, or {@code null}.
 */
protected ICellModifier createCellModifier() {
	return new CellModifier(this, SOURCE_COLUMN_PROPERTY, TARGET_COLUMN_PROPERTY);
}