Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IProgressMonitor


  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IProject project = null;
    project = FilesAccess.getProjectFromMenuSelection(event);

    IProgressMonitor dummyPM = new IProgressMonitor() {

      @Override
      public void worked(int work) {
      }
View Full Code Here


 
  @Check(value = CheckType.EXPENSIVE)
  public IMetadataRepository checkLocationURI(final Location location) {
    IMetadataRepository _xblockexpression = null;
    {
      IProgressMonitor _xifexpression = null;
      boolean _and = false;
      Map<Object, Object> _context = this.getContext();
      boolean _notEquals = (!Objects.equal(_context, null));
      if (!_notEquals) {
        _and = false;
      } else {
        Map<Object, Object> _context_1 = this.getContext();
        Object _get = _context_1.get(IProgressMonitor.class);
        boolean _notEquals_1 = (!Objects.equal(_get, null));
        _and = _notEquals_1;
      }
      if (_and) {
        Map<Object, Object> _context_2 = this.getContext();
        Object _get_1 = _context_2.get(IProgressMonitor.class);
        _xifexpression = ((IProgressMonitor) _get_1);
      } else {
        _xifexpression = new NullProgressMonitor();
      }
      final IProgressMonitor monitor = _xifexpression;
      IMetadataRepository _xifexpression_1 = null;
      String _uri = location.getUri();
      boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_uri);
      boolean _not = (!_isNullOrEmpty);
      if (_not) {
View Full Code Here

        ErlideEventTracer.getInstance().traceOperationStart(this);
        try {
            final IRunnableWithProgress myRunnableWithProgress = new IRunnableWithProgress() {
                @Override
                public void run(final IProgressMonitor monitor0) {
                    final IProgressMonitor monitor = monitor0 != null ? monitor0
                            : new NullProgressMonitor();
                    try {
                        monitor.beginTask("Processing "
                                + textEditor.getEditorInput().getName(),
                                IProgressMonitor.UNKNOWN);
                        doAction(sel, textEditor);
                    } finally {
                        monitor.done();
                    }
                }
            };

            try {
View Full Code Here

            }
        }

        public void cancel() {
            fCanceled = true;
            final IProgressMonitor pm = fProgressMonitor;
            if (pm != null) {
                pm.setCanceled(true);
            }
            synchronized (fDirtyRegionQueue) {
                fDirtyRegionQueue.notifyAll();
            }
        }
View Full Code Here

      final IWorkspace workspace = ((ErlModel) _parent).getWorkspace();
      workspace.run(
        new IWorkspaceRunnable() {
          public void run(final IProgressMonitor monitor0) {
            try {
              IProgressMonitor _elvis = null;
              if (monitor0 != null) {
                _elvis = monitor0;
              } else {
                NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
                _elvis = _nullProgressMonitor;
              }
              final IProgressMonitor monitor = _elvis;
              try {
                monitor.beginTask("", 4);
                final IProjectDescription description = workspace.newProjectDescription(ErlProject.this.name);
                description.setLocationURI(location);
                SubProgressMonitor _subProgressMonitor = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.create(description, _subProgressMonitor);
                SubProgressMonitor _subProgressMonitor_1 = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.open(_subProgressMonitor_1);
                description.setNatureIds(new String[] { IErlProject.NATURE_ID });
                SubProgressMonitor _subProgressMonitor_2 = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.setDescription(description, _subProgressMonitor_2);
                SubProgressMonitor _subProgressMonitor_3 = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.setDefaultCharset("UTF-8", _subProgressMonitor_3);
              } finally {
                monitor.done();
              }
            } catch (Throwable _e) {
              throw Exceptions.sneakyThrow(_e);
            }
          }
View Full Code Here

     */
    public void run() {
        // TODO: run it in a new thread
        selectionChanged();
        if (getUserInput()) {
            final IProgressMonitor monitor = new NullProgressMonitor();
            try {
                IResultParser result;
                monitor.beginTask("Detecting..", 0);

                result = callRefactoring();
                if (result.isSuccessful()) {
                    showDuplicatesView();
                    addDuplicates(result.getDuplicates());
                } else {
                    DuplicatesUIManager.closeDuplicatesView();
                    displayErrorNotification(result.getErrorMessage());
                }
            } catch (final WranglerWarningException e) {

            } catch (final WranglerRpcParsingException e) {
                displayErrorNotification(rpcErrorMsg);
            } catch (final CoreException e) {
                displayErrorNotification(rpcErrorMsg);
            } catch (final IOException e) {
                displayErrorNotification(rpcErrorMsg);
            } finally {
                monitor.done();
            }
        }

    }
View Full Code Here

    public void clearBlocked() {

        //If this is a monitor that can report blocking do so.
        //Don't bother with a collector as this should only ever
        //happen once and prevent any more progress.
        final IProgressMonitor pm = getWrappedProgressMonitor();
        if (!(pm instanceof IProgressMonitorWithBlocking)) {
      return;
    }

        display.asyncExec(new Runnable() {
View Full Code Here

     */
    public void setBlocked(final IStatus reason) {
        //If this is a monitor that can report blocking do so.
        //Don't bother with a collector as this should only ever
        //happen once and prevent any more progress.
        final IProgressMonitor pm = getWrappedProgressMonitor();
        if (!(pm instanceof IProgressMonitorWithBlocking)) {
      return;
    }

        display.asyncExec(new Runnable() {
View Full Code Here

    /*
     * (non-Javadoc)
     * Method declared on IStatusLineManager
     */
    public IProgressMonitor getProgressMonitor() {
    final IProgressMonitor progressDelegate = statusLineExist() ? getProgressMonitorDelegate()
        : new NullProgressMonitor();

        return new IProgressMonitorWithBlocking() {

            /* (non-Javadoc)
             * @see org.eclipse.core.runtime.IProgressMonitor#beginTask(java.lang.String, int)
             */
            public void beginTask(String name, int totalWork) {
                progressDelegate.beginTask(name, totalWork);

            }

            /* (non-Javadoc)
             * @see org.eclipse.core.runtime.IProgressMonitor#done()
             */
            public void done() {
                progressDelegate.done();
            }

            /* (non-Javadoc)
             * @see org.eclipse.core.runtime.IProgressMonitor#internalWorked(double)
             */
            public void internalWorked(double work) {
                progressDelegate.internalWorked(work);

            }

            /* (non-Javadoc)
             * @see org.eclipse.core.runtime.IProgressMonitor#isCanceled()
             */
            public boolean isCanceled() {
                return progressDelegate.isCanceled();
            }

            /* (non-Javadoc)
             * @see org.eclipse.core.runtime.IProgressMonitor#setCanceled(boolean)
             */
            public void setCanceled(boolean value) {
                //Don't bother updating for disposed status
                if (statusLineExist()) {
                  progressDelegate.setCanceled(value);
        }
            }

            /* (non-Javadoc)
             * @see org.eclipse.core.runtime.IProgressMonitor#setTaskName(java.lang.String)
             */
            public void setTaskName(String name) {
                progressDelegate.setTaskName(name);

            }

            /* (non-Javadoc)
             * @see org.eclipse.core.runtime.IProgressMonitor#subTask(java.lang.String)
             */
            public void subTask(String name) {
                progressDelegate.subTask(name);

            }

            /* (non-Javadoc)
             * @see org.eclipse.core.runtime.IProgressMonitor#worked(int)
             */
            public void worked(int work) {
                progressDelegate.worked(work);
            }

            /* (non-Javadoc)
             * @see org.eclipse.core.runtime.IProgressMonitorWithBlocking#clearBlocked()
             */
 
View Full Code Here

   */
  protected void doSaveAs(URI uri, IEditorInput editorInput) {
    (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
    setInputWithNotify(editorInput);
    setPartName(editorInput.getName());
    IProgressMonitor progressMonitor =
      getActionBars().getStatusLineManager() != null ?
        getActionBars().getStatusLineManager().getProgressMonitor() :
        new NullProgressMonitor();
    doSave(progressMonitor);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.IProgressMonitor

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.