Package org.eclipse.ui

Examples of org.eclipse.ui.IActionBars


    private void initializeActions() {
        // guard to make sure that in a multi-page editor
        // this step happens just once
        if (context.getActionBars() == null) {

            IActionBars editorSiteActionBars = this.getEditorSite().
                    getActionBars();

            if (editorSiteActionBars != null) {
                UndoRedoManager undoRedoManager = context.getUndoRedoManager();
                ODOMEditorContribution.assignUndoRedoAction(editorSiteActionBars,
View Full Code Here


    /**
     * Replace some of the editors actions with those specific to this section.
     */
    private void setupGlobalActions() {
        IActionBars actionBars = context.getActionBars();
        // store away the current delete action
        originalDelete = actionBars.getGlobalActionHandler(
                IWorkbenchActionConstants.DELETE);
        // add the delete action for this section
        actionBars.setGlobalActionHandler(IWorkbenchActionConstants.DELETE,
                deleteAction);
        actionBars.updateActionBars();
    }
View Full Code Here

    /**
     * Restore the original global actions that were replaced in the
     * {@link #setupGlobalActions} method
     */
    private void restoreGlobalActions() {
        IActionBars actionBars = context.getActionBars();
        actionBars.setGlobalActionHandler(IWorkbenchActionConstants.DELETE,
                originalDelete);
        actionBars.updateActionBars();
    }
View Full Code Here

     * </p>
     *
     * @param pageSite the page site to add the actions to.
     */
    public void updatePageSiteActions(IPageSite pageSite) {
        IActionBars pageSiteActionBars = pageSite.getActionBars();

        updateAction(pageSiteActionBars, IWorkbenchActionConstants.UNDO);
        updateAction(pageSiteActionBars, IWorkbenchActionConstants.REDO);
        updateAction(pageSiteActionBars, IWorkbenchActionConstants.CUT);
        updateAction(pageSiteActionBars, IWorkbenchActionConstants.COPY);
        updateAction(pageSiteActionBars, IWorkbenchActionConstants.PASTE);
        updateAction(pageSiteActionBars, IWorkbenchActionConstants.SELECT_ALL);

        pageSiteActionBars.updateActionBars();
    }
View Full Code Here

    Section section = Parts.createStaticSection(toolkit, left, "General Attributes");
    Composite container = Parts.createStaticSectionClient(toolkit, section);

    // Generates a NullPrt
    IActionBars actionBars = /*getPage().getEditor().*/getEditorSite().getActionBars();
    createNameEntry(container, actionBars);
    createCmtEntry(container, null);
    createIconIdxEntry(container, null);
    createLabelIdxEntry(container, null);

View Full Code Here

  public LayoutSection(FolderDescrEditor fde, Composite left, String title)
    {
    Section section = Parts.createStaticSection(fde.toolkit, left, title);
    Composite container = Parts.createStaticSectionClient(fde.toolkit, section);

    IActionBars actionBars = fde.getEditorSite().getActionBars();

    _fDescrColCount = new FormEntry(container, fde.toolkit, "Column Count", null, false);
    _fDescrColCount.setFormEntryListener(new FormEntryAdapter(fde, actionBars)
      {
        public void textValueChanged(FormEntry entry)
View Full Code Here

    if (null == part)
      return;
    activeEditorPart = part;

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

      MultiPageEditorPart editor = (MultiPageEditorPart) part;

      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();
    }
  }
View Full Code Here

   *
   * @see org.eclipse.ui.part.MultiPageEditorActionBarContributor#setActivePage(org.eclipse.ui.IEditorPart)
   */
  public void setActivePage(IEditorPart part) {

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

      ITextEditor textEditor = (part instanceof XMLEditor) ? (ITextEditor) part : null;

      actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction1(textEditor,
              ITextEditorActionConstants.DELETE));
      actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction1(textEditor,
              ITextEditorActionConstants.UNDO));
      actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction1(textEditor,
              ITextEditorActionConstants.REDO));
      actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction1(textEditor,
              ITextEditorActionConstants.CUT));
      actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction1(textEditor,
              ITextEditorActionConstants.COPY));
      actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction1(textEditor,
              ITextEditorActionConstants.PASTE));
      actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction1(textEditor,
              ITextEditorActionConstants.SELECT_ALL));
      actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction1(textEditor,
              ITextEditorActionConstants.FIND));
      actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction1(textEditor,
              IDEActionFactory.BOOKMARK.getId()));
      actionBars.updateActionBars();
    }
  }
View Full Code Here

public class ToolActionContributor extends BasicTextEditorActionContributor {
  @Override
  public void setActiveEditor(IEditorPart part) {
    super.setActiveEditor(part);
    if (!(part instanceof ITextEditor)) return;
    IActionBars actionBars = getActionBars();
    if (actionBars == null) return;
   
    ITextEditor editor = (ITextEditor)part;
   
    actionBars.setGlobalActionHandler(IDEActionFactory.ADD_TASK.getId(),
        getAction(editor, IDEActionFactory.ADD_TASK.getId()));

    actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(),
        getAction(editor, IDEActionFactory.BOOKMARK.getId()));

  }
View Full Code Here

//    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();
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IActionBars

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.