Java 类org.eclipse.ui.actions.ActionFactory 实例源码

项目:neoscada    文件:ApplicationActionBarAdvisor.java   
@Override
protected void makeActions ( final IWorkbenchWindow window )
{
    this.exitAction = ActionFactory.QUIT.create ( window );
    register ( this.exitAction );

    this.aboutAction = ActionFactory.ABOUT.create ( window );
    register ( this.aboutAction );

    this.newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create ( window );
    register ( this.newWindowAction );

    register ( ActionFactory.NEW_WIZARD_DROP_DOWN.create ( window ) );
    register ( ActionFactory.NEW.create ( window ) );
    register ( ActionFactory.INTRO.create ( window ) );
    register ( ActionFactory.SAVE.create ( window ) );

    this.showViews = ContributionItemFactory.VIEWS_SHORTLIST.create ( window );
    this.newWizards = ContributionItemFactory.NEW_WIZARD_SHORTLIST.create ( window );

    register ( ActionFactory.NEW_EDITOR.create ( window ) );
    register ( ActionFactory.PREFERENCES.create ( window ) );
}
项目:Open_Source_ECOA_Toolset_AS5    文件:CompDefEditorContributor.java   
public void setActivePage(IEditorPart part) {
    if (activeEditorPart == part)
        return;

    activeEditorPart = part;

    IActionBars actionBars = getActionBars();
    if (actionBars != null) {

        ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;

        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(editor, ITextEditorActionConstants.DELETE));
        actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(editor, ITextEditorActionConstants.UNDO));
        actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(editor, ITextEditorActionConstants.REDO));
        actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(editor, ITextEditorActionConstants.CUT));
        actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(editor, ITextEditorActionConstants.COPY));
        actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(editor, ITextEditorActionConstants.PASTE));
        actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(editor, ITextEditorActionConstants.SELECT_ALL));
        actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction(editor, ITextEditorActionConstants.FIND));
        actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(editor, IDEActionFactory.BOOKMARK.getId()));
        actionBars.updateActionBars();
    }
}
项目:Open_Source_ECOA_Toolset_AS5    文件:TypesEditorContributor.java   
public void setActivePage(IEditorPart part) {
    if (activeEditorPart == part)
        return;

    activeEditorPart = part;

    IActionBars actionBars = getActionBars();
    if (actionBars != null) {

        ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;

        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(editor, ITextEditorActionConstants.DELETE));
        actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(editor, ITextEditorActionConstants.UNDO));
        actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(editor, ITextEditorActionConstants.REDO));
        actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(editor, ITextEditorActionConstants.CUT));
        actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(editor, ITextEditorActionConstants.COPY));
        actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(editor, ITextEditorActionConstants.PASTE));
        actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(editor, ITextEditorActionConstants.SELECT_ALL));
        actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction(editor, ITextEditorActionConstants.FIND));
        actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(editor, IDEActionFactory.BOOKMARK.getId()));
        actionBars.updateActionBars();
    }
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ServicesEditorContributor.java   
public void setActivePage(IEditorPart part) {
    if (activeEditorPart == part)
        return;

    activeEditorPart = part;

    IActionBars actionBars = getActionBars();
    if (actionBars != null) {

        ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;

        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(editor, ITextEditorActionConstants.DELETE));
        actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(editor, ITextEditorActionConstants.UNDO));
        actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(editor, ITextEditorActionConstants.REDO));
        actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(editor, ITextEditorActionConstants.CUT));
        actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(editor, ITextEditorActionConstants.COPY));
        actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(editor, ITextEditorActionConstants.PASTE));
        actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(editor, ITextEditorActionConstants.SELECT_ALL));
        actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction(editor, ITextEditorActionConstants.FIND));
        actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(editor, IDEActionFactory.BOOKMARK.getId()));
        actionBars.updateActionBars();
    }
}
项目:gw4e.project    文件:GW4EEditor.java   
public void createControl(Composite parent) {
    sash = new SashForm(parent, SWT.VERTICAL);
    IActionBars bars = getSite().getActionBars();
    ActionRegistry ar = getActionRegistry();

    bars.setGlobalActionHandler(ActionFactory.COPY.getId(), ar.getAction(ActionFactory.COPY.getId()));
    bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), ar.getAction(ActionFactory.PASTE.getId()));

    OutLineComposite composite = new OutLineComposite(filter, sash, SWT.NONE);

    Control tree = getViewer().createControl(composite.getComposite());
    tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 10, 1));
    tree.setData(GW_WIDGET_ID,GW_OUTLINE_ELEMENTS_TREE);
    getViewer().setEditDomain(getEditDomain());
    getViewer().setEditPartFactory(gwtpf);
    getViewer().setContents(gWGraph);

    getSelectionSynchronizer().addViewer(getViewer());

}
项目:gw4e.project    文件:GW4EEditor.java   
public void init(IPageSite pageSite) {
    super.init(pageSite);

    IActionBars bars = pageSite.getActionBars();

    bars.getToolBarManager().add(getActionRegistry().getAction(ClearEdgeBendpointLayoutAction.ID));
    bars.getToolBarManager().add(getActionRegistry().getAction(ActionFactory.DELETE.getId()));
    bars.getToolBarManager().add(getActionRegistry().getAction(ActionFactory.UNDO.getId()));
    bars.getToolBarManager().add(getActionRegistry().getAction(ActionFactory.REDO.getId()));

    bars.setGlobalActionHandler(ClearEdgeBendpointLayoutAction.ID,
            getActionRegistry().getAction(ClearEdgeBendpointLayoutAction.ID));
    bars.setGlobalActionHandler(ActionFactory.UNDO.getId(),
            getActionRegistry().getAction(ActionFactory.UNDO.getId()));
    bars.setGlobalActionHandler(ActionFactory.REDO.getId(),
            getActionRegistry().getAction(ActionFactory.REDO.getId()));
    bars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
            getActionRegistry().getAction(ActionFactory.DELETE.getId()));
    bars.updateActionBars();

    getViewer().setKeyHandler(keyHandler);

    pageSite.setSelectionProvider(getViewer());
}
项目:bdf2    文件:DbToolGefEditorContextMenuProvider.java   
public void buildContextMenu(IMenuManager menu) {
    GEFActionConstants.addStandardActionGroups(menu);

    menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.UNDO.getId()));
    menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.REDO.getId()));
    menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionFactory.DELETE.getId()));
    menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionIdConstants.MODIFY_ACTION_ID));

    IAction saveAction = getAction(ActionFactory.SAVE.getId());
    saveAction.setImageDescriptor(Activator.getImageDescriptor(Activator.IMAGE_SAVE));

    menu.appendToGroup(GEFActionConstants.GROUP_SAVE, saveAction);
    menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, createExportMenuManager());
    menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, getAction(ActionIdConstants.IMPORT_DATABASE_ACTION_ID));
    menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, getAction(ActionIdConstants.CHANGE_DATABASE_ACTION_ID));

}
项目:team-explorer-everywhere    文件:QueryEditorControl.java   
public IAction getAction(final String actionId) {
    if (!ActionFactory.DELETE.getId().equals(actionId)) {
        return null;
    }

    final TableViewer tableViewer = getFocusedTableViewer();
    if (tableViewer == null) {
        return null;
    }

    if (tableViewer.getTable().getSelectionCount() == 0) {
        return null;
    }

    return deleteAction;
}
项目:eclemma    文件:CoverageView.java   
private void createActions() {
  // For the following commands we use actions, as they are already available

  final IActionBars ab = getViewSite().getActionBars();

  openAction = new OpenAction(getSite());
  openAction
      .setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR);
  ab.setGlobalActionHandler(JdtActionConstants.OPEN, openAction);
  openAction.setEnabled(false);
  viewer.addSelectionChangedListener(openAction);

  PropertyDialogAction propertiesAction = new PropertyDialogAction(getSite(),
      viewer);
  propertiesAction
      .setActionDefinitionId(IWorkbenchCommandConstants.FILE_PROPERTIES);
  ab.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(),
      propertiesAction);
  propertiesAction.setEnabled(false);
  viewer.addSelectionChangedListener(propertiesAction);
}
项目:texlipse    文件:TexOutlinePage.java   
/**
 * Initialize copy paste by getting the clipboard and hooking 
 * the actions to global edit menu.
 * 
 * @param viewer
 */
