Package com.subhajit.common.util

Examples of com.subhajit.common.util.IProgress


  }

  private static void loopCounter(final SecureRandom random) {
    new TaskRunner(new ISwingRunnableWithProgress() {
      public void run(IProgress progresses) throws Throwable {
        IProgress progress = progresses;
        for (int i = 0; i < 100; i++) {
          Thread.sleep(random.nextInt(5) * 100);
          progress.increment(1, "" + (i + 1));
          if (Thread.currentThread().isInterrupted()) {
            return;
          }
        }
      }
View Full Code Here


    assert srcDir.isDirectory();
    assert destDir.isDirectory();

    new TaskRunner(new ISwingRunnableWithProgress() {
      public void run(IProgress progresses) throws Throwable {
        IProgress progress = progresses;
        progress.setMessage("Finding files, please wait");
        List<File> srcFiles = FileUtils.listAllFilesUnder(srcDir);
        progress.setRange(0, srcFiles.size());
        for (File file : srcFiles) {
          progress.increment(1, "Copying " + file.length()
              + " bytes (" + file.getAbsolutePath() + ")");
          File destFile = new File(destDir, file.getAbsolutePath()
              .substring(srcDir.getAbsolutePath().length()));
          if (!destFile.getParentFile().exists()) {
            FileUtils.mkdirs(destFile.getParentFile());
View Full Code Here

      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);
            List<IJavaProject> dependentProjects = BuildUtils
                .getDependentProjects(javaProject, progress);
            progress.setRange(0, dependentProjects.size());
            int index = 0;
            for (IJavaProject project : dependentProjects) {
              progress.increment(1, "Building "
                  + project.getProject().getName());
              BuildUtils.buildJavaProjectInteractively0(project,
                  progress, buildKind, problems);
              progress.setRange(0, dependentProjects.size());
              for (int i = 0; i < index; i++) {
                progress.increment(1, "");
              }
              index++;
            }
            BuildUtils.buildJavaProjectInteractively0(javaProject,
                progress, buildKind, problems);
View Full Code Here

TOP

Related Classes of com.subhajit.common.util.IProgress

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.