Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.StatusLineManager


        stackComposite = new Composite(parent, SWT.NONE);
        stackComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
        stackComposite.setLayout(new StackLayout());

        statusLineManager = new StatusLineManager();
        statusControl = statusLineManager.createControl(parent, SWT.NONE);
        statusControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

        createTextControl();
View Full Code Here


                @Override
                public void run() {
                    if (statusLineManager instanceof SubContributionManager) {
                        SubContributionManager sub = (SubContributionManager)statusLineManager;
                        StatusLineManager parent = (StatusLineManager) sub.getParent();
                        parent.setErrorMessage(message);
                        parent.update(true);
                    } else {
                        statusLineManager.setErrorMessage(message);
                        statusLineManager.update(true);
                    }
                }
View Full Code Here

     * Subclasses may override this method to customize the status line manager.
     * </p>
     * @return a status line manager
     */
    protected StatusLineManager createStatusLineManager() {
        return new StatusLineManager();
    }
View Full Code Here

    public void run(final boolean fork, boolean cancelable,
            final IRunnableWithProgress runnable)
            throws InvocationTargetException, InterruptedException {
        try {
            operationInProgress = true;
            final StatusLineManager mgr = getStatusLineManager();
            if (mgr == null) {
                runnable.run(new NullProgressMonitor());
                return;
            }
            boolean cancelWasEnabled = mgr.isCancelEnabled();

            final Control contents = getContents();
            final Display display = contents.getDisplay();
            Shell shell = getShell();
            boolean contentsWasEnabled = contents.getEnabled();
            MenuManager manager = getMenuBarManager();
            Menu menuBar = null;
            if (manager != null) {
                menuBar = manager.getMenu();
                manager = null;
            }
            boolean menuBarWasEnabled = false;
            if (menuBar != null) {
        menuBarWasEnabled = menuBar.getEnabled();
      }

            Control toolbarControl = getToolBarControl();
            boolean toolbarWasEnabled = false;
            if (toolbarControl != null) {
        toolbarWasEnabled = toolbarControl.getEnabled();
      }

            Control coolbarControl = getCoolBarControl();
            boolean coolbarWasEnabled = false;
            if (coolbarControl != null) {
        coolbarWasEnabled = coolbarControl.getEnabled();
      }

            // Disable the rest of the shells on the current display
            Shell[] shells = display.getShells();
            boolean[] enabled = new boolean[shells.length];
            for (int i = 0; i < shells.length; i++) {
                Shell current = shells[i];
                if (current == shell) {
          continue;
        }
                if (current != null && !current.isDisposed()) {
                    enabled[i] = current.getEnabled();
                    current.setEnabled(false);
                }
            }

            Control currentFocus = display.getFocusControl();
            try {
                contents.setEnabled(false);
                if (menuBar != null) {
          menuBar.setEnabled(false);
        }
                if (toolbarControl != null) {
          toolbarControl.setEnabled(false);
        }
                if (coolbarControl != null) {
          coolbarControl.setEnabled(false);
        }
                mgr.setCancelEnabled(cancelable);
                final Exception[] holder = new Exception[1];
                BusyIndicator.showWhile(display, new Runnable() {
                    public void run() {
                        try {
                            ModalContext.run(runnable, fork, mgr
                                    .getProgressMonitor(), display);
                        } catch (InvocationTargetException ite) {
                            holder[0] = ite;
                        } catch (InterruptedException ie) {
                            holder[0] = ie;
                        }
                    }
                });

                if (holder[0] != null) {
                    if (holder[0] instanceof InvocationTargetException) {
                        throw (InvocationTargetException) holder[0];
                    } else if (holder[0] instanceof InterruptedException) {
                        throw (InterruptedException) holder[0];
                    }
                }
            } finally {
                operationInProgress = false;
                // Enable the rest of the shells on the current display
                for (int i = 0; i < shells.length; i++) {
                    Shell current = shells[i];
                    if (current == shell) {
            continue;
          }
                    if (current != null && !current.isDisposed()) {
                        current.setEnabled(enabled[i]);
                    }
                }
                if (!contents.isDisposed()) {
          contents.setEnabled(contentsWasEnabled);
        }
                if (menuBar != null && !menuBar.isDisposed()) {
          menuBar.setEnabled(menuBarWasEnabled);
        }
                if (toolbarControl != null && !toolbarControl.isDisposed()) {
          toolbarControl.setEnabled(toolbarWasEnabled);
        }
                if (coolbarControl != null && !coolbarControl.isDisposed()) {
          coolbarControl.setEnabled(coolbarWasEnabled);
        }
                mgr.setCancelEnabled(cancelWasEnabled);
                if (currentFocus != null && !currentFocus.isDisposed()) {
                    // It's necessary to restore focus after reenabling the controls
                    // because disabling them causes focus to jump elsewhere.
                    // Use forceFocus rather than setFocus to avoid SWT's
                    // search for children which can take focus, so focus
View Full Code Here

    if (windows.length < 1)
      throw new IllegalStateException("should be at least one workbench window");
   
    WorkbenchWindow window = (WorkbenchWindow)windows[0];
   
    final StatusLineManager statusLineManager = window.getStatusLineManager();
   
    final LabelContributionItem label = new LabelContributionItem(HaloStatusPlugin.PLUGIN_ID + ".statusContribution", 7);
   
    setHaloStatus(label, HaloStatusPlugin.getPlugin().getPlayerCount());
    label.setImage(HaloStatusPlugin.getImage("resources/icons/halo1.gif"));
   
    statusLineManager.add(new Separator("halo"));
    statusLineManager.appendToGroup("halo", label);
   
      statusLineManager.update(true);
     
      HaloStatusPlugin.getPlugin().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent event) {
        if (HaloStatusPlugin.PLAYER_COUNT_PREF.equals(event.getProperty()))
          setHaloStatus(label, (String)event.getNewValue());
View Full Code Here

    if (windows.length < 1)
      throw new IllegalStateException("should be at least one workbench window");
   
    WorkbenchWindow window = (WorkbenchWindow)windows[0];
   
    final StatusLineManager statusLineManager = window.getStatusLineManager();
   
    label = new LabelContributionItem(HudsonPlugin.PLUGIN_ID + ".statusContribution", new LabelMenuCreator());
    label.setDoubleClickAction(new Action("doubleClick") {
      public void run() {
        handleDoubleClick();
      }
    });
   
    statusLineManager.add(new Separator("hudson"));
    statusLineManager.appendToGroup("hudson", label);
   
    statusLineManager.update(true);
  }
View Full Code Here

     * Subclasses may override.
     *
     * @return the window's status line manager
     */
    public IStatusLineManager createStatusLineManager() {
        return new StatusLineManager();
    }
View Full Code Here

   * Create the status line manager.
   * @return the status line manager
   */
  @Override
  protected StatusLineManager createStatusLineManager() {
    StatusLineManager statusLineManager = new StatusLineManager();
    return statusLineManager;
  }
View Full Code Here

    this.addCoolBar(SWT.FLAT);
    this.addStatusLine()
  }

  protected StatusLineManager createStatusLineManager() {
    StatusLineManager slm = new ExtendedStatusLineManager();

    return slm;
  }
View Full Code Here

   * Create the status line manager.
   * @return the status line manager
   */
  @Override
  protected StatusLineManager createStatusLineManager() {
    StatusLineManager statusLineManager = new StatusLineManager();
    return statusLineManager;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.action.StatusLineManager

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.