/** * @see org.eclipse.gef.ui.parts.GraphicalEditor#createActions() */ @SuppressWarnings("unchecked") @Override protected void createActions() { super.createActions(); ActionRegistry registry = getActionRegistry(); IAction action = new AddInteractionOperandAction(this); registry.registerAction(action); getSelectionActions().add(action.getId()); action = new AddCoveredLifelineAction(this); registry.registerAction(action); getSelectionActions().add(action.getId()); action = new RemoveCoveredLifelineAction(this); registry.registerAction(action); getSelectionActions().add(action.getId()); // 기존에 등록된 'Delete(다이어그램에서 삭제)' 액션을 빼고, // delete를 키로 DeleteUMLElementAction를 등록한다. IAction deleteAction = new DeleteAction((IWorkbenchPart) this); registry.removeAction(deleteAction); getSelectionActions().remove(deleteAction.getId()); action = new DeleteSequenceUMLElementAction(this, false); registry.removeAction(action); getSelectionActions().remove(action.getId()); action.setId(deleteAction.getId()); registry.registerAction(action); getSelectionActions().add(deleteAction.getId()); }
private void registerStaticActions() { final ProductSystemGraphEditor editor = model.editor; actionRegistry.registerAction(ActionFactory.buildSupplyChainMenu(editor)); actionRegistry.registerAction(ActionFactory.removeSupplyChain(editor)); actionRegistry.registerAction(ActionFactory.removeAllConnections(editor)); actionRegistry.registerAction(ActionFactory.mark(editor)); actionRegistry.registerAction(ActionFactory.unmark(editor)); actionRegistry.registerAction(ActionFactory.saveImage(editor)); actionRegistry.registerAction(ActionFactory.expandAll(editor)); actionRegistry.registerAction(ActionFactory.collapseAll(editor)); actionRegistry.registerAction(ActionFactory.maximizeAll(editor)); actionRegistry.registerAction(ActionFactory.minimizeAll(editor)); actionRegistry.registerAction(ActionFactory.layoutMenu(editor)); actionRegistry.registerAction(ActionFactory.searchProviders(editor)); actionRegistry.registerAction(ActionFactory.searchRecipients(editor)); actionRegistry.registerAction(ActionFactory.open(editor)); actionRegistry.registerAction(ActionFactory.openMiniatureView(editor)); actionRegistry.registerAction(ActionFactory.showOutline()); actionRegistry.registerAction(new ZoomInAction(getZoomManager())); actionRegistry.registerAction(new ZoomOutAction(getZoomManager())); DeleteAction delAction = new DeleteAction((IWorkbenchPart) editor) { @Override protected ISelection getSelection() { return editor.getSite().getWorkbenchWindow().getSelectionService().getSelection(); } }; actionRegistry.registerAction(delAction); }