Package org.eclipse.ui

Examples of org.eclipse.ui.IPerspectiveDescriptor


    public void savePerspectiveAs(IPerspectiveDescriptor newDesc) {
        Perspective persp = getActivePerspective();
        if (persp == null) {
      return;
    }
        IPerspectiveDescriptor oldDesc = persp.getDesc();

        // Always unzoom.
        if (isZoomed()) {
      zoomOut();
    }
View Full Code Here


        } finally {
            window.largeUpdateEnd();
            if (newPersp == null) {
        return;
      }
            IPerspectiveDescriptor desc = newPersp.getDesc();
            if (desc == null) {
        return;
      }
            if (dirtyPerspectives.remove(desc.getId())) {
              suggestReset();
            }
        }
    }
View Full Code Here

    private void updateTitle() {
        IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
        IWorkbenchWindow window = configurer.getWindow();
        IEditorPart activeEditor = null;
        IWorkbenchPage currentPage = window.getActivePage();
        IPerspectiveDescriptor persp = null;
        IAdaptable input = null;
       
        if (currentPage != null) {
            activeEditor = currentPage.getActiveEditor();
            persp = currentPage.getPerspective();
View Full Code Here

        if (currentPage != null) {
            if (activeEditor != null) {
                lastEditorTitle = activeEditor.getTitle();
                title = NLS.bind("{0} - {1}", lastEditorTitle, title);
            }
            IPerspectiveDescriptor persp = currentPage.getPerspective();
            String label = ""; //$NON-NLS-1$
            if (persp != null)
                label = persp.getLabel();
            IAdaptable input = currentPage.getInput();
            if (input != null) {
                label = currentPage.getLabel();
            }
            if (label != null && !label.equals("")) { //$NON-NLS-1$
View Full Code Here

      exportToExcelPulldownMenu = createExportMenu(parent,
          exportToExcelPulldownMenu);
    }
    // Determine active perspective id
    IWorkbench workbench = PlatformUI.getWorkbench();
    IPerspectiveDescriptor perspective = workbench
        .getActiveWorkbenchWindow().getActivePage().getPerspective();
    String id = null;
    if (perspective != null) {
      id = perspective.getId();
    }
    MenuItem[] items = exportToExcelPulldownMenu.getItems();
    for (MenuItem item : items) {
      if (id == null) {
        // No perspective is active
View Full Code Here

    // Map perspective id to descriptor.
    IPerspectiveRegistry reg = PlatformUI.getWorkbench().getPerspectiveRegistry();

    // leave this code in - the perspective of a given project may map to
    // activities other than those that the wizard itself maps to.
    IPerspectiveDescriptor finalPersp = reg.findPerspectiveWithId(finalPerspId);
    if (finalPersp != null && finalPersp instanceof IPluginContribution) {
      IPluginContribution contribution = (IPluginContribution) finalPersp;
      if (contribution.getPluginId() != null) {
        IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
        IActivityManager activityManager = workbenchActivitySupport.getActivityManager();
        IIdentifier identifier = activityManager.getIdentifier(WorkbenchActivityHelper.createUnifiedId(contribution));
        Set<Object> idActivities = identifier.getActivityIds();

        if (!idActivities.isEmpty()) {
          Set<Object> enabledIds = new HashSet<Object>(activityManager.getEnabledActivityIds());

          if (enabledIds.addAll(idActivities)) {
            workbenchActivitySupport.setEnabledActivityIds(enabledIds);
          }
        }
      }
    } else {
      IDEWorkbenchPlugin.log("Unable to find persective " //$NON-NLS-1$
          +
          finalPerspId + " in BasicNewProjectResourceWizard.updatePerspective"); //$NON-NLS-1$
      return;
    }

    // gather the preferred perspectives
    // always consider the final perspective (and those derived from it)
    // to be preferred
    ArrayList<String> preferredPerspIds = new ArrayList<String>();
    addPerspectiveAndDescendants(preferredPerspIds, finalPerspId);
    String preferred = configElement.getAttribute(PREFERRED_PERSPECTIVES);
    if (preferred != null) {
      StringTokenizer tok = new StringTokenizer(preferred, " \t\n\r\f,"); //$NON-NLS-1$
      while (tok.hasMoreTokens()) {
        addPerspectiveAndDescendants(preferredPerspIds, tok.nextToken());
      }
    }

    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window != null) {
      IWorkbenchPage page = window.getActivePage();
      if (page != null) {
        IPerspectiveDescriptor currentPersp = page.getPerspective();

        // don't switch if the current perspective is a preferred
        // perspective
        if (currentPersp != null && preferredPerspIds.contains(currentPersp.getId())) {
          return;
        }
      }

      // prompt the user to switch
View Full Code Here

    IContainer input = ResourcesPlugin.getWorkspace().getRoot();
   
    EOModelEditor modelEditor = null;
    IWorkbenchPage activePage = window.getActivePage();
    if (activePage != null) {
      IPerspectiveDescriptor perspective = window.getActivePage().getPerspective();
      if (perspective != null && EOModelerPerspectiveFactory.EOMODELER_PERSPECTIVE_ID.equals(perspective.getId())) {
        IEditorPart editorPart = activePage.getActiveEditor();
        if (editorPart instanceof EOModelEditor) {
          modelEditor = (EOModelEditor)editorPart;
          EOModel editingModel = modelEditor.getModel();
          if (editingModel != null) {
View Full Code Here

    // change those perspectives back to the WOLips perspective.  We also only want to do this
    // on windows at startup, so we don't swap back an "Open Entity Modeler in New Window" window.
    if (startup && Activator.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.CHANGE_PERSPECTIVES_KEY)) {
      IWorkbenchPage activePage = window.getActivePage();
      if (activePage != null) {
        IPerspectiveDescriptor descriptor = activePage.getPerspective();
        if (descriptor != null && EOModelerPerspectiveFactory.EOMODELER_PERSPECTIVE_ID.equals(descriptor.getId())) {
          IEditorReference[] editorReferences = activePage.getEditorReferences();
          boolean containsEntityModeler = false;
          for (IEditorReference editorReference : editorReferences) {
            if (EOModelEditor.EOMODEL_EDITOR_ID.equals(editorReference.getId())) {
              containsEntityModeler = true;
View Full Code Here

        ConnectionCorePlugin.getDefault().getConnectionFolderManager().getRootConnectionFolder().addConnectionId(
            connection.getId() );

        // Getting the window, LDAP perspective and current perspective
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        IPerspectiveDescriptor ldapPerspective = getLdapPerspective();
        IPerspectiveDescriptor currentPerspective = window.getActivePage().getPerspective();

        // Checking if we are already in the LDAP perspective
        if ( ( ldapPerspective != null ) && ( ldapPerspective.equals( currentPerspective ) ) )
        {
            // As we're already in the LDAP perspective, we only indicate to the user
View Full Code Here

          throw new CoreException(status);
        }
      }
    };
   
    IPerspectiveDescriptor finalPersp = PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(FusePerspective.ID);
    final boolean switchPerspective = confirmPerspectiveSwitch(workbenchWindow, finalPersp);

    job.addJobChangeListener(new JobChangeAdapter() {
      public void done(IJobChangeEvent event) {
        final IStatus result = event.getResult();
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IPerspectiveDescriptor

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.