use of com.intellij.uiDesigner.lw.IRootContainer in project intellij-community by JetBrains.
the class CustomCreateProperty method setValueImpl.
protected void setValueImpl(final RadComponent component, final Boolean value) throws Exception {
if (value.booleanValue() && component.getBinding() == null) {
String initialBinding = BindingProperty.getDefaultBinding(component);
String binding = Messages.showInputDialog(component.getProject(), UIDesignerBundle.message("custom.create.field.name.prompt"), UIDesignerBundle.message("custom.create.title"), Messages.getQuestionIcon(), initialBinding, new IdentifierValidator(component.getProject()));
if (binding == null) {
return;
}
try {
new BindingProperty(component.getProject()).setValue(component, binding);
} catch (Exception e1) {
LOG.error(e1);
}
}
component.setCustomCreate(value.booleanValue());
if (value.booleanValue()) {
final IRootContainer root = FormEditingUtil.getRoot(component);
if (root.getClassToBind() != null && Utils.getCustomCreateComponentCount(root) == 1) {
final PsiClass aClass = FormEditingUtil.findClassToBind(component.getModule(), root.getClassToBind());
if (aClass != null && FormEditingUtil.findCreateComponentsMethod(aClass) == null) {
generateCreateComponentsMethod(aClass);
}
}
}
}
Aggregations