use of com.intellij.uiDesigner.quickFixes.ChangeFieldTypeFix in project intellij-community by JetBrains.
the class MorphAction method updateBoundFieldType.
private static void updateBoundFieldType(final GuiEditor editor, final RadComponent oldComponent, final ComponentItem targetItem) {
PsiField oldBoundField = BindingProperty.findBoundField(editor.getRootContainer(), oldComponent.getBinding());
if (oldBoundField != null) {
final PsiElementFactory factory = JavaPsiFacade.getInstance(editor.getProject()).getElementFactory();
try {
PsiType componentType = factory.createTypeFromText(targetItem.getClassName().replace('$', '.'), null);
new ChangeFieldTypeFix(editor, oldBoundField, componentType).run();
} catch (IncorrectOperationException e) {
LOG.error(e);
}
}
}
Aggregations