Package org.eclipse.ui.progress

Examples of org.eclipse.ui.progress.IProgressService


    }
    try {
      Refresh runner = new Refresh(this.resource, this.resource.getProject());
     
      IWorkbench wb = PlatformUI.getWorkbench();
      IProgressService ps = wb.getProgressService();
      ps.run(false, true, runner);
     
      //IWorkspace workspace = ResourcesPlugin.getWorkspace();
      //workspace.run(runner, this.resource.getProject(), IWorkspace.AVOID_UPDATE, null);//TODO add a progress monitor
     
    //} catch (CoreException e) {
View Full Code Here


   
    public static void importFromRepository(IProject project, IWizardContainer container){
      try {
      if (container == null){
        IWorkbench wb = PlatformUI.getWorkbench();
        IProgressService ps = wb.getProgressService();
        ps.run(false, true, new RepositoryExport(project));
      } else {
        container.run(false, true, new RepositoryExport(project));
      }
    } catch (InvocationTargetException e) {
      ToolPlugin.showError("Error importing from Tool Repository",e);
View Full Code Here

        } catch (IOException e) {
          LogService.error(MusicMessages.MeiseEditor_31, e);
        }
      }
    };
    IProgressService service = PlatformUI.getWorkbench()
        .getProgressService();
    try {
      service.run(true, true, op);

    } catch (InvocationTargetException e) {
      LogService.error(MusicMessages.MeiseEditor_12, e);
    } catch (InterruptedException e) {
      LogService.error(MusicMessages.MeiseEditor_14, e);
View Full Code Here

        progress.setWorkRemaining(1);
        MeiResourceReader.getJaxbContextInstance();
        progress.setWorkRemaining(0);
      }
    };
    IProgressService service = PlatformUI.getWorkbench()
        .getProgressService();
    try {
      service.run(true, true, op);
    } catch (InvocationTargetException e) {
      LogService.error(MusicMessages.MeiseEditor_12, e);
    } catch (InterruptedException e) {
      LogService.error(MusicMessages.MeiseEditor_14, e);
    } catch (Exception e) {
View Full Code Here

  /**
   * @see IWorkbenchWindowActionDelegate#run
   */
  public void run(IAction action) {
    // TODO change to RunnableWithProgress and add cancel Button
      IProgressService service = window.getWorkbench().getProgressService();
     
    // Now build the search index
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) throws InvocationTargetException {
        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
        try {
          URL url = new URL(store.getString(PreferenceConstants.P_CARDLIST_URL));
          StandardTournament factory = new StandardTournament();

          monitor.beginTask("Updating...", 2);
         
          String[] restrictedCards = StringUtils.parseToStringArray( store.getString(PreferenceConstants.P_RESTRICTED_CARDS));
          factory.read(url, store.getString(PreferenceConstants.P_REGEX_CARD), restrictedCards );
          monitor.worked(1);
         
          factory.save();
          monitor.worked(1);
        } catch (MalformedURLException e) {
          MessageDialog.openInformation(
              window.getShell(),
              "FactOrFiction Tournament Format Plug-in",
              "Could not open '" + store.getString(PreferenceConstants.P_CARDLIST_URL) + "'.");
        } catch (IOException e) {
          MessageDialog.openInformation(
              window.getShell(),
              "FactOrFiction Tournament Format Plug-in",
              "Error reading from '" + store.getString(PreferenceConstants.P_CARDLIST_URL) + "'.");
        }
      };
        };
       
      try {
      service.busyCursorWhile(runnable);
    } catch (InvocationTargetException e) {
      e.getMessage();
      return;
    } catch (InterruptedException e) {
      return;
    }
   
    // and now the cardpool has to be re-read!
    IRunnableWithProgress runnableCardPool = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) throws InvocationTargetException {
        CardPool.instance().initFromPlugins(monitor, true);
      }
    };
      try {
      service.run(false, false, runnableCardPool);
    } catch (InvocationTargetException e) {
      e.getMessage();
    } catch (InterruptedException e) {
      e.getMessage();
    }
View Full Code Here

   
  }
 
    @Override
  public void postStartup() {
      IProgressService service = getWorkbenchConfigurer().getWorkbench().getProgressService();
     
    // Now build the search index
    IRunnableWithProgress runnable = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) throws InvocationTargetException {
        CardPool.instance().initFromPlugins(monitor, false);       
      }
    };
       
      try {
      service.run(true, false, runnable);
    } catch (InvocationTargetException e) {
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
View Full Code Here

      if (getContainer() != null) {
        getContainer().run(true, true, runnable);
      } else if (getSearchContainer() != null) {
        getSearchContainer().getRunnableContext().run(true, true, runnable);
      } else {
        IProgressService service = PlatformUI.getWorkbench().getProgressService();
        service.busyCursorWhile(runnable);
      }
    } catch (InvocationTargetException e) {
      ((AbstractRedmineRepositoryQueryPage)getContainer().getCurrentPage()).setErrorMessage(e.getMessage());
      return;
    } catch (InterruptedException e) {
View Full Code Here

public class ProgressBox
{
  public ProgressBox(IRunnableWithProgress ptr) throws Exception
  {
    IProgressService service = PlatformUI.getWorkbench().getProgressService();
    service.run(true, false, ptr);
  }
View Full Code Here

        final IJavaProject javaProject, final int buildKind)
        throws Exception {
      final Map<IJavaProject, IMarker[]> problems = new HashMap<IJavaProject, IMarker[]>();
      final List<Exception> exceptionHolder = new ArrayList<Exception>();
      IWorkbench wb = PlatformUI.getWorkbench();
      IProgressService ps = wb.getProgressService();
      ps.busyCursorWhile(new IRunnableWithProgress() {
        public void run(IProgressMonitor progressMonitor) {
          try {
            IProgress progress = new SwtProgressImpl(
                progressMonitor);
            ProjectUtils.updateProjectLocations(progress);
View Full Code Here

public abstract class SwtTaskRunner {
  public SwtTaskRunner() throws Throwable {
    super();
    final List<Throwable> exceptions = new ArrayList<Throwable>();
    IWorkbench wb = PlatformUI.getWorkbench();
    IProgressService ps = wb.getProgressService();
    try {
      ps.busyCursorWhile(new IRunnableWithProgress() {
        public void run(final IProgressMonitor progressMonitor) {
          try {
            runTask(new SwtProgressImpl(progressMonitor));
          } catch (InterruptedException exc) {
            Thread.currentThread().interrupt();
View Full Code Here

TOP

Related Classes of org.eclipse.ui.progress.IProgressService

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.