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

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

Introduction

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

Prototype

public void addPropertyChangeListener(IPropertyChangeListener listener) 

Source Link

Document

Adds a property change listener to this cell editor.

Usage

From source file:gov.nasa.ensemble.common.ui.editor.CellEditorActionHandler.java

License:Open Source License

/**
 * Adds a <code>CellEditor</code> to the handler so that the
 * Cut, Copy, Paste, Delete, Select All, Find, Undo, and Redo
 * actions are redirected to it when active.
 *
 * @param editor the <code>CellEditor</code>
 *//*from www  .j a v  a  2s .c  o m*/
public void addCellEditor(CellEditor editor) {
    if (editor == null) {
        return;
    }

    Control control = editor.getControl();
    if (control != null) {
        controlToEditor.put(control, editor);
        control.addListener(SWT.Activate, controlListener);
        control.addListener(SWT.Dispose, controlListener);
        control.addListener(SWT.Deactivate, controlListener);

        if (control.isFocusControl()) {
            activeEditor = editor;
            editor.addPropertyChangeListener(cellListener);
            updateActionsEnableState();
        }
    }
}

From source file:org.eclipse.ui.part.CellEditorActionHandler.java

License:Open Source License

/**
 * Adds a <code>CellEditor</code> to the handler so that the
 * Cut, Copy, Paste, Delete, Select All, Find, Undo, and Redo
 * actions are redirected to it when active.
 *
 * @param editor the <code>CellEditor</code>
 *//* w  w w .  j a  v a2  s .  co  m*/
public void addCellEditor(CellEditor editor) {
    if (editor == null) {
        return;
    }

    Control control = editor.getControl();
    Assert.isNotNull(control);
    controlToEditor.put(control, editor);
    control.addListener(SWT.Activate, controlListener);
    control.addListener(SWT.Deactivate, controlListener);

    if (control.isFocusControl()) {
        activeEditor = editor;
        editor.addPropertyChangeListener(cellListener);
        updateActionsEnableState();
    }
}

From source file:org.neuro4j.studio.properties.descriptor.NodeNamePropertyDescriptor.java

License:Apache License

public CellEditor createPropertyEditor(Composite parent) {
    CellEditor editor = new ComboBoxCellEditor(parent, getAllowedRelationNames());
    if (getValidator() != null)
        editor.setValidator(getValidator());
    editor.addPropertyChangeListener(new IPropertyChangeListener() {

        @Override/*from w ww.  j  a  v  a  2  s.  co  m*/
        public void propertyChange(PropertyChangeEvent event) {
            node.setName(event.getNewValue().toString());
        }
    });
    return editor;
}