private void initCopyPaste(TreeViewer viewer) {
    this.clipboard = new Clipboard(getSite().getShell().getDisplay());

    IActionBars bars = getSite().getActionBars();
    bars.setGlobalActionHandler(
            ActionFactory.CUT.getId(), 
            (Action)outlineActions.get(ACTION_CUT));

    bars.setGlobalActionHandler(
            ActionFactory.COPY.getId(),
            (Action)outlineActions.get(ACTION_COPY));

    bars.setGlobalActionHandler(
            ActionFactory.PASTE.getId(),
            (Action)outlineActions.get(ACTION_PASTE));

    bars.setGlobalActionHandler(
            ActionFactory.DELETE.getId(),
            (Action)outlineActions.get(ACTION_DELETE));
}
项目:ermaster-k    文件:PasteAction.java   
public PasteAction(IWorkbenchPart part) {
    super(part);

    this.setText(ResourceString.getResourceString("action.title.paste"));
    ISharedImages sharedImages = PlatformUI.getWorkbench()
            .getSharedImages();
    setImageDescriptor(sharedImages
            .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
    setDisabledImageDescriptor(sharedImages
            .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));

    this.setId(ActionFactory.PASTE.getId());

    ERDiagramEditor editor = (ERDiagramEditor) part;

    this.editor = editor;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ActionProvider.java   
@Override
public void fillActionBars(IActionBars actionBars) {
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
      new DFSAction(DFSActions.DELETE));
  actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(),
      new DFSAction(DFSActions.REFRESH));

  if (site == null)
    return;

  if ((site.getStructuredViewer().getSelection() instanceof IStructuredSelection)
      && (((IStructuredSelection) site.getStructuredViewer()
          .getSelection()).size() == 1)
      && (((IStructuredSelection) site.getStructuredViewer()
          .getSelection()).getFirstElement() instanceof DFSFile)) {

    actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN,
        new DFSAction(DFSActions.OPEN));
  }

  actionBars.updateActionBars();
}
项目:hadoop-EAR    文件:ActionProvider.java   
@Override
public void fillActionBars(IActionBars actionBars) {
  actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
      new DFSAction(DFSActions.DELETE));
  actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(),
      new DFSAction(DFSActions.REFRESH));

  if (site == null)
    return;

  if ((site.getStructuredViewer().getSelection() instanceof IStructuredSelection)
      && (((IStructuredSelection) site.getStructuredViewer()
          .getSelection()).size() == 1)
      && (((IStructuredSelection) site.getStructuredViewer()
          .getSelection()).getFirstElement() instanceof DFSFile)) {

    actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN,
        new DFSAction(DFSActions.OPEN));
  }

  actionBars.updateActionBars();
}
项目:ForgedUI-Eclipse    文件:DiagramOutlinePage2.java   
public void init(IPageSite pageSite) {
    super.init(pageSite);
    ActionRegistry registry = editor.getEditorActionRegistry();
    IActionBars bars = pageSite.getActionBars();
    String id = ActionFactory.UNDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));
    id = ActionFactory.REDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));
    id = ActionFactory.DELETE.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));
    bars.setGlobalActionHandler(ActionFactory.COPY.getId(),
            registry.getAction(ActionFactory.COPY.getId()));
    bars.setGlobalActionHandler(ActionFactory.PASTE.getId(),
            registry.getAction(ActionFactory.PASTE.getId()));

}
项目:ForgedUI-Eclipse    文件:GUIEditorActionBarContributor.java   
/**
 * Create actions managed by this contributor.
 * 
 * @see org.eclipse.gef.ui.actions.ActionBarContributor#buildActions()
 */
