1 11 package org.eclipse.jdt.internal.core.search.indexing; 12 13 import org.eclipse.core.runtime.IPath; 14 import org.eclipse.core.runtime.IProgressMonitor; 15 import org.eclipse.jdt.internal.core.index.Index; 16 17 class RemoveFromIndex extends IndexRequest { 18 String resourceName; 19 20 public RemoveFromIndex(String resourceName, IPath containerPath, IndexManager manager) { 21 super(containerPath, manager); 22 this.resourceName = resourceName; 23 } 24 public boolean execute(IProgressMonitor progressMonitor) { 25 26 if (this.isCancelled || progressMonitor != null && progressMonitor.isCanceled()) return true; 27 28 29 Index index = this.manager.getIndex(this.containerPath, true, false ); 30 if (index == null) return true; 31 ReadWriteMonitor monitor = index.monitor; 32 if (monitor == null) return true; 34 try { 35 monitor.enterWrite(); index.remove(resourceName); 37 } finally { 38 monitor.exitWrite(); } 40 return true; 41 } 42 public String toString() { 43 return "removing " + this.resourceName + " from index " + this.containerPath; } 45 } 46 | Popular Tags |