Java 类org.eclipse.jface.viewers.ICellModifier 实例源码

项目:Eclipse-Postfix-Code-Completion    文件:PullUpMemberPage.java   
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});
}
项目:Eclipse-Postfix-Code-Completion    文件:PushDownWizard.java   
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});
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PullUpMemberPage.java   
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});
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PushDownWizard.java   
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});
}
项目:PDFReporter-Studio    文件:CheckBoxLabelProvider.java   
/**
 * 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);
}
项目:Hydrograph    文件:ELTSchemaGridWidget.java   
protected abstract ICellModifier getCellModifier();