Package org.eclipse.ui

Examples of org.eclipse.ui.IViewSite


        boolean initSelectionPage = false;
        if (selectionPage instanceof Page) {
          Page p = (Page) selectionPage;
          Activator.getLogger().debug("Current page: "+ p + " has Site: " + p.getSite());
          if (initSelectionPage) {
            IViewSite viewSite = propertySheet.getViewSite();
            p.init(new PageSite(viewSite));
          }
        }
      }
      if (selection != null) {
View Full Code Here


  protected abstract void createTabItems() throws PartInitException;


  public CTabItem addPage(String text, IPage page) throws PartInitException {
    IViewSite viewSite = getViewSite();

    pages.add(page);
    if (pageSite != null) {
      if (page instanceof IPageBookViewPage) {
        IPageBookViewPage pageBookViewPage = (IPageBookViewPage) page;
View Full Code Here

    if (site != null) {
      site.setSelectionProvider(getViewer());
    }
    if (tabbedPropertySheetPage instanceof TabFolderSupport2) {
      TabFolderSupport2 tfs = (TabFolderSupport2) tabbedPropertySheetPage;
      IViewSite viewSite = tfs.getViewSite();
      if (viewSite != null) {
        viewSite.setSelectionProvider(getViewer());
        /*
        PropertySheet propertySheet = tfs.getPropertySheet();
        IWorkbenchPage page = viewSite.getPage();
        IWorkbenchPart activePart = page.getActivePart();
        if (propertySheet != null) {
View Full Code Here

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

    }

  @Override
  public void dispose() {
    job.cancel();
    final IViewSite site = getViewSite();
    if (site != null) {
            site.getWorkbenchWindow().getSelectionService().removeSelectionListener(this);
    }
    super.dispose();
  }
View Full Code Here

        aboutToBeShown();
    }

    @Override
    public void dispose() {
      IViewSite site = getViewSite();
      if (site != null) {
          site.getWorkbenchWindow().getSelectionService().removeSelectionListener(selectionListener);
      }
        super.dispose();
    }
View Full Code Here

      ITreeSelection treeSelection = (ITreeSelection) selection;
      Object firstElement = treeSelection.getFirstElement();
      if (firstElement instanceof IJavaScriptElement) {
        // it's JS element, follow opening JS editor
        ScriptExplorerPart part = getPart();
        IViewSite viewSite = part.getViewSite();
        OpenAction openAction = new OpenAction(viewSite);
        if (openAction != null && openAction.isEnabled()) {
          openAction.run();
          return;
        }
View Full Code Here

    IWorkbench wb = PlatformUI.getWorkbench();
    IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
    IWorkbenchPage page = win.getActivePage();
    IWorkbenchPart part = page.getActivePart();
    IWorkbenchPartSite site = part.getSite();
    IViewSite vSite = ( IViewSite ) site;
    IActionBars actionBars =  vSite.getActionBars();

    if( actionBars == null )
      return;

    IStatusLineManager statusLineManager = actionBars.getStatusLineManager();
View Full Code Here

          analyst.refresh();
        }
      }
    });
   
    IViewSite site = getViewSite();
    final IPartListener partListener = new IPartListener() {
     
      @Override
      public void partOpened(IWorkbenchPart part) {
      }
     
      @Override
      public void partDeactivated(IWorkbenchPart part) {
      }
     
      @Override
      public void partClosed(IWorkbenchPart part) {
      }
     
      @Override
      public void partBroughtToTop(IWorkbenchPart part) {
      }
     
      @Override
      public void partActivated(IWorkbenchPart part) {
        LiveCodingAnalyst newAnalyst = null;
        if (part instanceof PyEdit)
        {
          PyEdit editor = (PyEdit)part;
          newAnalyst = PyEditDecorator.getAnalyst(editor);
        }
        setAnalyst(newAnalyst);
        if (newAnalyst != null) {
          newAnalyst.refresh();
        }
      }
    };
    site.getPage().addPartListener(partListener);
    parent.addDisposeListener(new DisposeListener() {
     
      @Override
      public void widgetDisposed(DisposeEvent e) {
        IViewSite viewSite = getViewSite();
        viewSite.getPage().removePartListener(partListener);
        setAnalyst(null);
      }
    });
  }
View Full Code Here

   * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
   */
  public Object execute(ExecutionEvent event) {
    BookMarkExplorer bookMarkExplorer = OwlUI.getOpenedBookMarkExplorer();
    if (bookMarkExplorer != null) {
      IViewSite site = (IViewSite) bookMarkExplorer.getSite();
      ActionContributionItem item = (ActionContributionItem) site.getActionBars().getToolBarManager().find(BookMarkExplorer.NEXT_SET_ACTION);
      if (item != null && item.getAction().isEnabled())
        item.getAction().run();
    }

    return null; //As per JavaDoc
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.