|
|
|
@ -15,6 +15,7 @@ import com.fr.design.mainframe.DesignerContext;
|
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.form.main.Form; |
|
|
|
|
import com.fr.form.ui.container.WBorderLayout; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
@ -264,13 +265,12 @@ public class NewFormPane extends BasicPane {
|
|
|
|
|
private void newForm(String path) { |
|
|
|
|
BaseJForm jForm; |
|
|
|
|
try { |
|
|
|
|
Form form = new Form(new WBorderLayout("form")); |
|
|
|
|
if (StringUtils.isNotEmpty(path)) { |
|
|
|
|
Form form = new Form(); |
|
|
|
|
form.readStream(NewFormPane.class.getResourceAsStream(path)); |
|
|
|
|
jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, new Object[]{form}, BaseJForm.class); |
|
|
|
|
} else { |
|
|
|
|
jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, BaseJForm.class); |
|
|
|
|
form = (Form) form.cloneAsLayoutTemplate(); |
|
|
|
|
} |
|
|
|
|
jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, new Object[]{form}, BaseJForm.class); |
|
|
|
|
DesignerContext.getDesignerFrame().addAndActivateJTemplate((JTemplate<?, ?>) jForm); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|