Package org.eclipse.ui

Examples of org.eclipse.ui.IViewSite


        IWorkbenchPartSite site = activePart.getSite();
        if (site instanceof IEditorSite) {
            IEditorSite editorSite = (IEditorSite)site;
            return editorSite.getActionBars().getStatusLineManager();
        } else if (site instanceof IViewSite) {
            IViewSite viewSite = (IViewSite)site;
            return viewSite.getActionBars().getStatusLineManager();
        } else {
            return null;
        }
    }
View Full Code Here


              }
            }

            if (serversViewPart != null) {

              IViewSite viewSite = serversViewPart.getViewSite();
              if (viewSite != null) {
                ISelectionProvider selectionProvider = viewSite.getSelectionProvider();
                if (selectionProvider != null) {
                  ISelection selection = selectionProvider.getSelection();
                  if (selection instanceof IStructuredSelection) {
                    return (IStructuredSelection) selection;
                  }
View Full Code Here

        return menu;       
    }
    public IStatusLineManager getStatusLineManager() {
      IWorkbenchPartSite site = part.getSite();
      if( site instanceof IViewSite){
        IViewSite viewSite = (IViewSite) site;
        return viewSite.getActionBars().getStatusLineManager();
      }
      else if ( site instanceof IEditorSite){
        IEditorSite editorSite = (IEditorSite) site;
        return editorSite.getActionBars().getStatusLineManager();
      }
View Full Code Here

    public void selectionChanged( IAction action, ISelection selection ) {
    }

    public IAction getAction() {
        IViewSite site = (IViewSite) this.view.getSite();
        IContributionItem item = site.getActionBars().getToolBarManager()
                .find("org.locationtech.udig.omsbox.view.actions.ProcessingRegionToggleAction");
        return ((ActionContributionItem) item).getAction();
    }
View Full Code Here

        data.right = new FormAttachment(100, 0);
        data.top = new FormAttachment(control, 0);
        data.bottom = new FormAttachment(100, 0);
        tabFolder.setLayoutData(data);
       
        IViewSite site = getViewSite();
        IActionBars bars = site.getActionBars();
        IToolBarManager toolbarMgr = bars.getToolBarManager();
        toolbarMgr.add(getBackwardAction());
        toolbarMgr.add(getForwardAction());
        toolbarMgr.add(getRefreshAction());
        toolbarMgr.add(locationEntry.getButton());
View Full Code Here

  @Override
  public void init(IPageBookViewPage page, IConsole console) {
    IPageSite pageSite = page.getSite();
    IWorkbenchPage workbenchPage = pageSite.getPage();
    IViewPart viewPart = workbenchPage.findView(IConsoleConstants.ID_CONSOLE_VIEW );
    IViewSite viewSite = viewPart.getViewSite();
    IActionBars actionBars = viewSite.getActionBars();
    IToolBarManager toolBarManager = actionBars.getToolBarManager();
    IContributionItem[] items = toolBarManager.getItems();
    for (int i = 0; i < items.length; i++) {
      if (items[i] instanceof ActionContributionItem) {
        ActionContributionItem action = (ActionContributionItem) items[i];
View Full Code Here

    /**
     * Returns whether a view exists within the perspective.
     */
    public boolean containsView(IViewPart view) {
        IViewSite site = view.getViewSite();
        IViewReference ref = findView(site.getId(), site.getSecondaryId());
        if (ref == null) {
      return false;
    }
        return (view == ref.getPart(false));
    }
View Full Code Here

                                         *
                                         * @param part the view to update
                                         */
                                        private void updateViewBars(
                                                IViewPart part) {
                                            IViewSite viewSite = part
                                                    .getViewSite();
                                            // check for badly behaving or badly initialized views
                                            if (viewSite == null) {
                        return;
                      }
                                            IActionBars bars = viewSite
                                                    .getActionBars();
                                            IContributionManager manager = bars
                                                    .getMenuManager();
                                            if (manager != null) {
                        updateManager(manager);
View Full Code Here

    ResourcesPlugin.getWorkspace().addResourceChangeListener(new IResourceChangeListener() {

      public void resourceChanged(IResourceChangeEvent event) {
        synchronized (_viewer) {
          IViewSite viewSite = getViewSite();
          if (viewSite == null)
            return;
          IWorkbenchWindow workbenchWindow = viewSite.getWorkbenchWindow();
          if (workbenchWindow == null)
            return;
          Shell shell = workbenchWindow.getShell();
          if (shell == null)
            return;
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.ui.IWorkbenchPart#dispose()
   */
  public void dispose() {
    IViewSite site = getViewSite();
    if(site != null) {
      site.getPage().removePartListener((IPartListener2)this);
    }
    super.dispose();
        ConsoleManager consoleManager = (ConsoleManager) ConsolePlugin.getDefault().getConsoleManager();
        consoleManager.removeConsoleListener(this);       
        consoleManager.unregisterConsoleView(this);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IViewSite

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.