List<Rule> rules = null;
if( selectedRules != null ) rules = selectedRules;
else rules = selectedCatalog.getRules();
int numRules = rules.size();
RuleEngine ruleEngine = Activator.getRuleEngine();
monitor.beginTask("Applying rules...", numRules+1);
for(int i = 0; i < rules.size(); i++)
{
monitor.subTask(rules.get(i).getRuleID() + " ("+(i+1)+"/"+numRules+")");
ruleEngine.applyRule(project, selectedModels, rules.get(i));
monitor.worked(1);
}
monitor.subTask("Cleaning up project");
Activator.getProjectCleaner().cleanUpProject(project);