Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.IStatusLineManager


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

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

   * @since 3.0
   */
  private void statusNotFound() {
    fWorkbenchPart.getSite().getShell().getDisplay().beep();

    IStatusLineManager manager= getStatusLineManager();
    if (manager == null)
      return;

    manager.setMessage(EditorMessages.FindNext_Status_noMatch_label);
  }
View Full Code Here

  /**
   * Clears the status line.
   */
  private void statusClear() {
    IStatusLineManager manager= getStatusLineManager();
    if (manager == null)
      return;

    manager.setErrorMessage(""); //$NON-NLS-1$
    manager.setMessage(""); //$NON-NLS-1$
  }
View Full Code Here

   */
  protected IProgressMonitor getProgressMonitor() {

    IProgressMonitor pm= null;

    IStatusLineManager manager= getStatusLineManager();
    if (manager != null)
      pm= manager.getProgressMonitor();

    return pm != null ? pm : new NullProgressMonitor();
  }
View Full Code Here

   */
  public Object getAdapter(Class required) {

    if (IEditorStatusLine.class.equals(required)) {
      if (fEditorStatusLine == null) {
        IStatusLineManager statusLineManager= getStatusLineManager();
        ISelectionProvider selectionProvider= getSelectionProvider();
        if (statusLineManager != null && selectionProvider != null)
          fEditorStatusLine= new EditorStatusLine(statusLineManager, selectionProvider);
      }
      return fEditorStatusLine;
    }

    if (IVerticalRulerInfo.class.equals(required)) {
      if (fVerticalRuler != null)
        return fVerticalRuler;
    }

    if (IMarkRegionTarget.class.equals(required)) {
      if (fMarkRegionTarget == null) {
        IStatusLineManager manager= getStatusLineManager();
        if (manager != null)
          fMarkRegionTarget= (fSourceViewer == null ? null : new MarkRegionTarget(fSourceViewer, manager));
      }
      return fMarkRegionTarget;
    }

    if (IDeleteLineTarget.class.equals(required)) {
      if (fDeleteLineTarget == null) {
        fDeleteLineTarget= new TextViewerDeleteLineTarget(fSourceViewer);
      }
      return fDeleteLineTarget;
    }

    if (IncrementalFindTarget.class.equals(required)) {
      if (fIncrementalFindTarget == null) {
        IStatusLineManager manager= getStatusLineManager();
        if (manager != null)
          fIncrementalFindTarget= (fSourceViewer == null ? null : new IncrementalFindTarget(fSourceViewer, manager));
      }
      return fIncrementalFindTarget;
    }
View Full Code Here

        //Before saving, let's see if the auto-code formatting is turned on.
        try {
            //TODO CYTHON: support code-formatter.
            if (PyCodeFormatterPage.getFormatBeforeSaving() && !isCythonFile()) {
                IStatusLineManager statusLineManager = this.getStatusLineManager();
                IDocumentProvider documentProvider = getDocumentProvider();
                int[] regionsForSave = null;

                if (PyCodeFormatterPage.getFormatOnlyChangedLines()) {
                    if (documentProvider instanceof PyDocumentProvider) {
                        PyDocumentProvider pyDocumentProvider = (PyDocumentProvider) documentProvider;
                        ITextFileBuffer fileBuffer = pyDocumentProvider.getFileBuffer(getEditorInput());
                        if (fileBuffer != null) {
                            regionsForSave = ChangedLinesComputer.calculateChangedLines(fileBuffer, progressMonitor);
                        }
                    } else {
                        Log.log("Was expecting PyDocumentProvider. Found: " + documentProvider);
                    }
                }

                ITextSelection selection = (ITextSelection) this.getSelectionProvider().getSelection();
                PySelection ps = new PySelection(document, selection);

                if (!hasSyntaxError(ps.getDoc())) {
                    PyFormatStd std = new PyFormatStd();
                    boolean throwSyntaxError = true;
                    try {
                        std.applyFormatAction(this, ps, regionsForSave, throwSyntaxError);
                        statusLineManager.setErrorMessage(null);
                    } catch (SyntaxErrorException e) {
                        statusLineManager.setErrorMessage(e.getMessage());
                    }
                }
            }
        } catch (Throwable e) {
            //can never fail
View Full Code Here

     */
    @SuppressWarnings("rawtypes")
    public Object getAdapter(Class adapter) {
        if (OfflineActionTarget.class.equals(adapter)) {
            if (fOfflineActionTarget == null) {
                IStatusLineManager manager = getStatusLineManager();
                if (manager != null)
                    fOfflineActionTarget = (getSourceViewer() == null ? null : new OfflineActionTarget(
                            getSourceViewer(), manager, this));
            }
            return fOfflineActionTarget;
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.