Browse Source

Pull request #6247: REPORT-60897 【固定布局-原布局推荐4.1】新建表单布局模板,切换视图类型没有保存到本地

Merge in DESIGN/design from ~FANGLEI/design10.0:release/11.0 to release/11.0

* commit 'abf637fd2a5f1fbacf6719fea4e8b7f5ed7872aa':
  REPORT-60897
  REPORT-60897 【固定布局-原布局推荐4.1】决策报表-自适应布局-布局推荐弹窗右上方的简约视图和真实视图,交互设计预期是一开始默认是简约视图,且记录用户的选择,下次打开时显示上次的选择;现在效果是默认真实,且没有记录
bugfix/11.0
fanglei 3 years ago
parent
commit
92300f8af4
  1. 14
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java
  3. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/PredefinedLayoutPane.java

14
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -91,6 +91,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private static final String VERSION100 = "100";
private static final int CACHINGTEMPLATE_LIMIT = 5;
private static final String WEB_NAME = "webapps";
public static final int LAYOUT_TEMPLATE_SIMPLE_STYLE = 0;
public static final int LAYOUT_TEMPLATE_REAL_STYLE = 1;
/**
* 指定默认工作空间
*/
@ -205,6 +207,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private boolean showTemplateMissingPlugin = true;
private int layoutTemplateStyle = LAYOUT_TEMPLATE_SIMPLE_STYLE;
/**
* DesignerEnvManager.
*/
@ -1691,6 +1695,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.openDebug = openDebug;
}
public int getLayoutTemplateStyle() {
return layoutTemplateStyle;
}
public void setLayoutTemplateStyle(int layoutTemplateStyle) {
this.layoutTemplateStyle = layoutTemplateStyle;
}
/**
* Read XML.<br>
* The method will be invoked when read data from XML file.<br>
@ -1861,6 +1873,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false));
this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true));
this.setShowServerDatasetAuthTip(reader.getAttrAsBoolean("showServerDatasetAuthTip", true));
this.setLayoutTemplateStyle(reader.getAttrAsInt("layoutTemplateStyle", LAYOUT_TEMPLATE_SIMPLE_STYLE));
}
private void readReportPaneAttributions(XMLableReader reader) {
@ -2134,6 +2147,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (!this.isShowTemplateMissingPlugin()) {
writer.attr("showTemplateMissingPlugin", this.isShowTemplateMissingPlugin());
}
writer.attr("layoutTemplateStyle", this.getLayoutTemplateStyle());
writer.attr("showServerDatasetAuthTip", this.isShowServerDatasetAuthTip());
writer.end();
}

10
designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer;
import com.fr.base.iofile.attr.TemplateLayoutIdAttrMark;
import com.fr.design.DesignerEnvManager;
import com.fr.design.border.UITitledMatteBorder;
import com.fr.design.designer.beans.PredefinedLayout;
import com.fr.design.designer.beans.models.NewFormModel;
@ -187,17 +188,14 @@ public class NewFormPane extends BasicPane {
Toolkit.i18nText("Fine-Design_Real_Style_Template")
});
buttonGroup.setPreferredSize(new Dimension(140, 20));
buttonGroup.setSelectedIndex(1);
buttonGroup.setSelectedIndex(DesignerEnvManager.getEnvManager().getLayoutTemplateStyle());
buttonGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int selectedIndex = buttonGroup.getSelectedIndex();
for (PredefinedLayoutPane layoutCard : layoutCards) {
if (selectedIndex == 1) {
layoutCard.showRealStyle();
} else {
layoutCard.showSimpleStyle();
}
DesignerEnvManager.getEnvManager().setLayoutTemplateStyle(selectedIndex);
layoutCard.showCard();
}
}
});

10
designer-form/src/main/java/com/fr/design/widget/ui/designer/PredefinedLayoutPane.java

@ -2,6 +2,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.base.GraphHelper;
import com.fr.base.svg.IconUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.designer.beans.PredefinedLayout;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.share.ui.base.MouseClickListener;
@ -40,6 +41,7 @@ public class PredefinedLayoutPane extends JPanel {
this.add(simpleStyle, 1);
this.setPreferredSize(new Dimension(235, 134));
this.initListener();
this.showCard();
}
protected void initListener() {
@ -84,6 +86,14 @@ public class PredefinedLayoutPane extends JPanel {
this.clickListener = clickListener;
}
public void showCard() {
if (DesignerEnvManager.getEnvManager().getLayoutTemplateStyle() == DesignerEnvManager.LAYOUT_TEMPLATE_SIMPLE_STYLE) {
showSimpleStyle();
} else if (DesignerEnvManager.getEnvManager().getLayoutTemplateStyle() == DesignerEnvManager.LAYOUT_TEMPLATE_REAL_STYLE) {
showRealStyle();
}
}
public void showSimpleStyle() {
cardLayout.last(this);
}

Loading…
Cancel
Save