protected void buildActions() {
    addRetargetAction(new DeleteRetargetAction());
    addRetargetAction(new UndoRetargetAction());
    addRetargetAction(new RedoRetargetAction());

    IWorkbenchWindow iww = getPage().getWorkbenchWindow();
    addRetargetAction((RetargetAction)ActionFactory.COPY.create(iww));
    addRetargetAction((RetargetAction)ActionFactory.PASTE.create(iww));

    // Registering the zooming actions at the menu bar.
    addRetargetAction(new ZoomInRetargetAction());
    addRetargetAction(new ZoomOutRetargetAction());

    addRetargetAction(new RetargetAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY,
        GEFMessages.ToggleGrid_Label, IAction.AS_CHECK_BOX));
}
项目:ForgedUI-Eclipse    文件:GUIEditorActionBarContributor.java   
/**
 * Add actions to the given toolbar.
 * 
 * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
 */
public void contributeToToolBar(IToolBarManager toolBarManager) {
    toolBarManager.add(getAction(ActionFactory.COPY.getId()));
    toolBarManager.add(getAction(ActionFactory.PASTE.getId()));

    toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
    toolBarManager.add(getAction(ActionFactory.REDO.getId()));

    // Adding the zooming action for the editor.
    String[] zoomStrings = new String[] { ZoomManager.FIT_ALL,
            ZoomManager.FIT_WIDTH, ZoomManager.FIT_HEIGHT };
    ZoomComboContributionItem zoomActionItem = new ZoomComboContributionItem(getPage(), zoomStrings);
    toolBarManager.add(zoomActionItem);

    //toolBarManager.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY));
}
项目:NEXCORE-UML-Modeler    文件:AbstractDiagramActionContributor.java   
/**
 * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToToolBar(org.eclipse.jface.action.IToolBarManager)
 */
