}
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
throws CoreException, OperationCanceledException {
RefactoringStatus result = super.checkInitialConditions(pm);
pm.worked(50);
//Check if Selection is a Production
AtgAst atgAst = info.getAtgEditor().getAtgAstManager().getAtgAst();
List<AbstractAtgAstNode> nodes =
atgAst.getNodes(info.getOffset(), info.getOldName().length());
boolean characterSetIdentFound = false;
for (AbstractAtgAstNode node : nodes) {
if (node instanceof IdentNode &&
(((IdentNode) node).getKind() == IdentNode.Kind.PRODUCTION ||
((IdentNode) node).getKind() == IdentNode.Kind.COMPILER))
{
characterSetIdentFound = true;
}
}
if (!characterSetIdentFound)
result.addFatalError( CoreTexts.renameProductionRefactor_noProduction );
pm.done();
return result;
}