});
} else if (oldFieldState && !newFieldState) {
ExecutionUtils.run(javaInfoRoot, new RunnableEx() {
public void run() throws Exception {
for (FieldDeclaration field : rootNode.getFields()) {
VariableDeclarationFragment fragment = DomGenerics.fragments(field).get(0);
if (fragment.getName().getIdentifier().equals(oldVariable)) {
javaInfoRoot.getEditor().removeBodyDeclaration(field);
return;
}
}
Assert.fail("Undefine binding field: " + oldVariable);
}
});
} else if (oldFieldState && newFieldState) {
ExecutionUtils.run(javaInfoRoot, new RunnableEx() {
public void run() throws Exception {
for (FieldDeclaration field : rootNode.getFields()) {
VariableDeclarationFragment fragment = DomGenerics.fragments(field).get(0);
if (fragment.getName().getIdentifier().equals(oldVariable)) {
javaInfoRoot.getEditor().setIdentifier(fragment.getName(), newVariable);
return;
}
}
Assert.fail("Undefine binding field: " + oldVariable);
}