本文整理汇总了Java中org.eclipse.jface.viewers.ICellModifier类的典型用法代码示例。如果您正苦于以下问题:Java ICellModifier类的具体用法?Java ICellModifier怎么用?Java ICellModifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICellModifier类属于org.eclipse.jface.viewers包,在下文中一共展示了ICellModifier类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupCellEditors
import org.eclipse.jface.viewers.ICellModifier; //导入依赖的package包/类
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});
}
示例2: setupCellEditors
import org.eclipse.jface.viewers.ICellModifier; //导入依赖的package包/类
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});
}
示例3: getCellEditorImage
import org.eclipse.jface.viewers.ICellModifier; //导入依赖的package包/类
/**
* To be used by LabelProviders that whant to display a checked/unchecked icon for the CheckboxCellEditor that does
* not have a Control.
*
* @param cellModifier
* The ICellModifier for the CellEditor to provide the value
* @param element
* The current element
* @param property
* The property the cellModifier should return the value from
*/
public Image getCellEditorImage(ICellModifier cellModifier, Object element, String property) {
Boolean value = (Boolean) cellModifier.getValue(element, property);
return getCellEditorImage(value);
}
示例4: getCellModifier
import org.eclipse.jface.viewers.ICellModifier; //导入依赖的package包/类
protected abstract ICellModifier getCellModifier();