Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.SubProgressMonitor


    IProject project = root.getProject(runtimeName);
    if (project.exists()) {
      throwCoreException("A project with name '" + runtimeName + "' already exists in the workspace.");
    } else {
      // create project     
      project.create(new SubProgressMonitor(monitor, 1));     
      project.open(new SubProgressMonitor(monitor, 1));
     
      JDTUtils.addNature(project, WGADesignerPlugin.NATURE_WGA_RUNTIME);     
     
      _wgaRuntime = (WGARuntime) project.getNature(WGADesignerPlugin.NATURE_WGA_RUNTIME);
      _wgaRuntime.getConfiguration().setWgaDistribution(deployment.getName());
      _wgaRuntime.flushConfig();
      monitor.worked(1);
     
           if(workingSetsToAddTo!=null && workingSetsToAddTo.size()>0){
               List<IWorkingSet> workingSets = new ArrayList<IWorkingSet>();//workingSetsToAddTo.size()              
               for(String currentWorkingSet : workingSetsToAddTo){
                   if(!currentWorkingSet.equals("")){
                       workingSets.add(PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(currentWorkingSet));
                   }
                  
               }
               PlatformUI.getWorkbench().getWorkingSetManager().addToWorkingSets(_wgaRuntime.getProject(), workingSets.toArray(new IWorkingSet[0]));
           }
     
      // configure tomcat
      try {
        Map<String,String> variables = new HashMap<String,String>();
        TomcatUtils.getInstance().initConfDir(_wgaRuntime.getCatalinaConf().getLocation().toFile(), variables);       
        monitor.worked(1);
      } catch (IOException e) {
        throwCoreException(e.getMessage(), e);
      }  
     

      project.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 1));
    }
  }
View Full Code Here


 
        @Override
        protected IStatus run(IProgressMonitor monitor) {
          try {
            monitor.beginTask("Stopping WGA runtime '" + temp.getName() + "'.", 1);
            TomcatUtils.getInstance().stop(new SubProgressMonitor(monitor, 1));             
            return Status.OK_STATUS;
          } catch (Exception e) {
            return new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to stop WGA runtime '" + temp.getName() + "'.", e);
          } finally {
            monitor.done();
View Full Code Here

 
        @Override
        protected IStatus run(IProgressMonitor monitor) {
          try {
            monitor.beginTask("Restarting WGA runtime '" + temp.getName() + "'.", 2);
            TomcatUtils.getInstance().stop(new SubProgressMonitor(monitor, 1));   
            TomcatUtils.getInstance().start(temp, new SubProgressMonitor(monitor, 1));
            return Status.OK_STATUS;
          } catch (Exception e) {
            return new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to restart WGA runtime '" + temp.getName() + "'.", e);
          } finally {
            monitor.done();
View Full Code Here

      } else {
        try {
          monitor.beginTask("Saving document", 2000);
          ContainerCreator creator = new ContainerCreator(file.getWorkspace(), file.getParent().getFullPath());
          creator.createContainer(new SubProgressMonitor(monitor, 1000));
          file.create(stream, false, new SubProgressMonitor(monitor, 1000));
        }
        finally {
          monitor.done();
        }
      }
View Full Code Here

           
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
              TemporaryFile wgaWar = null;
              try {
                monitor.beginTask("Deploying wga", 100);
                SubProgressMonitor downloadMonitor = new SubProgressMonitor(monitor, 90);
                boolean isCustomDownloadLocation = false;
                if (_addDialog.getLocation() != null && !_addDialog.getLocation().trim().equalsIgnoreCase("")) {
                                    wgaWar = WGADesignerPlugin.getDefault().downloadWGA(downloadMonitor, _addDialog.getLocation());
                                    isCustomDownloadLocation = true;
                                } else {
                                    wgaWar = WGADesignerPlugin.getDefault().downloadCurrentWGARelease(downloadMonitor);                                
                                }
                if (!monitor.isCanceled()) {
                  SubProgressMonitor deployMonitor = new SubProgressMonitor(monitor, 10);
                  WGADeployment deployment = WGADesignerPlugin.getDefault().getWGADeploymentManager().createDeployment(_addDialog.getSymbolicName(), wgaWar.getFile(), deployMonitor);
                  if (deployment != null && isCustomDownloadLocation) {
                      deployment.setUpdateURL(_addDialog.getLocation());
                  }
                }
View Full Code Here

          runnable = new IRunnableWithProgress() {           
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
              TemporaryFile wgaWar = null;
              try {
                monitor.beginTask("Deploying wga", 100);
                SubProgressMonitor downloadMonitor = new SubProgressMonitor(monitor, 90);
                if (_updateDialog.getLocation() != null && !_updateDialog.getLocation().trim().equalsIgnoreCase("")) {
                    wgaWar = WGADesignerPlugin.getDefault().downloadWGA(downloadMonitor, _updateDialog.getLocation());
                } else {
                    wgaWar = WGADesignerPlugin.getDefault().downloadCurrentWGARelease(downloadMonitor);                   
                }
                if (!monitor.isCanceled()) {
                  SubProgressMonitor deployMonitor = new SubProgressMonitor(monitor, 10);
                  _selectedDeployment.updateWGA(wgaWar.getFile(), deployMonitor)
                }
              } catch (Exception e) {
                throw new InterruptedException(e.getMessage());
              } finally {
View Full Code Here

       
        @Override
        protected IStatus run(IProgressMonitor monitor) {
          try {     
            monitor.beginTask("Initializing WGA distributions", 100);             
            SubProgressMonitor downloadMonitor = new SubProgressMonitor(monitor, 90);             
            TemporaryFile temp = downloadCurrentWGARelease(downloadMonitor);
            SubProgressMonitor deployMonitor = new SubProgressMonitor(monitor, 10);
            getWGADeploymentManager().createOrUpdateDefaultDeployment(temp.getFile(), deployMonitor);
            temp.delete();
            return Status.OK_STATUS;
          } catch (InputStreamCanceledException e) {
            logWarning("WGA distribution download has been canceled by user.");
View Full Code Here

    if (!isRunning()) {
      notifyListeners(TomcatServerStateListener.STATE_STARTING);
     
     
      try {
        Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
      } catch (OperationCanceledException e) {
      } catch (InterruptedException e) {
      }
     
      // get or create WGADeployment
View Full Code Here

        }
      }
      if (_configuration.getParticipant() instanceof SubscriberParticipant) {
        Subscriber subscriber = ((SubscriberParticipant)_configuration.getParticipant()).getSubscriber();
        try {
          subscriber.refresh(committedResources.toArray(new IResource[0]), IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, -1));
        } catch (TeamException e) {
          throw new InvocationTargetException(e);
        }
      }
    } finally {
View Full Code Here

        @Override
        protected IStatus run(IProgressMonitor monitor) {
          try {
            monitor.beginTask("Starting WGA runtime '" + temp.getName() + "'.", 2);
            TomcatUtils.getInstance().stop(new SubProgressMonitor(monitor, 1));
            TomcatUtils.getInstance().start(temp, new SubProgressMonitor(monitor, 1));
            return Status.OK_STATUS;
          } catch (Exception e) {
            return new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to start WGA runtime '" + temp.getName() + "'.", e);
          } finally {
            monitor.done();
View Full Code Here

TOP

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

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.