public void contributeToToolBar(IToolBarManager toolBarManager) {
    toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
    toolBarManager.add(getAction(ActionFactory.REDO.getId()));
    toolBarManager.add(new Separator());
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ZOOM_IN));
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ZOOM_OUT));

    toolBarManager.add(new Separator());
    // 수평 방향의 정렬 액션의 추가
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ALIGN_LEFT));
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ALIGN_CENTER));
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ALIGN_RIGHT));
    toolBarManager.add(new Separator());
    // 수직 방향의 정렬 액션의 추가
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ALIGN_TOP));
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ALIGN_MIDDLE));
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ALIGN_BOTTOM));

    toolBarManager.add(new Separator());
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.MATCH_WIDTH));
    toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.MATCH_HEIGHT));
}
项目:NEXCORE-UML-Modeler    文件:UMLTreeActionProvider.java   
/**
 * @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
 */
@Override
public void fillActionBars(IActionBars actionBars) {

    actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), new DeleteElementAction());
    actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), new RefreshAction());
    actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(), new RenameAction());
    actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(),
        new UndoAction(((ICommonViewerWorkbenchSite) getActionSite().getViewSite()).getPart()));
    actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), new RedoAction());

    // rename 모드일 경우 일반적인 ctrl+c,v 의 액션이고
    // rename 모드가 아닌 경우 모델에 대한 ctrl+c, v
    if(RenameAction.IS_RENAME_MODE){
        actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), ActionFactory.COPY.create(((ICommonViewerWorkbenchSite) getActionSite().getViewSite()).getWorkbenchWindow()));
        actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), ActionFactory.PASTE.create(((ICommonViewerWorkbenchSite) getActionSite().getViewSite()).getWorkbenchWindow()));
    } else {
        actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), new CopyAction());
        actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), new PasteAction());
    }

    super.fillActionBars(actionBars);
}
项目:triquetrum    文件:TriquetrumEditorAdvisor.java   
/**
 * Creates the 'File' menu. <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
protected IMenuManager createFileMenu(IWorkbenchWindow window) {
  IMenuManager menu = new MenuManager(getString("_UI_Menu_File_label"), IWorkbenchActionConstants.M_FILE);
  menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));

  IMenuManager newMenu = new MenuManager(getString("_UI_Menu_New_label"), "new");
  newMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

  menu.add(newMenu);
  menu.add(new Separator());
  menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
  menu.add(new Separator());
  addToMenuAndRegister(menu, ActionFactory.CLOSE.create(window));
  addToMenuAndRegister(menu, ActionFactory.CLOSE_ALL.create(window));
  menu.add(new Separator());
  addToMenuAndRegister(menu, ActionFactory.SAVE.create(window));
  addToMenuAndRegister(menu, ActionFactory.SAVE_AS.create(window));
  addToMenuAndRegister(menu, ActionFactory.SAVE_ALL.create(window));
  menu.add(new Separator());
  addToMenuAndRegister(menu, ActionFactory.QUIT.create(window));
  menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
  return menu;
}
项目:triquetrum    文件:TriquetrumEditorAdvisor.java   
/**
 * Creates the 'Edit' menu. <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
protected IMenuManager createEditMenu(IWorkbenchWindow window) {
  IMenuManager menu = new MenuManager(getString("_UI_Menu_Edit_label"), IWorkbenchActionConstants.M_EDIT);
  menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));

  addToMenuAndRegister(menu, ActionFactory.UNDO.create(window));
  addToMenuAndRegister(menu, ActionFactory.REDO.create(window));
  menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
  menu.add(new Separator());

  addToMenuAndRegister(menu, ActionFactory.CUT.create(window));
  addToMenuAndRegister(menu, ActionFactory.COPY.create(window));
  addToMenuAndRegister(menu, ActionFactory.PASTE.create(window));
  menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
  menu.add(new Separator());

  addToMenuAndRegister(menu, ActionFactory.DELETE.create(window));
  addToMenuAndRegister(menu, ActionFactory.SELECT_ALL.create(window));
  menu.add(new Separator());

  menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));

  menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
  menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
  return menu;
}
项目:org.csstudio.display.builder    文件:NavigationAction.java   
/** @param part Part for which to navigate
 *  @param navigation Navigation helper
 *  @return Action to go 'back'
 */
