Java 类org.eclipse.gef.ui.actions.DirectEditAction 实例源码

项目:gw4e.project    文件:GW4EEditor.java   
protected void createActions() {
    super.createActions();
    ActionRegistry registry = getActionRegistry();

    IAction action = new DirectEditAction((IWorkbenchPart) this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());

    action = new CopyNodeAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());

    action = new PasteNodeAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());

    action = new ClearEdgeBendpointLayoutAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());


}
项目:erflute    文件:MainDiagramEditor.java   
@Override
@SuppressWarnings("unchecked")
protected void createActions() {
    super.createActions();
    final ActionRegistry registry = getActionRegistry();
    final List<String> selectionActionList = getSelectionActions();
    final List<IAction> actionList = new ArrayList<>(Arrays.asList(new IAction[] { new ChangeViewToLogicalAction(this),
            new ChangeViewToPhysicalAction(this), new ChangeViewToBothAction(this), new ChangeToIENotationAction(this),
            new ChangeToIDEF1XNotationAction(this), new ChangeNotationLevelToColumnAction(this),
            new ChangeNotationLevelToExcludeTypeAction(this), new ChangeNotationLevelToDetailAction(this),
            new ChangeNotationLevelToOnlyTitleAction(this), new ChangeNotationLevelToOnlyKeyAction(this),
            new ChangeNotationLevelToNameAndKeyAction(this), new ChangeNotationExpandGroupAction(this),
            new ChangeDesignToFunnyAction(this), new ChangeDesignToFrameAction(this), new ChangeDesignToSimpleAction(this),
            new ChangeCapitalAction(this), new ChangeStampAction(this), new ColumnGroupManageAction(this),
            /* #deleted new ChangeTrackingAction(this), */new OptionSettingAction(this),
            /* #deleted new CategoryManageAction(this), */new ChangeFreeLayoutAction(this),
            new ChangeShowReferredTablesAction(this), /* #deleted new TranslationManageAction(this), */
            /* #deleted new TestDataCreateAction(this), */new ImportFromDBAction(this), new ImportFromFileAction(this),
            new ExportToImageAction(this), /* #deleted new ExportToExcelAction(this), */
            /* #deleted new ExportToHtmlAction(this), new ExportToJavaAction(this), */new ExportToDDLAction(this),
            /* #deleted new ExportToDictionaryAction(this), new ExportToTranslationDictionaryAction(this), */
            /* #deleted new ExportToTestDataAction(this), */new PageSettingAction(this),
            /* #deleted new EditAllAttributesAction(this), */
            new DirectEditAction((IWorkbenchPart) this), new ERDiagramAlignmentAction(this, PositionConstants.LEFT),
            new ERDiagramAlignmentAction(this, PositionConstants.CENTER), new ERDiagramAlignmentAction(this, PositionConstants.RIGHT),
            new ERDiagramAlignmentAction(this, PositionConstants.TOP), new ERDiagramAlignmentAction(this, PositionConstants.MIDDLE),
            new ERDiagramAlignmentAction(this, PositionConstants.BOTTOM), new ERDiagramMatchWidthAction(this),
            new ERDiagramMatchHeightAction(this), new HorizontalLineAction(this), new VerticalLineAction(this),
            new RightAngleLineAction(this), new DefaultLineAction(this), new CopyAction(this), new PasteAction(this),
            new SearchAction(this), new ResizeModelAction(this), new PrintImageAction(this), new DeleteWithoutUpdateAction(this),
            new SelectAllContentsAction(this), new VirtualDiagramAddAction(this), new ERDiagramQuickOutlineAction(this), }));
    Activator.debug(this, "createActions()", "...Preparing diagram actions: " + actionList.size());
    actionList.addAll(extensionLoader.createExtendedActions());
    for (final IAction action : actionList) {
        if (action instanceof SelectionAction) {
            final IAction originalAction = registry.getAction(action.getId());
            if (originalAction != null) {
                selectionActionList.remove(originalAction);
            }
            selectionActionList.add(action.getId());
        }
        registry.registerAction(action);
    }
    addKeyHandler(registry.getAction(SearchAction.ID));
    addKeyHandler(registry.getAction(ERDiagramQuickOutlineAction.ID));
}