Browse Source

REPORT-14865 更新日志推送=>“自动推送更新”开关

research/10.0
plough 6 years ago
parent
commit
d91986a8a9
  1. 30
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 17
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  3. 28
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java

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

@ -139,6 +139,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
//记录当前激活码的在线激活状态. //记录当前激活码的在线激活状态.
private int activeKeyStatus = -1; private int activeKeyStatus = -1;
private boolean joinProductImprove = true; private boolean joinProductImprove = true;
private boolean automaticPushUpdate = true;
//最近使用的颜色 //最近使用的颜色
private ColorSelectConfigManager configManager = new ColorSelectConfigManager(); private ColorSelectConfigManager configManager = new ColorSelectConfigManager();
/** /**
@ -689,6 +690,30 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.joinProductImprove = joinProductImprove; this.joinProductImprove = joinProductImprove;
} }
/**
* 是否开启自动更新推送
*
* @return 是否开启自动更新推送
*/
public boolean isAutomaticPushUpdate() {
return automaticPushUpdate;
}
/**
* 设置开启/关闭自动更新推送
*/
public void setAutomaticPushUpdate(boolean automaticPushUpdate) {
this.automaticPushUpdate = automaticPushUpdate;
}
/**
* @return "自动更新推送"选项是否生效
*/
public boolean isAutomaticPushUpdateValid() {
// 远程设计和非中文环境,都不生效
return WorkContext.getCurrent().isLocal() && GeneralContext.isChineseEnv();
}
/** /**
* 是否磁盘空间参数 * 是否磁盘空间参数
* *
@ -1534,6 +1559,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.setOracleSystemSpace(reader.getAttrAsBoolean("useOracleSystemSpace", true)); this.setOracleSystemSpace(reader.getAttrAsBoolean("useOracleSystemSpace", true));
this.setCachingTemplateLimit(reader.getAttrAsInt("cachingTemplateLimit", CACHINGTEMPLATE_LIMIT)); this.setCachingTemplateLimit(reader.getAttrAsInt("cachingTemplateLimit", CACHINGTEMPLATE_LIMIT));
this.setJoinProductImprove(reader.getAttrAsBoolean("joinProductImprove", true)); this.setJoinProductImprove(reader.getAttrAsBoolean("joinProductImprove", true));
this.setAutomaticPushUpdate(reader.getAttrAsBoolean("automaticPushUpdate", true));
this.setImageCompress(reader.getAttrAsBoolean("imageCompress", true)); this.setImageCompress(reader.getAttrAsBoolean("imageCompress", true));
this.setAutoBackUp(reader.getAttrAsBoolean("autoBackUp", true)); this.setAutoBackUp(reader.getAttrAsBoolean("autoBackUp", true));
this.setTemplateTreePaneExpanded(reader.getAttrAsBoolean("templateTreePaneExpanded", false)); this.setTemplateTreePaneExpanded(reader.getAttrAsBoolean("templateTreePaneExpanded", false));
@ -1771,6 +1797,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (!this.isJoinProductImprove()) { if (!this.isJoinProductImprove()) {
writer.attr("joinProductImprove", this.isJoinProductImprove()); writer.attr("joinProductImprove", this.isJoinProductImprove());
} }
if (!this.isAutomaticPushUpdate()) {
writer.attr("automaticPushUpdate", this.isAutomaticPushUpdate());
}
if (!this.isImageCompress()) { if (!this.isImageCompress()) {
writer.attr("imageCompress", this.isImageCompress()); writer.attr("imageCompress", this.isImageCompress());
} }
@ -1898,5 +1927,4 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
.attr("undoLimit", this.getUndoLimit()) .attr("undoLimit", this.getUndoLimit())
.end(); .end();
} }
} }

17
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -23,7 +23,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
@ -132,6 +131,7 @@ public class PreferencePane extends BasicPane {
private UICheckBox oracleSpace; private UICheckBox oracleSpace;
private UISpinner cachingTemplateSpinner; private UISpinner cachingTemplateSpinner;
private UICheckBox joinProductImprove; private UICheckBox joinProductImprove;
private UICheckBox automaticPushUpdate;
public PreferencePane() { public PreferencePane() {
this.initComponents(); this.initComponents();
@ -149,7 +149,6 @@ public class PreferencePane extends BasicPane {
jtabPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Advanced"), advancePane); jtabPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Advanced"), advancePane);
contentPane.add(jtabPane, BorderLayout.NORTH); contentPane.add(jtabPane, BorderLayout.NORTH);
createFunctionPane(generalPane); createFunctionPane(generalPane);
createEditPane(generalPane); createEditPane(generalPane);
createGuiOfGridPane(generalPane); createGuiOfGridPane(generalPane);
@ -171,10 +170,15 @@ public class PreferencePane extends BasicPane {
oracleSpace = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Show_All_Oracle_Tables")); oracleSpace = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Show_All_Oracle_Tables"));
oraclePane.add(oracleSpace); oraclePane.add(oracleSpace);
JPanel improvePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Product_Improve")); JPanel improvePane = FRGUIPaneFactory.createVerticalTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Product_Improve"));
joinProductImprove = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Join_Product_Improve")); joinProductImprove = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Join_Product_Improve"));
improvePane.add(joinProductImprove); improvePane.add(joinProductImprove);
if (DesignerEnvManager.getEnvManager().isAutomaticPushUpdateValid()) {
automaticPushUpdate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Automatic_Push_Update"));
improvePane.add(automaticPushUpdate);
}
JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
spaceUpPane.add(oraclePane, BorderLayout.NORTH); spaceUpPane.add(oraclePane, BorderLayout.NORTH);
spaceUpPane.add(createMemoryPane(), BorderLayout.CENTER); spaceUpPane.add(createMemoryPane(), BorderLayout.CENTER);
@ -553,6 +557,10 @@ public class PreferencePane extends BasicPane {
this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace()); this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace());
this.cachingTemplateSpinner.setValue(designerEnvManager.getCachingTemplateLimit()); this.cachingTemplateSpinner.setValue(designerEnvManager.getCachingTemplateLimit());
this.joinProductImprove.setSelected(designerEnvManager.isJoinProductImprove()); this.joinProductImprove.setSelected(designerEnvManager.isJoinProductImprove());
if (designerEnvManager.isAutomaticPushUpdateValid()) {
this.automaticPushUpdate.setSelected(designerEnvManager.isAutomaticPushUpdate());
}
} }
private int chooseCase(int sign) { private int chooseCase(int sign) {
@ -612,6 +620,9 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setOracleSystemSpace(this.oracleSpace.isSelected()); designerEnvManager.setOracleSystemSpace(this.oracleSpace.isSelected());
designerEnvManager.setCachingTemplateLimit((int) this.cachingTemplateSpinner.getValue()); designerEnvManager.setCachingTemplateLimit((int) this.cachingTemplateSpinner.getValue());
designerEnvManager.setJoinProductImprove(this.joinProductImprove.isSelected()); designerEnvManager.setJoinProductImprove(this.joinProductImprove.isSelected());
if (designerEnvManager.isAutomaticPushUpdateValid()) {
designerEnvManager.setAutomaticPushUpdate(this.automaticPushUpdate.isSelected());
}
designerEnvManager.setUndoLimit(maxUndoLimit.getSelectedIndex() * SELECTED_INDEX_5); designerEnvManager.setUndoLimit(maxUndoLimit.getSelectedIndex() * SELECTED_INDEX_5);
if (maxUndoLimit.getSelectedIndex() == SELECTED_INDEX_5) { if (maxUndoLimit.getSelectedIndex() == SELECTED_INDEX_5) {

28
designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java

@ -3,8 +3,16 @@ package com.fr.design.layout;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.LayoutManager;
public class FRGUIPaneFactory { public class FRGUIPaneFactory {
@ -143,6 +151,22 @@ public class FRGUIPaneFactory {
return jp; return jp;
} }
/**
* 创建一个带标题边框面板垂直居左布局
*
* @param string 边框标题
* @return JPanel对象
*/
public static JPanel createVerticalTitledBorderPane(String string) {
JPanel jp = new JPanel();
UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string);
jp.setBorder(explainBorder);
VerticalFlowLayout layout = new VerticalFlowLayout();
layout.setAlignLeft(true);
jp.setLayout(layout);
return jp;
}
/** /**
* 创建一个带标题边框面板并且居中显示 * 创建一个带标题边框面板并且居中显示
* *

Loading…
Cancel
Save