Browse Source

REPORT-60897

bugfix/11.0
方磊 3 years ago
parent
commit
abf637fd2a
  1. 16
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java
  3. 14
      designer-form/src/main/java/com/fr/design/widget/ui/designer/PredefinedLayoutPane.java

16
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,7 +207,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private boolean showTemplateMissingPlugin = true;
private boolean useSimpleStyleLayout = false;
private int layoutTemplateStyle = LAYOUT_TEMPLATE_SIMPLE_STYLE;
/**
* DesignerEnvManager.
@ -1693,12 +1695,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.openDebug = openDebug;
}
public boolean isUseSimpleStyleLayout() {
return useSimpleStyleLayout;
public int getLayoutTemplateStyle() {
return layoutTemplateStyle;
}
public void setUseSimpleStyleLayout(boolean useSimpleStyleLayout) {
this.useSimpleStyleLayout = useSimpleStyleLayout;
public void setLayoutTemplateStyle(int layoutTemplateStyle) {
this.layoutTemplateStyle = layoutTemplateStyle;
}
/**
@ -1871,7 +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.setUseSimpleStyleLayout(reader.getAttrAsBoolean("useSimpleStyleLayout", false));
this.setLayoutTemplateStyle(reader.getAttrAsInt("layoutTemplateStyle", LAYOUT_TEMPLATE_SIMPLE_STYLE));
}
private void readReportPaneAttributions(XMLableReader reader) {
@ -2145,7 +2147,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (!this.isShowTemplateMissingPlugin()) {
writer.attr("showTemplateMissingPlugin", this.isShowTemplateMissingPlugin());
}
writer.attr("useSimpleStyleLayout", this.isUseSimpleStyleLayout());
writer.attr("layoutTemplateStyle", this.getLayoutTemplateStyle());
writer.attr("showServerDatasetAuthTip", this.isShowServerDatasetAuthTip());
writer.end();
}

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

@ -51,8 +51,6 @@ import java.util.Map;
public class NewFormPane extends BasicPane {
private static final String EMPTY_FORM_LAYOUTID = "9ebf6aff-ad53-45a9-a175-9633f4162a3a";
private static final int SIMPLE_STYLE_LAYOUT_INDEX = 0;
private static final int REAL_STYLE_LAYOUT_INDEX = 1;
private NewFormModel newFormModel;
private UIDialog dialog;
@ -190,18 +188,14 @@ public class NewFormPane extends BasicPane {
Toolkit.i18nText("Fine-Design_Real_Style_Template")
});
buttonGroup.setPreferredSize(new Dimension(140, 20));
buttonGroup.setSelectedIndex(DesignerEnvManager.getEnvManager().isUseSimpleStyleLayout()? SIMPLE_STYLE_LAYOUT_INDEX : REAL_STYLE_LAYOUT_INDEX);
buttonGroup.setSelectedIndex(DesignerEnvManager.getEnvManager().getLayoutTemplateStyle());
buttonGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int selectedIndex = buttonGroup.getSelectedIndex();
for (PredefinedLayoutPane layoutCard : layoutCards) {
DesignerEnvManager.getEnvManager().setUseSimpleStyleLayout(selectedIndex == SIMPLE_STYLE_LAYOUT_INDEX);
if (selectedIndex == REAL_STYLE_LAYOUT_INDEX) {
layoutCard.showRealStyle();
} else {
layoutCard.showSimpleStyle();
}
DesignerEnvManager.getEnvManager().setLayoutTemplateStyle(selectedIndex);
layoutCard.showCard();
}
}
});

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

@ -40,12 +40,8 @@ public class PredefinedLayoutPane extends JPanel {
this.add(realStyle, 0);
this.add(simpleStyle, 1);
this.setPreferredSize(new Dimension(235, 134));
if (DesignerEnvManager.getEnvManager().isUseSimpleStyleLayout()) {
showSimpleStyle();
} else {
showRealStyle();
}
this.initListener();
this.showCard();
}
protected void initListener() {
@ -90,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