org.eclipse.gef.ui.actions.SelectionAction Java Examples

The following examples show how to use org.eclipse.gef.ui.actions.SelectionAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainDiagramEditor.java    From erflute with Apache License 2.0 4 votes vote down vote up
@Override
@SuppressWarnings({ "unchecked", "unlikely-arg-type" })
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); // unlikely-arg-type
            }
            selectionActionList.add(action.getId());
        }
        registry.registerAction(action);
    }
    addKeyHandler(registry.getAction(SearchAction.ID));
    addKeyHandler(registry.getAction(ERDiagramQuickOutlineAction.ID));
}
 
Example #2
Source File: GraphicalEditorWithFlyoutPalette.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
protected void removeEditPartAction( SelectionAction action )
{
	getActionRegistry( ).removeAction( action );
	editPartActionIDs.remove( action.getId( ) );
}
 
Example #3
Source File: ERDiagramEditor.java    From ermaster-b with Apache License 2.0 4 votes vote down vote up
/**
	 * {@inheritDoc}
	 */
	@Override
	@SuppressWarnings("unchecked")
	protected void createActions() {
		super.createActions();

		ActionRegistry registry = this.getActionRegistry();
		List<String> selectionActionList = this.getSelectionActions();

		List<IAction> actionList = new ArrayList<IAction>(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 ChangeTitleFontSizeAction(this),
						new ChangeStampAction(this),
						new GroupManageAction(this),
						new ChangeTrackingAction(this),
						new OptionSettingAction(this),
						new CategoryManageAction(this),
						new ChangeFreeLayoutAction(this),
						new ChangeShowReferredTablesAction(this),
						new TranslationManageAction(this),
						new TestDataCreateAction(this),
						new ImportFromDBAction(this),
						new ImportFromFileAction(this),
						new ExportToImageAction(this),
						new ExportToExcelAction(this),
						new ExportToHtmlAction(this),
						new ExportToJavaAction(this),
						new ExportToDDLAction(this),
						new ExportToDictionaryAction(this),
						new ExportToTranslationDictionaryAction(this),
						new ExportToTestDataAction(this),
						new PageSettingAction(this),
						new EditAllAttributesAction(this),
						new DirectEditAction((IWorkbenchPart) this),
						new ERDiagramAlignmentAction((IWorkbenchPart) this,
								PositionConstants.LEFT),
						new ERDiagramAlignmentAction((IWorkbenchPart) this,
								PositionConstants.CENTER),
						new ERDiagramAlignmentAction((IWorkbenchPart) this,
								PositionConstants.RIGHT),
						new ERDiagramAlignmentAction((IWorkbenchPart) this,
								PositionConstants.TOP),
						new ERDiagramAlignmentAction((IWorkbenchPart) this,
								PositionConstants.MIDDLE),
						new ERDiagramAlignmentAction((IWorkbenchPart) 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 ERModelAddAction(this),
						new ERModelQuickOutlineAction(this),
//						new ChangeNameAction(this),
						}));

		actionList.addAll(this.extensionLoader.createExtendedActions());

		for (IAction action : actionList) {
			if (action instanceof SelectionAction) {
				IAction originalAction = registry.getAction(action.getId());

				if (originalAction != null) {
					selectionActionList.remove(originalAction);
				}
				selectionActionList.add(action.getId());
			}

			registry.registerAction(action);

		}

		this.addKeyHandler(registry.getAction(SearchAction.ID));
		this.addKeyHandler(registry.getAction(ERModelQuickOutlineAction.ID));
	}
 
Example #4
Source File: GraphicalEditorWithFlyoutPalette.java    From birt with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Adds an <code>EditPart</code> action to this editor.
 * 
 * <p>
 * <code>EditPart</code> actions are actions that depend and work on the
 * selected <code>EditPart</code>s.
 * 
 * @param action
 *            the <code>EditPart</code> action
 */
protected void addEditPartAction( SelectionAction action )
{
	getActionRegistry( ).registerAction( action );
	editPartActionIDs.add( action.getId( ) );
}