Package org.eclipse.ui

Examples of org.eclipse.ui.IWindowListener


   *
   * @return
   */
  private static IWindowListener createWindowListener()
  {
    return new IWindowListener()
    {
      @Override
      public void windowActivated(final IWorkbenchWindow window)
      {
        plugin.activeWindow = window;
View Full Code Here


    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() {
View Full Code Here

        if (bench == null) {
            log.error("Could not get IWorkbench!"); //$NON-NLS-1$
            return;
        }

        bench.addWindowListener(new IWindowListener() {

            public void windowOpened(IWorkbenchWindow window) {
                setActiveDeferred(true);
            }
View Full Code Here

                    }
                    window.getPartService().addPartListener(_partListener);
                }

                // TODO: register with all windows?
                PlatformUI.getWorkbench().addWindowListener(new IWindowListener()
                {
                    public void windowActivated(final IWorkbenchWindow window) {
                        // do nothing
                    }
View Full Code Here

   *            The window which just opened; should not be <code>null</code>.
   */
  protected void fireWindowOpened(final IWorkbenchWindow window) {
    Object list[] = getListeners();
    for (int i = 0; i < list.length; i++) {
      final IWindowListener l = (IWindowListener) list[i];
      SafeRunner.run(new SafeRunnable() {
        public void run() {
          l.windowOpened(window);
        }
      });
    }
  }
View Full Code Here

      activatedWindow = null;
    }

    Object list[] = getListeners();
    for (int i = 0; i < list.length; i++) {
      final IWindowListener l = (IWindowListener) list[i];
      SafeRunner.run(new SafeRunnable() {
        public void run() {
          l.windowClosed(window);
        }
      });
    }
  }
View Full Code Here

   *            <code>null</code>.
   */
  protected void fireWindowActivated(final IWorkbenchWindow window) {
    Object list[] = getListeners();
    for (int i = 0; i < list.length; i++) {
      final IWindowListener l = (IWindowListener) list[i];
      SafeRunner.run(new SafeRunnable() {
        public void run() {
          l.windowActivated(window);
        }
      });
    }
  }
View Full Code Here

   *            <code>null</code>.
   */
  protected void fireWindowDeactivated(final IWorkbenchWindow window) {
    Object list[] = getListeners();
    for (int i = 0; i < list.length; i++) {
      final IWindowListener l = (IWindowListener) list[i];
      SafeRunner.run(new SafeRunnable() {
        public void run() {
          l.windowDeactivated(window);
        }
      });
    }
  }
View Full Code Here

        // when
        DIManager.start(workbench, bundleContext, packagePrefix, debugging);

        // then
        verify(workbench, times(1)).addWindowListener(any(IWindowListener.class));
        IWindowListener windowListener = windowListenerCaptor.getValue();
        assertThat(windowListener, notNullValue());
    }
View Full Code Here

        // when
        DIManager.start(workbench, bundleContext, packagePrefix, debugging);
        DIManager.stop();
       
        // then
        IWindowListener windowListener = windowListenerCaptor.getValue();
        assertThat(windowListener, notNullValue());
        verify(workbench, times(1)).removeWindowListener(eq(windowListener));
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWindowListener

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.