use of com.intellij.designer.designSurface.EditableArea in project intellij-community by JetBrains.
the class CommonEditActionsProvider method deleteElement.
@Override
public void deleteElement(@NotNull final DataContext dataContext) {
myDesigner.getToolProvider().execute(() -> {
EditableArea area = getArea(dataContext);
List<RadComponent> selection = area.getSelection();
if (selection.isEmpty()) {
return;
}
myDesigner.getToolProvider().loadDefaultTool();
List<RadComponent> components = RadComponent.getPureSelection(selection);
updateSelectionBeforeDelete(area, components.get(0), selection);
handleDeletion(components);
}, DesignerBundle.message("command.delete.selection"), true);
}
use of com.intellij.designer.designSurface.EditableArea in project intellij-community by JetBrains.
the class DesignerActionPanel method createSelectActionGroup.
@NotNull
private ActionGroup createSelectActionGroup(DesignerEditorPanel designer) {
final DefaultActionGroup group = new DefaultActionGroup("_Select", true);
AnAction selectParent = new AnAction("Select Parent", "Select Parent", null) {
@Override
public void actionPerformed(AnActionEvent e) {
myDesigner.getToolProvider().processKeyEvent(new KeyEvent(myDesigner.getSurfaceArea().getNativeComponent(), KeyEvent.KEY_PRESSED, 0, 0, KeyEvent.VK_ESCAPE, (char) KeyEvent.VK_ESCAPE), myDesigner.getSurfaceArea());
}
};
selectParent.registerCustomShortcutSet(KeyEvent.VK_ESCAPE, 0, null);
EditableArea area = designer.getSurfaceArea();
AnAction selectSiblings = new SelectSiblingsAction(area);
AnAction selectSameType = new SelectSameTypeAction(area);
AnAction deselectAllAction = new DeselectAllAction(area);
AnAction selectAllAction = createSelectAllAction(area);
registerAction(selectAllAction, "$SelectAll");
group.add(selectParent);
group.add(selectSiblings);
group.add(selectSameType);
group.addSeparator();
group.add(selectAllAction);
group.add(deselectAllAction);
return group;
}
Aggregations