1 11 package org.eclipse.help.internal.search.federated; 12 13 import org.eclipse.core.runtime.*; 14 import org.eclipse.core.runtime.jobs.Job; 15 import org.eclipse.help.internal.base.*; 16 import org.eclipse.help.internal.base.BaseHelpSystem; 17 import org.eclipse.help.internal.search.SearchIndexWithIndexingProgress; 18 19 public class IndexerJob extends Job { 20 public static final String FAMILY = "org.eclipse.help.base.indexer"; public IndexerJob() { 22 super(HelpBaseResources.IndexerJob_name); 23 } 24 protected IStatus run(IProgressMonitor monitor) { 25 SearchIndexWithIndexingProgress index = BaseHelpSystem.getLocalSearchManager().getIndex(Platform.getNL()); 26 try { 27 BaseHelpSystem.getLocalSearchManager().ensureIndexUpdated(monitor, index); 28 return Status.OK_STATUS; 29 } 30 catch (OperationCanceledException e) { 31 return Status.CANCEL_STATUS; 32 } 33 catch (Exception e) { 34 return new Status(IStatus.ERROR, HelpBasePlugin.PLUGIN_ID, IStatus.OK, HelpBaseResources.IndexerJob_error, e); 35 } 36 } 37 public boolean belongsTo(Object family) { 38 return FAMILY.equals(family); 39 } 40 } 41 | Popular Tags |