Search in sources :

Example 26 with CellEditor

use of org.eclipse.jface.viewers.CellEditor in project cubrid-manager by CUBRID.

the class TableDirectEditPolicy method revertOldEditValue.

@Override
protected void revertOldEditValue(DirectEditRequest request) {
    CellEditor cellEditor = request.getCellEditor();
    cellEditor.setValue(oldValue);
    TablePart tablePart = (TablePart) getHost();
    tablePart.revertNameChange();
}
Also used : CellEditor(org.eclipse.jface.viewers.CellEditor) TablePart(com.cubrid.common.ui.er.part.TablePart)

Example 27 with CellEditor

use of org.eclipse.jface.viewers.CellEditor in project dbeaver by serge-rider.

the class NoteDirectEditPolicy method storeOldEditValue.

@Override
protected void storeOldEditValue(DirectEditRequest request) {
    CellEditor cellEditor = request.getCellEditor();
    oldValue = (String) cellEditor.getValue();
}
Also used : CellEditor(org.eclipse.jface.viewers.CellEditor)

Example 28 with CellEditor

use of org.eclipse.jface.viewers.CellEditor in project dbeaver by serge-rider.

the class UIUtils method createPropertyEditor.

public static CellEditor createPropertyEditor(final IServiceLocator serviceLocator, Composite parent, DBPPropertySource source, DBPPropertyDescriptor property) {
    if (source == null) {
        return null;
    }
    final Object object = source.getEditableValue();
    if (!property.isEditable(object)) {
        return null;
    }
    CellEditor cellEditor = UIUtils.createCellEditor(parent, object, property);
    if (cellEditor != null) {
        final Control editorControl = cellEditor.getControl();
        UIUtils.addFocusTracker(serviceLocator, UIUtils.INLINE_WIDGET_EDITOR_ID, editorControl);
        editorControl.addDisposeListener(new DisposeListener() {

            @Override
            public void widgetDisposed(DisposeEvent e) {
                UIUtils.removeFocusTracker(serviceLocator, editorControl);
            }
        });
    }
    return cellEditor;
}
Also used : CellEditor(org.eclipse.jface.viewers.CellEditor)

Example 29 with CellEditor

use of org.eclipse.jface.viewers.CellEditor in project dbeaver by serge-rider.

the class ColumnDirectEditPolicy method storeOldEditValue.

/**
	 * @param to
	 *            Revert request
	 */
@Override
protected void storeOldEditValue(DirectEditRequest request) {
    CellEditor cellEditor = request.getCellEditor();
    oldValue = (String) cellEditor.getValue();
}
Also used : CellEditor(org.eclipse.jface.viewers.CellEditor)

Example 30 with CellEditor

use of org.eclipse.jface.viewers.CellEditor in project dbeaver by serge-rider.

the class NoteDirectEditPolicy method revertOldEditValue.

/**
	 * @param request
	 */
@Override
protected void revertOldEditValue(DirectEditRequest request) {
    CellEditor cellEditor = request.getCellEditor();
    cellEditor.setValue(oldValue);
    NotePart entityPart = (NotePart) getHost();
    entityPart.revertNameChange();
}
Also used : NotePart(org.jkiss.dbeaver.ext.erd.part.NotePart) CellEditor(org.eclipse.jface.viewers.CellEditor)

Aggregations

CellEditor (org.eclipse.jface.viewers.CellEditor)142 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)88 TableViewer (org.eclipse.jface.viewers.TableViewer)45 GridData (org.eclipse.swt.layout.GridData)44 Composite (org.eclipse.swt.widgets.Composite)37 ComboBoxCellEditor (org.eclipse.jface.viewers.ComboBoxCellEditor)35 ICellModifier (org.eclipse.jface.viewers.ICellModifier)32 GridLayout (org.eclipse.swt.layout.GridLayout)30 SelectionEvent (org.eclipse.swt.events.SelectionEvent)29 TableColumn (org.eclipse.swt.widgets.TableColumn)29 CheckboxCellEditor (org.eclipse.jface.viewers.CheckboxCellEditor)25 Table (org.eclipse.swt.widgets.Table)24 Button (org.eclipse.swt.widgets.Button)23 ArrayList (java.util.ArrayList)21 Label (org.eclipse.swt.widgets.Label)21 TableViewerColumn (org.eclipse.jface.viewers.TableViewerColumn)20 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)20 Text (org.eclipse.swt.widgets.Text)19 Map (java.util.Map)18 EditingSupport (org.eclipse.jface.viewers.EditingSupport)18