Example usage for org.eclipse.jface.viewers CellEditor CellEditor

List of usage examples for org.eclipse.jface.viewers CellEditor CellEditor

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers CellEditor CellEditor.

Prototype

protected CellEditor(Composite parent) 

Source Link

Document

Creates a new cell editor under the given parent control.

Usage

From source file:com.rcpcompany.uibindings.scripting.internal.bindings.FeatureScriptCellEditorFactory.java

License:Open Source License

@Override
public CellEditor create(ICellEditorFactoryContext context) {
    final Composite parent = context.getParent();
    final IValueBindingCell cell = context.getCell();
    final IValueBinding vb = cell.getLabelBinding();

    final CellEditor ce = new CellEditor(parent) {
        private FeatureScriptDialog myDialog;

        @Override/*  w w w .  j a  v  a  2s.c o m*/
        protected Control createControl(Composite parent) {
            final Shell shell = parent.getShell();
            if (!(vb.getModelObject() instanceof IMOAO)) {
                return null;
            }

            myDialog = new FeatureScriptDialog(shell, vb);

            return myDialog.getShell();
        }

        @Override
        public void activate() {
            super.activate();
            myDialog.open();

            deactivate();
        }

        @Override
        protected Object doGetValue() {
            return null;
        }

        @Override
        protected void doSetFocus() {
        }

        @Override
        protected void doSetValue(Object value) {
        }
    };

    return ce;
}