Search in sources :

Example 96 with CellEditor

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

the class NoteDirectEditPolicy method getDirectEditCommand.

@Override
protected Command getDirectEditCommand(DirectEditRequest request) {
    CellEditor cellEditor = request.getCellEditor();
    String newNote = (String) cellEditor.getValue();
    return new NoteSetTextCommand((NotePart) getHost(), newNote);
}
Also used : NoteSetTextCommand(org.jkiss.dbeaver.erd.ui.command.NoteSetTextCommand) CellEditor(org.eclipse.jface.viewers.CellEditor)

Example 97 with CellEditor

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

the class AttributeDirectEditPolicy method revertOldEditValue.

@Override
protected void revertOldEditValue(DirectEditRequest request) {
    CellEditor cellEditor = request.getCellEditor();
    cellEditor.setValue(oldValue);
    AttributePart attributePart = (AttributePart) getHost();
    attributePart.revertNameChange(oldValue);
}
Also used : AttributePart(org.jkiss.dbeaver.erd.ui.part.AttributePart) CellEditor(org.eclipse.jface.viewers.CellEditor)

Example 98 with CellEditor

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

the class AttributeDirectEditPolicy 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 99 with CellEditor

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

the class EntityDirectEditPolicy method revertOldEditValue.

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

Example 100 with CellEditor

use of org.eclipse.jface.viewers.CellEditor in project Palladio-Editors-Sirius by PalladioSimulator.

the class InfrastructureSignaturesEditorSection method createViewerCellEditors.

/* (non-Javadoc)
	 * @see org.palladiosimulator.editors.commons.tabs.generic.EditorSection#createViewerCellEditors(org.eclipse.swt.widgets.Table)
	 */
@Override
protected CellEditor[] createViewerCellEditors(Table table) {
    CellEditor[] editors = new CellEditor[columnNames.length];
    editors[SIGNATURENAME_COLUMN_INDEX] = new TextCellEditor(table);
    // create 'DeleteCellValueListener' and as SelectionListener to the 'TableVewer'
    InfrastructureSignatureDeleteCellValueListener cellValueListener = new InfrastructureSignatureDeleteCellValueListener(viewer);
    viewer.addSelectionChangedListener(cellValueListener);
    editors[PARAMETER_COLUMN_INDEX] = new DialogCellEditor(table) {

        @Override
        protected Object openDialogBox(Control cellEditorWindow) {
            ParametersDialog dialog = new ParametersDialog(cellEditorWindow.getShell(), getSelectedSignature());
            if (dialog.open() == Dialog.OK)
                viewer.refresh();
            return null;
        }
    };
    return editors;
}
Also used : Control(org.eclipse.swt.widgets.Control) InfrastructureSignatureDeleteCellValueListener(org.palladiosimulator.editors.commons.tabs.operations.InfrastructureSignatureDeleteCellValueListener) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) CellEditor(org.eclipse.jface.viewers.CellEditor) DialogCellEditor(org.eclipse.jface.viewers.DialogCellEditor) DialogCellEditor(org.eclipse.jface.viewers.DialogCellEditor) EObject(org.eclipse.emf.ecore.EObject) ParametersDialog(org.palladiosimulator.editors.commons.dialogs.parameters.ParametersDialog) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor)

Aggregations

CellEditor (org.eclipse.jface.viewers.CellEditor)198 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)126 TableViewer (org.eclipse.jface.viewers.TableViewer)56 ComboBoxCellEditor (org.eclipse.jface.viewers.ComboBoxCellEditor)55 GridData (org.eclipse.swt.layout.GridData)49 Composite (org.eclipse.swt.widgets.Composite)45 ICellModifier (org.eclipse.jface.viewers.ICellModifier)41 SelectionEvent (org.eclipse.swt.events.SelectionEvent)34 GridLayout (org.eclipse.swt.layout.GridLayout)34 TableColumn (org.eclipse.swt.widgets.TableColumn)30 Button (org.eclipse.swt.widgets.Button)29 Table (org.eclipse.swt.widgets.Table)28 Label (org.eclipse.swt.widgets.Label)27 ArrayList (java.util.ArrayList)26 CheckboxCellEditor (org.eclipse.jface.viewers.CheckboxCellEditor)26 Text (org.eclipse.swt.widgets.Text)26 TableViewerColumn (org.eclipse.jface.viewers.TableViewerColumn)23 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)22 TableItem (org.eclipse.swt.widgets.TableItem)22 Map (java.util.Map)21