public static NavigationAction createBackAction(final RuntimeViewPart part, final DisplayNavigation navigation)
{
    return new NavigationAction(part, navigation,
                                    Messages.NavigateBack, Messages.NavigateBack_TT,
                                    ActionFactory.BACKWARD_HISTORY,
                                ISharedImages.IMG_TOOL_BACK, ISharedImages.IMG_TOOL_BACK_DISABLED)
       {
        @Override
           protected List<DisplayInfo> getDisplays()
        {
            return navigation.getBackwardDisplays();
        }

           @Override
           protected DisplayInfo navigate(final int steps)
           {
               return navigation.goBackward(steps);
           }
       };
}
项目:erflute    文件:ERDiagramOutlinePage.java   
private void resetAction(ActionRegistry registry) {
    if (getSite() == null) {
        return;
    }
    final IActionBars bars = getSite().getActionBars();

    String id = ActionFactory.UNDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

    id = ActionFactory.REDO.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

    id = ActionFactory.DELETE.getId();
    bars.setGlobalActionHandler(id, registry.getAction(id));

    bars.updateActionBars();
}
项目:PDFReporter-Studio    文件:AppStyleContextMenuProvider.java   
@Override
public void buildContextMenu(IMenuManager menu) {
    super.buildContextMenu(menu);

    // -----------------------------------------------------------

    IAction action = getActionRegistry().getAction(CreateStyleAction.ID);
    if (action != null && action.isEnabled())
        menu.appendToGroup(GEFActionConstants.GROUP_ADD, action);

    action = getActionRegistry().getAction(CreateStyleTemplateReferenceAction.ID);
    if (action != null && action.isEnabled())
        menu.appendToGroup(GEFActionConstants.GROUP_ADD, action);

    action = getActionRegistry().getAction(ActionFactory.DELETE.getId());
    if (action != null && action.isEnabled())
        menu.appendToGroup(GEFActionConstants.GROUP_EDIT, action);

    action = getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT);
    if (action.isEnabled())
        menu.appendToGroup(GEFActionConstants.GROUP_EDIT, action);
}
项目:PDFReporter-Studio    文件:TabbedPropertySheetPage.java   
/**
 * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars)
 */
public void setActionBars(IActionBars actionBars) {
    // Override the undo and redo global action handlers
    // to use the contributor action handlers
    IActionBars partActionBars = null;
    if (contributor instanceof IEditorPart) {
        IEditorPart editorPart = (IEditorPart) contributor;
        partActionBars = editorPart.getEditorSite().getActionBars();
    } else if (contributor instanceof IViewPart) {
        IViewPart viewPart = (IViewPart) contributor;
        partActionBars = viewPart.getViewSite().getActionBars();
    }

    if (partActionBars != null) {
        IAction action = partActionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
        if (action != null) {
            actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), action);
        }
        action = partActionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
        if (action != null) {
            actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), action);
        }
    }
}
项目:gama    文件:GamaActionBarAdvisor.java   
/**
 * Creates actions (and contribution items) for the menu bar, toolbar and status line.
 */
