public Constraints clone() { if (myAnchor != null) { return new Constraints(myAnchor, relativeId); } else if (direction != null) { return new Constraints(direction, relativeId); } return null; } }
/** {@inheritDoc} */ @Override public void actionPerformed(ActionEvent event) { final String tabId = getEditorTab(event).getId(); final VirtualFile file = getEditorFile(event); final Constraints constraints = new Constraints(HORIZONTALLY, tabId); editorAgent.openEditor(file, constraints); } }
/** {@inheritDoc} */ @Override public void actionPerformed(ActionEvent event) { final String tabId = getEditorTab(event).getId(); final VirtualFile file = getEditorFile(event); final Constraints constraints = new Constraints(VERTICALLY, tabId); editorAgent.openEditor(file, constraints); } }
private List<Promise<Void>> restoreSplit( JsonObject files, EditorPartStack editorPartStack, Map<EditorPartPresenter, EditorPartStack> activeEditors) { JsonObject splitFirst = files.getObject("SPLIT_FIRST"); String direction = files.getString("DIRECTION"); double size = files.getNumber("SIZE"); EditorPartStack split = editorMultiPartStack.split( editorPartStack, new Constraints(Direction.valueOf(direction), null), size); List<Promise<Void>> restoreFirst = restore(splitFirst, editorPartStack, activeEditors); JsonObject splitSecond = files.getObject("SPLIT_SECOND"); List<Promise<Void>> restoreSecond = restore(splitSecond, split, activeEditors); List<Promise<Void>> result = new ArrayList<>(); result.addAll(restoreFirst); result.addAll(restoreSecond); return result; }
private void init() { commandActionsPopUpGroup = new DefaultActionGroup(messages.actionCommandsTitle(), true, actionManager); actionManager.registerAction("commandActionsPopUpGroup", commandActionsPopUpGroup); commandActionsPopUpGroup .getTemplatePresentation() .setImageElement(new SVGImage(resources.compile()).getElement()); commandActionsPopUpGroup .getTemplatePresentation() .setDescription(messages.actionCommandsDescription()); DefaultActionGroup mainContextMenu = (DefaultActionGroup) actionManager.getAction(GROUP_MAIN_CONTEXT_MENU); mainContextMenu.add(commandActionsPopUpGroup); DefaultActionGroup editorTabContextMenu = (DefaultActionGroup) actionManager.getAction(GROUP_EDITOR_TAB_CONTEXT_MENU); editorTabContextMenu.add(commandActionsPopUpGroup); // add 'Commands' pop-up group to the main toolbar DefaultActionGroup commandActionsToolbarGroup = new CommandActionsToolbarGroup(actionManager); commandActionsToolbarGroup.add(commandActionsPopUpGroup); DefaultActionGroup mainToolbarGroup = (DefaultActionGroup) actionManager.getAction(GROUP_MAIN_TOOLBAR); mainToolbarGroup.add(commandActionsToolbarGroup, new Constraints(AFTER, "changeResourceGroup")); commandProducers.forEach(this::createActionsForProducer); }
newGroup.addAction(newFolderAction, new Constraints(AFTER, NEW_FILE)); toolWindowsGroup.add(projectExplorerDisplayingModeAction, FIRST); toolWindowsGroup.add( eventLogsDisplayingModeAction, new Constraints(AFTER, PROJECT_EXPLORER_DISPLAYING_MODE)); toolWindowsGroup.add( findResultDisplayingModeAction, new Constraints(AFTER, EVENT_LOGS_DISPLAYING_MODE)); toolWindowsGroup.add( commandsExplorerDisplayingModeAction, new Constraints(AFTER, FIND_RESULT_DISPLAYING_MODE)); toolWindowsGroup.add(editorDisplayingModeAction); toolWindowsGroup.add(terminalDisplayingModeAction);