use of com.servoy.j2db.solutionmodel.ISMForm in project servoy-client by Servoy.
the class JSSolutionModel method newFormInternal.
/**
* @param name
* @param superForm
* @param isResponsive
* @return
*/
private JSForm newFormInternal(String name, ISMForm superForm, Boolean isResponsive) {
if (superForm == null) {
throw new IllegalArgumentException("superForm cannot be null");
}
if (isResponsive != null && (superForm.isResponsiveLayout() || superForm.getParts().length > 0)) {
throw new IllegalArgumentException("Cannot set the layout type of the child form because the superform '" + superForm.getName() + "' is not a logical form.");
}
try {
Form form = createNewForm(null, name, null, superForm.getShowInMenu(), ((JSForm) superForm).getSupportChild().getSize());
if (isResponsive != null)
form.setResponsiveLayout(isResponsive.booleanValue());
form.clearProperty(StaticContentSpecLoader.PROPERTY_DATASOURCE.getPropertyName());
application.getFormManager().addForm(form, false);
form.setExtendsID(((JSForm) superForm).getSupportChild().getID());
return instantiateForm(form, true);
} catch (RepositoryException e) {
throw new RuntimeException(e);
}
}
Aggregations