@Override
protected void makeActions(final IWorkbenchWindow window) {
    statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$
    createSaveAction(window);
    createSaveAsAction(window);
    createSaveAllAction(window);
    createUndoAction(window);
    createRedoAction(window);
    createCloseAction(window);
    createCloseAllAction(window);
    createHelpContentsAction(window);
    createAboutAction(window);
    createOpenPreferencesAction(window);
    makeFeatureDependentActions(window);
    createForwardHistoryAction(window);
    createBackwardHistoryAction(window);
    createQuitAction(window);
    createOpenWorkspaceAction(window);
    createPropertyDialogAction(window);
    hideShowEditorAction = ActionFactory.SHOW_EDITOR.create(window);
    register(hideShowEditorAction);
}
项目:neoscada    文件:ApplicationActionBarAdvisor.java   
@Override
protected void fillMenuBar ( final IMenuManager menuBar )
{
    final MenuManager fileMenu = new MenuManager ( "&File", IWorkbenchActionConstants.M_FILE );
    final MenuManager windowMenu = new MenuManager ( "&Window", IWorkbenchActionConstants.M_WINDOW );
    final MenuManager helpMenu = new MenuManager ( "&Help", IWorkbenchActionConstants.M_HELP );
    final MenuManager fileNewMenu = new MenuManager ( "&New", IWorkbenchActionConstants.NEW_EXT );
    final MenuManager windowNewMenu = new MenuManager ( "Show &View", IWorkbenchActionConstants.SHOW_EXT );

    menuBar.add ( fileMenu );
    // Add a group marker indicating where action set menus will appear.
    menuBar.add ( new GroupMarker ( IWorkbenchActionConstants.MB_ADDITIONS ) );
    menuBar.add ( windowMenu );
    menuBar.add ( helpMenu );

    // File
    fileMenu.add ( this.newWindowAction );
    fileMenu.add ( new Separator () );
    fileMenu.add ( fileNewMenu );
    fileMenu.add ( getAction ( ActionFactory.SAVE.getId () ) );
    fileMenu.add ( getAction ( ActionFactory.NEW_EDITOR.getId () ) );
    fileMenu.add ( new GroupMarker ( IWorkbenchActionConstants.OPEN_EXT ) );

    fileMenu.add ( new Separator () );
    fileMenu.add ( this.exitAction );

    fileNewMenu.add ( this.newWizards );

    // Window
    windowNewMenu.add ( this.showViews );
    windowMenu.add ( windowNewMenu );
    windowMenu.add ( getAction ( ActionFactory.PREFERENCES.getId () ) );

    // Help
    helpMenu.add ( this.aboutAction );
    helpMenu.add ( getAction ( ActionFactory.INTRO.getId () ) );
}
项目:neoscada    文件:ApplicationActionBarAdvisor.java   
@Override
protected void makeActions ( final IWorkbenchWindow window )
{
    this.newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create ( window );
    this.exitAction = ActionFactory.QUIT.create ( window );
    this.aboutAction = ActionFactory.ABOUT.create ( window );

    this.showViews = ContributionItemFactory.VIEWS_SHORTLIST.create ( window );
    this.newWizards = ContributionItemFactory.NEW_WIZARD_SHORTLIST.create ( window );

    this.showHelpAction = ActionFactory.HELP_CONTENTS.create ( window );
    this.searchHelpAction = ActionFactory.HELP_SEARCH.create ( window );
    this.dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create ( window );

    register ( this.exitAction );
    register ( this.aboutAction );
    register ( this.newWindowAction );

    register ( this.showHelpAction );
    register ( this.searchHelpAction );
    register ( this.dynamicHelpAction );

    register ( ActionFactory.NEW_WIZARD_DROP_DOWN.create ( window ) );
    register ( ActionFactory.NEW.create ( window ) );
    register ( ActionFactory.INTRO.create ( window ) );
    register ( ActionFactory.SAVE.create ( window ) );

    register ( ActionFactory.NEW_EDITOR.create ( window ) );
    register ( ActionFactory.PREFERENCES.create ( window ) );
}
项目:neoscada    文件:ApplicationActionBarAdvisor.java   
@Override
protected void fillCoolBar ( final ICoolBarManager coolBar )
{
    final IToolBarManager toolbar = new ToolBarManager ( SWT.FLAT | SWT.RIGHT );
    coolBar.add ( new ToolBarContributionItem ( toolbar, "main" ) );
    toolbar.add ( getAction ( ActionFactory.NEW_WIZARD_DROP_DOWN.getId () ) );
    coolBar.add ( new GroupMarker ( IWorkbenchActionConstants.MB_ADDITIONS ) );
}
项目:convertigo-eclipse    文件:ProjectExplorerView.java   
private void hookGlobalActions() {
    IActionBars bars = getViewSite().getActionBars();

    bars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
    bars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);
    bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);

