// check if we have an action that's enabled on the current partition
ITypedRegion tr = getPartition(document, textSelection);
String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$
Iterator it = getProcessors().iterator();
FindOccurrencesProcessor processor = null;
while (it.hasNext()) {
processor = (FindOccurrencesProcessor) it.next();
// we just choose the first action that can handle the partition
if (processor.enabledForParitition(partition))
return processor;
}
List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
Object o = extendedFindOccurrencesProcessors.get(i);
if (o instanceof FindOccurrencesProcessor) {
/*
* We just choose the first registered processor that
* explicitly says it can handle the partition
*/
processor = (FindOccurrencesProcessor) o;
if (processor.enabledForParitition(partition))
return processor;
}
}
return null;
}