예제 #1
0
  private JobTreeElement[] findJobsToRemove(JobTreeElement info) {

    if (info.isJobInfo()) {
      Job myJob = ((JobInfo) info).getJob();

      if (myJob != null) {

        Object prop = myJob.getProperty(ProgressManagerUtil.KEEPONE_PROPERTY);
        if (prop instanceof Boolean && ((Boolean) prop).booleanValue()) {
          ArrayList found = null;
          JobTreeElement[] all;
          synchronized (keptjobinfos) {
            all = (JobTreeElement[]) keptjobinfos.toArray(new JobTreeElement[keptjobinfos.size()]);
          }
          for (int i = 0; i < all.length; i++) {
            JobTreeElement jte = all[i];
            if (jte != info && jte.isJobInfo()) {
              Job job = ((JobInfo) jte).getJob();
              if (job != null && job != myJob && job.belongsTo(myJob)) {
                if (found == null) {
                  found = new ArrayList();
                }
                found.add(jte);
              }
            }
          }
          if (found != null) {
            return (JobTreeElement[]) found.toArray(new JobTreeElement[found.size()]);
          }
        }
      }
    }
    return null;
  }
예제 #2
0
 static void disposeAction(JobTreeElement jte) {
   if (jte.isJobInfo()) {
     JobInfo ji = (JobInfo) jte;
     Job job = ji.getJob();
     if (job != null) {
       Object prop = job.getProperty(IProgressConstants.ACTION_PROPERTY);
       if (prop instanceof ActionFactory.IWorkbenchAction) {
         ((ActionFactory.IWorkbenchAction) prop).dispose();
       }
     }
   }
 }