this.replacement = replacement;
}
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) {
RefactoringStatus result = new RefactoringStatus();
try {
if (cache.size() == 0) {
IFolder folder = (IFolder) definitionFile.getParent();
List<FormNode> formNodes = definition.getChildren(FormNode.class);
for (FormNode formNode : formNodes) {
cache.add(new FormNodePresentation(folder, formNode, variableName, replacement));
}
List<State> stateNodes = definition.getChildren(State.class);
for (State stateNode : stateNodes) {
cache.add(new TimedPresentation(stateNode, variableName, replacement));
}
List<WaitState> waitStateNodes = definition.getChildren(WaitState.class);
for (WaitState waitStateNode : waitStateNodes) {
cache.add(new TimedPresentation(waitStateNode, variableName, replacement));
}
List<Action> actions = definition.getChildrenRecursive(Action.class);
for (Action action : actions) {
cache.add(new DelegablePresentation(action, action.getDisplayName(), variableName, replacement));
}
List<Decision> decisions = definition.getChildrenRecursive(Decision.class);
for (Decision decision : decisions) {
cache.add(new DelegablePresentation(decision, decision.getName(), variableName, replacement));
}
List<Subprocess> subprocesses = definition.getChildrenRecursive(Subprocess.class);
for (Subprocess subprocess : subprocesses) {
cache.add(new SubprocessPresentation(subprocess, variableName, replacement));
}
}
} catch (Exception e) {
DesignerLogger.logErrorWithoutDialog(e.getMessage(), e);
result.addFatalError(Messages.getString("UnhandledException"));
}
return result;
}