Examples of IWorkbenchPartSite


Examples of org.eclipse.ui.IWorkbenchPartSite

   * Notifies the listener that the menu is about to be hidden.
   */
    public final void menuAboutToHide(final IMenuManager mgr) {
      gatherContributions(mgr);
      // Remove this menu as a visible menu.
      final IWorkbenchPartSite site = part.getSite();
      if (site != null) {
        final IWorkbench workbench = site.getWorkbenchWindow().getWorkbench();
        if (workbench instanceof Workbench) {
          // try delaying this until after the selection event
          // has been fired.
          // This is less threatening if the popup: menu
          // contributions aren't tied to the evaluation service
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPartSite

            if (newPartContainer == activePartContainer) {
                makeActive(ref);
            } else if (newPartContainer == activeEditorContainer) {
                if (ref instanceof IEditorReference) {
                  if (part!=null) {
                      IWorkbenchPartSite site = part.getSite();
            if (site instanceof PartSite) {
              ref = ((PartSite) site).getPane()
                  .getPartReference();
            }
                  }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPartSite

        }
        try {
            IWorkbenchPartReference partref = getReference(newPart);
            IWorkbenchPartReference realPartRef = null;
      if (newPart != null) {
        IWorkbenchPartSite site = newPart.getSite();
        if (site instanceof PartSite) {
          realPartRef = ((PartSite) site).getPane()
              .getPartReference();
        }
      }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPartSite

     */
    public IWorkbenchPartReference getReference(IWorkbenchPart part) {
        if (part == null) {
            return null;
        }
        IWorkbenchPartSite site = part.getSite();
        if (!(site instanceof PartSite)) {
          return null;
        }
        PartSite partSite = ((PartSite) site);
        PartPane pane = partSite.getPane();
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPartSite

     * Adds workbench listeners. This will give us control over workbench events that drive the
     * view's contents. Eg. workbench selection, view activation, etc.
     */
    private void addWorkbenchListeners() {

        final IWorkbenchPartSite partSite = getSite();
        final ISelectionService selectionService = partSite.getWorkbenchWindow()
                .getSelectionService();
       
        // Add workbench selection listener
        workbenchSelectionListener = new ISelectionListener() {
            @Override
            public void selectionChanged(IWorkbenchPart part, ISelection selection) {               
                if (!(part instanceof DocumentView)) {
                    handleWorkbenchSelection(selection);   
                }
            }
        };
        selectionService.addPostSelectionListener(workbenchSelectionListener);
       
        // Add workbench part listener
        workbenchPartListener = new IPartListener() {
            @Override
            public void partOpened(IWorkbenchPart part) {
                if (part instanceof DocumentView) {
                    handleWorkbenchSelection(selectionService.getSelection());
                }
            }
            @Override
            public void partDeactivated(IWorkbenchPart part) {
                // Nothing
            }
            @Override
            public void partClosed(IWorkbenchPart part) {
                // Nothing
            }
            @Override
            public void partBroughtToTop(IWorkbenchPart part) {
                // Nothing
            }
            @Override
            public void partActivated(IWorkbenchPart part) {
                isActive = (part instanceof DocumentView);
            }
        };
        partSite.getPage().addPartListener(workbenchPartListener);
       
    }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPartSite

    }
    public Menu getMenu(){
        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){
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPartSite

        }
        IWorkbenchPart part=ApplicationGISInternal.getActiveEditor();
       
        if( part == null ) return;
       
        IWorkbenchPartSite site = part.getSite();
       
        IKeyBindingService keyBindingService = site.getKeyBindingService();
        keyBindingService.unregisterAction(deleteVertexHandler);
        deleteVertexHandler=null;
       
        ApplicationGIS.getToolManager().setDELETEAction(oldAction,part);
        actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), oldAction);
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPartSite

      }
    };

    Display display= null;
    if (editor != null) {
      IWorkbenchPartSite site= editor.getSite();
      if (site != null) {
        IWorkbenchWindow window= site.getWorkbenchWindow();
        if (window != null) {
          Shell shell= window.getShell();
          if (shell != null)
            display= shell.getDisplay();
        }
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPartSite

    if (!fRunsOnReadOnly && !validateEditorInputState())
      return;

    Display display= null;

    IWorkbenchPartSite site= editor.getSite();
    Shell shell= site.getShell();
    if (shell != null && !shell.isDisposed())
      display= shell.getDisplay();

    BusyIndicator.showWhile(display, new Runnable() {
      public void run() {
View Full Code Here

Examples of org.eclipse.ui.IWorkbenchPartSite

    if (!validateEditorInputState())
      return;

    Display display= null;

    IWorkbenchPartSite site= editor.getSite();
    Shell shell= site.getShell();
    if (shell != null && !shell.isDisposed())
      display= shell.getDisplay();

    BusyIndicator.showWhile(display, new Runnable() {
      public void run() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.