Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.IStatusLineManager


           
        });
    }

    private static void doSetErrorMessage(final String message) {
        final IStatusLineManager statusLineManager = getStatusLineManager();
        if (statusLineManager!=null) {
            Display.getDefault().syncExec(new Runnable() {

                @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


        // bars.setGlobalActionHandler(ErlangActionIds.UNCOMMENT,
        // getAction(editor,
        // "Uncomment"));

        final IActionBars actionBars = getActionBars();
        final IStatusLineManager manager = actionBars.getStatusLineManager();
        manager.setMessage(null);
        manager.setErrorMessage(null);

        fPreviousAnnotation.setEditor(editor);
        fNextAnnotation.setEditor(editor);

        final IAction showOutline = getAction(editor,
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setStatusLineManager(ISelection selection) {
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
      contentOutlineStatusLineManager : getActionBars().getStatusLineManager();

    if (statusLineManager != null) {
      if (selection instanceof IStructuredSelection) {
        Collection<?> collection = ((IStructuredSelection)selection).toList();
        switch (collection.size()) {
          case 0: {
            statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
            break;
          }
          case 1: {
            String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
            statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
            break;
          }
          default: {
            statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
            break;
          }
        }
      }
      else {
        statusLineManager.setMessage("");
      }
    }
  }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setStatusLineManager(ISelection selection) {
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
      contentOutlineStatusLineManager : getActionBars().getStatusLineManager();

    if (statusLineManager != null) {
      if (selection instanceof IStructuredSelection) {
        Collection<?> collection = ((IStructuredSelection)selection).toList();
        switch (collection.size()) {
          case 0: {
            statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
            break;
          }
          case 1: {
            String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
            statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
            break;
          }
          default: {
            statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
            break;
          }
        }
      }
      else {
        statusLineManager.setMessage("");
      }
    }
  }
View Full Code Here

        searchWidget = search.createPart(parent);

        IProvider<IProgressMonitor> provider = new IProvider<IProgressMonitor>(){
       
            public IProgressMonitor get(Object... params) {
                IStatusLineManager statusLineManager = getViewSite().getActionBars().getStatusLineManager();
                statusLineManager.setCancelEnabled(true);
                return statusLineManager.getProgressMonitor();
            }
           
        };
       
        // Select All Button
View Full Code Here

    } catch (Exception e1) {
      displayError();
    }
  }
  private void displayError() {
    final IStatusLineManager statusBar =
                getContext().getActionBars().getStatusLineManager ();

    if( statusBar==null )
      return; // shouldn't happen if the tool is being used.
   
    getContext().updateUI(new Runnable() {
      public void run() {
        statusBar.setErrorMessage("Unable to calculate the distance");
            }
    });
    }
View Full Code Here

  /**
   *
   * @param distance is in meters
   */
  private void displayOnStatusBar(double distance) {
      final IStatusLineManager statusBar =
          getContext().getActionBars().getStatusLineManager ();

      if( statusBar==null )
      return; // shouldn't happen if the tool is being used.
    int totalmeters=(int)distance;
    final int km=totalmeters/1000;
    final int meters=totalmeters-(km*1000);
    float cm = (float) (distance-totalmeters)*10000;
    cm = Math.round(cm);
    final float finalcm=cm/100;
    getContext().updateUI(new Runnable(){
                  public void run() {
                        statusBar.setErrorMessage(null);
        statusBar.setMessage("Distance =  "+km+","+meters+"m "+finalcm+"cm");
      }   
    });
  }
View Full Code Here

     *         if none.
     */
    StatusLineContributionItem getStatusLine() {
        if (associatedWindow instanceof WorkbenchWindow) {
            WorkbenchWindow window = (WorkbenchWindow) associatedWindow;
            IStatusLineManager statusLine = window.getStatusLineManager();
            // TODO implicit dependency on IDE's action builder
            // @issue implicit dependency on IDE's action builder
            if (statusLine != null) { // this can be null if we're exiting
                IContributionItem item = statusLine
                        .find("ModeContributionItem"); //$NON-NLS-1$
                if (item instanceof StatusLineContributionItem) {
                    return ((StatusLineContributionItem) item);
                }
            }
View Full Code Here

        final ISelection selection = event.getSelection();
        if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
           
            final IStructuredSelection structSelection = (IStructuredSelection) selection;
            final Object obj = structSelection.getFirstElement();
            final IStatusLineManager statusLineManager = getViewSite().getActionBars().getStatusLineManager();
           
            if (obj instanceof LayerLegendItem) {
                final LayerLegendItem layerItem = ((LayerLegendItem) obj);
                final Layer layer = layerItem.getLayer();
                if (layer.getStatus() == ILayer.ERROR) {
                    statusLineManager.setErrorMessage(layer.getStatusMessage());
                } else {
                    statusLineManager.setErrorMessage(null);
                    statusLineManager.setMessage(layer.getStatusMessage());
                }
            } else {
                statusLineManager.setMessage(null);
                statusLineManager.setErrorMessage(null);
            }
           
        }
       
    }
View Full Code Here

    private void setStatusBarMessage( final boolean active ) {
        getContext().updateUI(new Runnable(){
            public void run() {
                if( getContext().getActionBars()==null )
                    return;
                IStatusLineManager bar = getContext().getActionBars().getStatusLineManager();
                if (bar != null) {
                    bar.setMessage(""); //$NON-NLS-1$
                    bar.setErrorMessage(""); //$NON-NLS-1$
                }
            }
        });
    }
View Full Code Here

TOP

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

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.