/*
    bars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
    bars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
*/
}
项目:Open_Source_ECOA_Toolset_AS5    文件:GraphicalEditorContributor.java   
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
    super.contributeToToolBar(toolBarManager);
    toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
    toolBarManager.add(getAction(ActionFactory.REDO.getId()));
    toolBarManager.add(getAction(ActionFactory.DELETE.getId()));
}
项目:gw4e.project    文件:CopyNodeAction.java   
@Override
protected void init() {
    super.init();
    ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
    setText("Copy");
    setId(ActionFactory.COPY.getId());
    setHoverImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
    setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
    setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
    setEnabled(false);
}
项目:gw4e.project    文件:PasteNodeAction.java   
protected void init() {
    super.init();
    ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
    setText("Paste");
    setId(ActionFactory.PASTE.getId());
    setHoverImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
    setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
    setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
    setEnabled(false);
}
项目:gw4e.project    文件:GW4EEditorActionBarContributor.java   
@Override
protected void buildActions() {
      IWorkbenchWindow iww = getPage().getWorkbenchWindow(); 
      addRetargetAction(new UndoRetargetAction());
         addRetargetAction(new RedoRetargetAction());
         addRetargetAction(new DeleteRetargetAction());
         addRetargetAction(new ZoomInRetargetAction());
         addRetargetAction(new ZoomOutRetargetAction());
         addRetargetAction(new RetargetAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY, GEFMessages.ToggleGrid_Label, IAction.AS_CHECK_BOX));   
         addRetargetAction(new RetargetAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY, GEFMessages.ToggleSnapToGeometry_Label, IAction.AS_CHECK_BOX));
         addRetargetAction(new RetargetAction(ActionFactory.SELECT_ALL.getId(), GEFMessages.SelectAllAction_Label));
         addRetargetAction((RetargetAction)ActionFactory.COPY.create(iww));
         addRetargetAction((RetargetAction)ActionFactory.PASTE.create(iww));
         addRetargetAction(new ClearEdgeBenpointLayoutRetargetAction(iww));
}
项目:gw4e.project    文件:GW4EEditorActionBarContributor.java   
public void contributeToToolBar(IToolBarManager toolBarManager) {
    toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
    toolBarManager.add(getAction(ActionFactory.REDO.getId()));
    toolBarManager.add(getAction(ActionFactory.DELETE.getId()));  
    toolBarManager.add(new Separator());
    toolBarManager.add(getAction(GEFActionConstants.ZOOM_IN));
    toolBarManager.add(getAction(GEFActionConstants.ZOOM_OUT));
    toolBarManager.add(new ZoomComboContributionItem(getPage()));
    toolBarManager.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY));
    toolBarManager.add(getAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY)); 
    toolBarManager.add(getAction(ActionFactory.COPY.getId()));
    toolBarManager.add(getAction(ActionFactory.PASTE.getId()));
    toolBarManager.add(new Separator());
    toolBarManager.add(getAction(ClearEdgeBendpointLayoutAction.ID));
}
项目:Hydrograph    文件:ApplicationActionBarAdvisor.java   
protected void makeActions(IWorkbenchWindow window) {

    openPerspectiveAction = ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(window);
    register(openPerspectiveAction);
    IWorkbenchAction refreshAction=ActionFactory.REFRESH.create(window);
    register(refreshAction);
}
项目:Hydrograph    文件:CutAction.java   
@Override
protected void init() {
    super.init();

    ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
    setText("Cut");
    setId(ActionFactory.CUT.getId());
    setHoverImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
    setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
    setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED));
    setEnabled(false);
}
项目:Hydrograph    文件:PasteAction.java   
protected void init() {
    super.init();
    ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
    setText("Paste");
    setId(ActionFactory.PASTE.getId());
    setHoverImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
    setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
    setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
    setEnabled(false);
}
项目:Hydrograph    文件:CopyAction.java   
@Override
protected void init() {
    super.init();

    ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
    setText("Copy");
    setId(ActionFactory.COPY.getId());
    setHoverImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
    setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
    setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
    setEnabled(false);
}
项目:Hydrograph    文件:CommentBoxLabelEditManager.java   
/**
 * restores the saved actions
 * @param actionbars
 *                  at actionbars 
 */
private void restoreSavedActions(IActionBars actionBars){
    actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
    actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
    actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
    actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
    actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
    actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
    actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
    actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
}
项目:Hydrograph    文件:CommentBoxLabelEditManager.java   
/**
 * save the current actions
 * @param actionbars
 *                  at actionbars 
 */
private void saveCurrentActions(IActionBars actionBars) {
    copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
    paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
    delete = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
    selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
    cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
    find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
    undo = actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
    redo = actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
}