Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbench


      IMenuManager originalManager = mgr;
     
      // Add this menu as a visible menu.
      final IWorkbenchPartSite site = part.getSite();
      if (site != null) {
      final IWorkbench workbench = site.getWorkbenchWindow()
          .getWorkbench();
      if (workbench instanceof Workbench) {
        final Workbench realWorkbench = (Workbench) workbench;
        ISelection input = null;
        if ((bitSet & INCLUDE_EDITOR_INPUT) != 0) {
View Full Code Here


    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
        workbench.getDisplay().asyncExec(new Runnable() {
          public void run() {
            final Workbench realWorkbench = (Workbench) workbench;
            realWorkbench.removeShowingMenus(getMenuIds(), null, null);
          }
        });
View Full Code Here

     * opened workbench windows.
     */
    public void fill(Menu menu, int index) {

        // Get workbench windows.
        IWorkbench workbench = workbenchWindow.getWorkbench();
        IWorkbenchWindow[] array = workbench.getWorkbenchWindows();
        // avoid showing the separator and list for 0 or 1 items
        if (array.length < 2) {
      return;
    }

View Full Code Here

      ProgressManager.getInstance().setShowSystemJobs(setting);
    }
   
    if (IWorkbenchPreferenceConstants.DEFAULT_PERSPECTIVE_ID.equals(propertyName)) {
      IWorkbench workbench = PlatformUI.getWorkbench();

      workbench.getPerspectiveRegistry().setDefaultPerspective(
          PrefUtil.getAPIPreferenceStore().getString(
              IWorkbenchPreferenceConstants.DEFAULT_PERSPECTIVE_ID));
      return;
    }

    if (IWorkbenchPreferenceConstants.DOCK_PERSPECTIVE_BAR
        .equals(propertyName)) {
      IPreferenceStore apiStore = PrefUtil.getAPIPreferenceStore();
      IWorkbench workbench = PlatformUI.getWorkbench();
      IWorkbenchWindow[] workbenchWindows = workbench
          .getWorkbenchWindows();
      for (int i = 0; i < workbenchWindows.length; i++) {
        IWorkbenchWindow window = workbenchWindows[i];
        if (window instanceof WorkbenchWindow) {
          ((WorkbenchWindow) window)
              .setPerspectiveBarLocation(apiStore
                  .getString(IWorkbenchPreferenceConstants.DOCK_PERSPECTIVE_BAR));
        }
      }
      return;
    }

    // TODO the banner apperance should have its own preference
    if (IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS
        .equals(propertyName)) {
      boolean newValue = PrefUtil.getAPIPreferenceStore().getBoolean(
          IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS);

      IWorkbench workbench = PlatformUI.getWorkbench();
      IWorkbenchWindow[] workbenchWindows = workbench
          .getWorkbenchWindows();
      for (int i = 0; i < workbenchWindows.length; i++) {
        IWorkbenchWindow window = workbenchWindows[i];
        if (window instanceof WorkbenchWindow) {
          ((WorkbenchWindow) window).setBannerCurve(newValue);
View Full Code Here

   
    /**
   * @since 3.1
   */
  private void suggestReset() {
    final IWorkbench workbench = getWorkbenchWindow().getWorkbench();
        workbench.getDisplay().asyncExec(new Runnable() {
            public void run() {
                Shell parentShell = null;
               
        IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
                if (window == null) {
                    if (workbench.getWorkbenchWindowCount() == 0) {
            return;
          }
                    window = workbench.getWorkbenchWindows()[0];
                }

                parentShell = window.getShell();

                if (MessageDialog
View Full Code Here

public class OpenNewMRProjectAction extends Action {

  @Override
  public void run() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    Shell shell = workbench.getActiveWorkbenchWindow().getShell();
    NewMapReduceProjectWizard wizard = new NewMapReduceProjectWizard();
    wizard.init(workbench, new StructuredSelection());
    WizardDialog dialog = new WizardDialog(shell, wizard);
    dialog.create();
    dialog.open();
View Full Code Here

    {
        if (fgPlugin == null)
        {
            return null;
        }
        IWorkbench workBench = fgPlugin.getWorkbench();
        if (workBench == null)
        {
            return null;
        }
        return workBench.getActiveWorkbenchWindow();
    }
View Full Code Here

     */
    public static IWorkbenchWindow getActiveWorkbenchWindow() {
        if (getDefault() == null) {
            return null;
        }
        IWorkbench workBench = getDefault().getWorkbench();
        if (workBench == null) {
            return null;
        }
        return workBench.getActiveWorkbenchWindow();
    }
View Full Code Here

      final Object args)
  throws Exception {

    Assert.assertTrue(object instanceof IWorkbench);

    final IWorkbench workbench = (IWorkbench) object;
    // the 'started' flag is used so that we only run tests when the window
    // is opened
    // for the first time only.
    final boolean[] started = { false };
    workbench.addWindowListener(new IWindowListener() {
      public void windowOpened(IWorkbenchWindow w) {
        if (started[0])
          return;
        w.getShell().getDisplay().asyncExec(new Runnable() {
          public void run() {
            started[0] = true;
            try {
              fTestRunnerResult = EclipseTestRunner.run((String[]) args);
            } catch (IOException e) {
              e.printStackTrace();
            }
            workbench.close();
          }
        });
      }
      public void windowActivated(IWorkbenchWindow window) {
      }
View Full Code Here

        {
            public void run()
            {
                try
                {
                    IWorkbench workbench = PlatformUI.getWorkbench();
                    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();

                    // close welcome view
                    IWorkbenchPage page = window.getActivePage();
                    for ( IViewReference viewref : page.getViewReferences() )
                    {
                        if ( "org.eclipse.ui.internal.introview".equals( viewref.getId() ) )
                        {
                            page.hideView( viewref );
                        }
                    }

                    // close shells (open dialogs)
                    Shell activeShell = Display.getCurrent().getActiveShell();
                    if ( activeShell != null && activeShell != window.getShell() )
                    {
                        activeShell.close();
                    }

                    // open LDAP perspective
                    workbench.showPerspective(
                        "org.apache.directory.studio.ldapbrowser.ui.perspective.BrowserPerspective", window );

                    // reset LDAP perspective
                    page.closeAllEditors( false );
                    page.resetPerspective();
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbench

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.