use of org.eclipse.xtext.ide.refactoring.IResourceRelocationStrategy in project xtext-eclipse by eclipse.
the class ResourceRelocationProcessor method executeParticipants.
protected void executeParticipants(final ResourceRelocationContext context) {
final List<? extends IResourceRelocationStrategy> strategies = this.strategyRegistry.getStrategies();
ResourceRelocationContext.ChangeType _changeType = context.getChangeType();
boolean _tripleEquals = (_changeType == ResourceRelocationContext.ChangeType.COPY);
if (_tripleEquals) {
IChangeSerializer _changeSerializer = context.getChangeSerializer();
_changeSerializer.setUpdateRelatedFiles(false);
}
final Consumer<IResourceRelocationStrategy> _function = (IResourceRelocationStrategy it) -> {
try {
it.applyChange(context);
} catch (final Throwable _t) {
if (_t instanceof Throwable) {
final Throwable t = (Throwable) _t;
this.issues.add(RefactoringIssueAcceptor.Severity.ERROR, "Error applying resource changes", t);
ResourceRelocationProcessor.LOG.error(t.getMessage(), t);
} else {
throw Exceptions.sneakyThrow(_t);
}
}
};
strategies.forEach(_function);
}
use of org.eclipse.xtext.ide.refactoring.IResourceRelocationStrategy in project xtext-eclipse by eclipse.
the class ResourceRelocationProcessor method executeParticipants.
protected void executeParticipants(ResourceRelocationContext context, SubMonitor monitor) {
List<? extends IResourceRelocationStrategy> strategies = strategyRegistry.getStrategies();
if (context.getChangeType() == ResourceRelocationContext.ChangeType.COPY) {
context.getChangeSerializer().setUpdateRelatedFiles(false);
}
monitor.setWorkRemaining(strategies.size());
for (IResourceRelocationStrategy strategy : strategies) {
try {
monitor.split(1);
strategy.applyChange(context);
} catch (OperationCanceledException t) {
issues.add(ERROR, "Operation was cancelled while applying resource changes", t);
LOG.error(t.getMessage(), t);
break;
}
}
}
Aggregations