Search in sources :

Example 1 with InplaceEditingLayer

use of com.intellij.uiDesigner.designSurface.InplaceEditingLayer in project intellij-community by JetBrains.

the class AbstractGuiEditorAction method actionPerformed.

public final void actionPerformed(final AnActionEvent e) {
    final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());
    if (editor != null) {
        final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(editor);
        if (myModifying) {
            if (!editor.ensureEditable())
                return;
        }
        InplaceEditingLayer editingLayer = editor.getInplaceEditingLayer();
        if (editingLayer.isEditing()) {
            editingLayer.finishInplaceEditing();
        }
        Runnable runnable = () -> {
            actionPerformed(editor, selection, e);
            if (myModifying) {
                editor.refreshAndSave(true);
            }
        };
        if (getCommandName() != null) {
            CommandProcessor.getInstance().executeCommand(editor.getProject(), runnable, getCommandName(), null);
        } else {
            runnable.run();
        }
    }
}
Also used : InplaceEditingLayer(com.intellij.uiDesigner.designSurface.InplaceEditingLayer) RadComponent(com.intellij.uiDesigner.radComponents.RadComponent) GuiEditor(com.intellij.uiDesigner.designSurface.GuiEditor)

Aggregations

GuiEditor (com.intellij.uiDesigner.designSurface.GuiEditor)1 InplaceEditingLayer (com.intellij.uiDesigner.designSurface.InplaceEditingLayer)1 RadComponent (com.intellij.uiDesigner.radComponents.RadComponent)1