Package org.eclipse.ui.part

Examples of org.eclipse.ui.part.IPageSite


    _clipboardHandler = new EOModelClipboardHandler();
    _editor = editor;
  }

  protected void updateClipboardHandler() {
    IPageSite site = getSite();
    if (site != null && _editor != null) {
      IActionBars actionBars = site.getActionBars();
      _clipboardHandler.attach(actionBars, _editor);
    }
  }
View Full Code Here


    IWorkbenchPart answer = null;
    if (site != null) {
      answer  = site.getPart();
    }
    if (answer == null) {
      IPageSite ps = getPageSite();
      if (ps != null) {
        answer = ps.getPage().getActivePart();
      }
    }
    return answer;

  }
View Full Code Here

  @Override
  public void createControls(Composite parent, TabbedPropertySheetPage tabbedSheetPage) {
    this.tabbedSheetPage = tabbedSheetPage;

    Activator.getLogger().debug("Creating page controls for " + page);
    IPageSite pageSite = getPageSite();
    if (pageSite != null) {
      // lets clear the menu first...
      /*
        IMenuManager menuManager = pageSite.getActionBars().getMenuManager();
        if (menuManager instanceof SubMenuManager) {
View Full Code Here

     */
    page.createControl(parent);
  }

  protected IPageSite getPageSite() {
    IPageSite pageSite = null;
    if (this.tabbedSheetPage != null) {
      pageSite = this.tabbedSheetPage.getSite();
    }
    return pageSite;
  }
View Full Code Here

    }
    return answer;
  }

  protected IActionBars getActionBars() {
    IPageSite pageSite = getPageSite();
    IActionBars actionBars = null;
    if (pageSite != null) {
      actionBars = pageSite.getActionBars();
    }
    return actionBars;
  }
View Full Code Here

    this.pageSite = pageSite;
  }

  public IPageSite getPageSite() {
    if (tabbedPropertySheetPage != null) {
      IPageSite answer = tabbedPropertySheetPage.getSite();
      if (answer != null) {
        return answer;
      }
    }
    return pageSite;
View Full Code Here

    }
  }

  protected void setSelectionProvider() {
    IWorkbenchPartSite site = getSite();
    IPageSite pageSite = getPageSite();
    if (site != null) {
      site.setSelectionProvider(getViewer());
    }
    if (tabbedPropertySheetPage instanceof TabFolderSupport2) {
      TabFolderSupport2 tfs = (TabFolderSupport2) tabbedPropertySheetPage;
View Full Code Here

    }
    return answer;
  }

  protected IActionBars getActionBars() {
    IPageSite pageSite = getPageSite();
    IActionBars actionBars = null;
    if (pageSite != null) {
      actionBars = pageSite.getActionBars();
    }
    if (actionBars == null) {
      IViewSite viewSite = getViewSite();
      if (viewSite != null) {
        actionBars = viewSite.getActionBars();
View Full Code Here

  }


  @Override
  public void dispose() {
      final IPageSite pageSite = getSite();
      if (pageSite != null) {
            ISelectionProvider selectionProvider = pageSite.getSelectionProvider();
            if (selectionProvider != null && form instanceof ISelectionListener) {
                selectionProvider.removeSelectionChangedListener(selectionListener);
            }
      }
    form.dispose();
View Full Code Here

    mgr.add(new Separator());
    mgr.add(selectAll = createStandardAction(ActionFactory.SELECT_ALL));
    mgr.add(copy = createStandardAction(ActionFactory.COPY));

    if (site instanceof IPageSite) {
      final IPageSite pageSite = (IPageSite) site;
      getControl().addFocusListener(new FocusListener() {
        public void focusLost(FocusEvent e) {
          pageSite.getActionBars().setGlobalActionHandler(
              ActionFactory.SELECT_ALL.getId(), null);
          pageSite.getActionBars().setGlobalActionHandler(
              ActionFactory.COPY.getId(), null);
          pageSite.getActionBars().updateActionBars();
        }

        public void focusGained(FocusEvent e) {
          updateActionEnablement(getSelection());
          pageSite.getActionBars().setGlobalActionHandler(
              ActionFactory.SELECT_ALL.getId(), selectAll);
          pageSite.getActionBars().setGlobalActionHandler(
              ActionFactory.COPY.getId(), copy);
          pageSite.getActionBars().updateActionBars();
        }
      });
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.part.IPageSite

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.