|
|
|
@ -56,6 +56,9 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
|
|
|
|
|
|
|
|
|
|
final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); |
|
|
|
|
mobileAttrPane.populateBean(mobileAttr); |
|
|
|
|
|
|
|
|
|
final boolean oldMobileOnly = mobileAttr.isMobileOnly(); |
|
|
|
|
final boolean oldAdaptive = mobileAttr.isAdaptivePropertyAutoMatch(); |
|
|
|
|
BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void doOk() { |
|
|
|
@ -75,11 +78,16 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
|
|
|
|
|
recordFunction(); |
|
|
|
|
// 设置移动端属性并刷新界面
|
|
|
|
|
formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后
|
|
|
|
|
boolean changeSize = (!oldMobileOnly && formMobileAttr.isMobileOnly()) || (oldMobileOnly && !formMobileAttr.isMobileOnly()); |
|
|
|
|
if (changeSize) { |
|
|
|
|
((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); |
|
|
|
|
} |
|
|
|
|
jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); |
|
|
|
|
//改变布局为自适应布局,只在移动端属性设置保存后改变一次
|
|
|
|
|
boolean changeLayout = !oldAdaptive && formMobileAttr.isAdaptivePropertyAutoMatch(); |
|
|
|
|
if (changeLayout) { |
|
|
|
|
doChangeBodyLayout(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
WidgetPropertyPane.getInstance().refreshDockingView(); |
|
|
|
|
jf.fireTargetModified(); |
|
|
|
|
} |
|
|
|
@ -87,6 +95,10 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
|
|
|
|
|
dialog.setVisible(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isAttrChange(boolean oldValue, boolean newValue) { |
|
|
|
|
return !oldValue && newValue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void doChangeBodyLayout(){ |
|
|
|
|
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
|
XLayoutContainer rootLayout = formDesigner.getRootComponent(); |
|
|
|
|