1 11 package org.eclipse.jdt.internal.core.search.indexing; 12 13 import org.eclipse.core.runtime.IPath; 14 import org.eclipse.jdt.internal.core.search.processing.IJob; 15 16 public abstract class IndexRequest implements IJob { 17 protected boolean isCancelled = false; 18 protected IPath containerPath; 19 protected IndexManager manager; 20 21 public IndexRequest(IPath containerPath, IndexManager manager) { 22 this.containerPath = containerPath; 23 this.manager = manager; 24 } 25 public boolean belongsTo(String projectNameOrJarPath) { 26 return projectNameOrJarPath.equals(this.containerPath.segment(0)) 29 || projectNameOrJarPath.equals(this.containerPath.toString()); 30 } 31 public void cancel() { 32 this.manager.jobWasCancelled(this.containerPath); 33 this.isCancelled = true; 34 } 35 public void ensureReadyToRun() { 36 this.manager.aboutToUpdateIndex(this.containerPath, updatedIndexState()); 38 } 39 protected Integer updatedIndexState() { 40 return IndexManager.UPDATING_STATE; 41 } 42 } 43 | Popular Tags |