Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.StatusLineManager


     * Create the status line manager
     *
     * @return the status line manager
     */
    protected StatusLineManager createStatusLineManager() {
        StatusLineManager statusLineManager = new StatusLineManager();

        return statusLineManager;
    }
View Full Code Here


                        //Only prompt again if user press ok .
                        //if user hit cancel we won't ask again
                        boolean ok = (WojPlugin.openWojPreference() == 0);
                        preferenceStore.putValue("showRegistration", Boolean.toString(ok)); //$NON-NLS-1$
                    } else {
                        StatusLineManager slm = ((WorkbenchWindow)PlatformUI.getWorkbench().getActiveWorkbenchWindow()).getStatusLineManager();
                        if(slm != null) {
                            slm.setErrorMessage(Messages.getString("common.badlogin.statusbar.message")); //$NON-NLS-1$
                        }
                    }
                }
            });
        }
View Full Code Here

        zoominAction.setMapPane(mapPane);
        zoomoutAction.setMapPane(mapPane);
        openShapeAction.setMapPane(mapPane);
        openCoverageAction.setMapPane(mapPane);

        StatusLineManager statusLineManager = getStatusLineManager();
        if (statusLineManager != null) {
            IContributionItem filler = new ControlContribution("org.geotools.swt.SwtMapFrame.ID"){
                protected Control createControl( Composite parent ) {
                    Label almostParent = new Label(parent, SWT.NONE);
                    StatusLineLayoutData statusLineLayoutData = new StatusLineLayoutData();
                    statusLineLayoutData.widthHint = 1;
                    statusLineLayoutData.heightHint = 45;
                    almostParent.setLayoutData(statusLineLayoutData);
                    return almostParent;
                }
            };
            CrsStatusBarButton crsButton = new CrsStatusBarButton(mapPane);
            statusLineManager.add(filler);
            statusLineManager.add(crsButton);
            statusLineManager.update(true);
            new StatusBarNotifier(this, mapPane);
        }

        return mainComposite;
    }
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

   * 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.