Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.IStatusLineManager


    public static void setStatusBarMessage( final IToolContext context, final String message ) {
        context.updateUI(new Runnable(){
            public void run() {
                if (context.getActionBars() == null)
                    return;
                IStatusLineManager bar = context.getActionBars().getStatusLineManager();
                if (bar != null) {
                    bar.setMessage(message);
                    bar.setErrorMessage(null);
                }
            }
        });
    }
View Full Code Here


    public static void setStatusErrorBarMessage( final IToolContext context, final String message ) {
        context.updateUI(new Runnable(){
            public void run() {
                if (context.getActionBars() == null)
                    return;
                IStatusLineManager bar = context.getActionBars().getStatusLineManager();
                if (bar != null) {
                    bar.setErrorMessage(message);
                    bar.setMessage(null);
                }
            }
        });
    }
View Full Code Here

  }

  LineItem getLabel() {
        if( getContext().getActionBars()==null )
            return null;
        IStatusLineManager bar = getContext().getActionBars().getStatusLineManager();
    if (bar == null) {
      return null;
    }
    LineItem item = (LineItem) bar.find(ID);
    if (item == null) {
      item = new LineItem(ID);
      bar.appendToGroup(StatusLineManager.END_GROUP, item);
      bar.update(true);
    }

    return item;
  }
View Full Code Here

    /**
     *
     * @param msg Display msg on status bar (if possible)
     */
    public void status(final String msg ) {
        final IStatusLineManager statusBar = getStatusBar();
        final Display display = Display.getCurrent();
       
        if( statusBar == null || display == null ) return;
       
        display.syncExec(new Runnable(){
            public void run(){
                statusBar.setMessage( msg);
            }
        });
    }
View Full Code Here

                            double yres = regionMap.getYres();
                            step = Math.min(xres, yres);

                            Display.getDefault().syncExec(new Runnable(){
                                public void run() {
                                    final IStatusLineManager statusBar = getContext().getActionBars().getStatusLineManager();
                                    disposeCommand();
                                    if (statusBar == null)
                                        return; // shouldn't happen if the tool is being used.
                                    statusBar.setErrorMessage(null);
                                    statusBar.setMessage(null);
                                    try {
                                        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
                                                .showView(ProfileView.ID);
                                    } catch (PartInitException e) {
                                        e.printStackTrace();
View Full Code Here

        }
        return distance;
    }

    private void displayOnStatusBar( double distance ) {
        final IStatusLineManager statusBar = getContext().getActionBars().getStatusLineManager();

        if (statusBar == null)
            return; // shouldn't happen if the tool is being used.
        final String message = createMessage(distance);
        getContext().updateUI(new Runnable(){
            public void run() {
                statusBar.setErrorMessage(null);
                statusBar.setMessage(message);
            }
        });
    }
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 ){
          if( active ){
            if( getContext().getMapLayers().size()>0 )
              bar.setMessage(Messages.DeleteTool_status);
          }else
            bar.setMessage(""); //$NON-NLS-1$
                        bar.setErrorMessage(null);
        }
      }
    });
  }
View Full Code Here

            final boolean found=!reader.hasNext() ;
          getContext().updateUI(new Runnable() {
        public void run() {
                    if( getContext().getActionBars()==null )
                        return;
                    IStatusLineManager bar = getContext().getActionBars().getStatusLineManager();
                if (bar!=null){
                  if( found )
                    bar.setErrorMessage( Messages.DeleteTool_warning);
                  else
                    bar.setErrorMessage(null);
                }
        }
      });

            if (found)
View Full Code Here

    /**
     *
     * @param msg Display msg on status bar (if possible)
     */
    public void status(final String msg ) {
        final IStatusLineManager statusBar = getStatusBar();
        final Display display = Display.getCurrent();
       
        if( statusBar == null || display == null ) return;
       
        display.syncExec(new Runnable(){
            public void run(){
                statusBar.setMessage( msg);
            }
        });
    }
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

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.