Browse Source

REPORT-54308 模板缺失插件设计改进设计器提供配置

final/10.0
vito 3 years ago
parent
commit
ab54e76156
  1. 27
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 12
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  3. 5
      designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

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

@ -199,6 +199,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private DesignerLoginConfigManager designerLoginConfigManager = DesignerLoginConfigManager.getInstance(); private DesignerLoginConfigManager designerLoginConfigManager = DesignerLoginConfigManager.getInstance();
private boolean showTemplateMissingPlugin = true;
/** /**
* DesignerEnvManager. * DesignerEnvManager.
*/ */
@ -621,6 +623,24 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.templateTreePaneExpanded = templateTreePaneExpanded; this.templateTreePaneExpanded = templateTreePaneExpanded;
} }
/**
* 是否提示模板缺少插件
*
* @return 提示返回true
*/
public boolean isShowTemplateMissingPlugin() {
return showTemplateMissingPlugin;
}
/**
* 设置是否提示模板缺少插件
*
* @param showTemplateMissingPlugin 是否提示
*/
public void setShowTemplateMissingPlugin(boolean showTemplateMissingPlugin) {
this.showTemplateMissingPlugin = showTemplateMissingPlugin;
}
/** /**
* 知否自动备份 * 知否自动备份
* *
@ -1792,6 +1812,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.setRecentSelectedConnection(tmpVal); this.setRecentSelectedConnection(tmpVal);
} }
this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false)); this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false));
this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true));
} }
private void readReportPaneAttributions(XMLableReader reader) { private void readReportPaneAttributions(XMLableReader reader) {
@ -2060,6 +2081,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (this.isEmbedServerLazyStartup()) { if (this.isEmbedServerLazyStartup()) {
writer.attr("embedServerLazyStartup", this.isEmbedServerLazyStartup()); writer.attr("embedServerLazyStartup", this.isEmbedServerLazyStartup());
} }
if (!this.isShowTemplateMissingPlugin()) {
writer.attr("showTemplateMissingPlugin", this.isShowTemplateMissingPlugin());
}
writer.end(); writer.end();
} }
@ -2212,6 +2236,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
enum XmlHandler { enum XmlHandler {
Self; Self;
public void handle(Throwable throwable) { public void handle(Throwable throwable) {
ErrorDialog dialog = new ErrorDialog(null, ErrorDialog dialog = new ErrorDialog(null,
Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"),
@ -2232,5 +2257,5 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
dialog.setVisible(true); dialog.setVisible(true);
DesignerExiter.getInstance().execute(); DesignerExiter.getInstance().execute();
} }
}; }
} }

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

@ -40,7 +40,6 @@ import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.Level;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
@ -141,6 +140,8 @@ public class PreferencePane extends BasicPane {
private UIComboBox maxUndoLimit; private UIComboBox maxUndoLimit;
//是非支持自动计算父格 //是非支持自动计算父格
private UICheckBox supportDefaultParentCalculateCheckBox; private UICheckBox supportDefaultParentCalculateCheckBox;
//打开模板是否提示缺少插件
private UICheckBox showTemplateMissingPlugin;
//是否自动转化为公式 //是否自动转化为公式
private UICheckBox supportStringToFormulaBox; private UICheckBox supportStringToFormulaBox;
@ -361,6 +362,11 @@ public class PreferencePane extends BasicPane {
supportDefaultParentCalculateCheckBox = new UICheckBox( supportDefaultParentCalculateCheckBox = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate")); i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate"));
functionPane.add(supportDefaultParentCalculateCheckBox); functionPane.add(supportDefaultParentCalculateCheckBox);
//添加是否展示打开模板提示缺少插件选择项
showTemplateMissingPlugin = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin"));
functionPane.add(showTemplateMissingPlugin);
} }
private void createEditPane(JPanel generalPane) { private void createEditPane(JPanel generalPane) {
@ -644,6 +650,8 @@ public class PreferencePane extends BasicPane {
supportDefaultParentCalculateCheckBox.setSelected(designerEnvManager.isSupportDefaultParentCalculate()); supportDefaultParentCalculateCheckBox.setSelected(designerEnvManager.isSupportDefaultParentCalculate());
showTemplateMissingPlugin.setSelected(designerEnvManager.isShowTemplateMissingPlugin());
supportStringToFormulaBox.setSelected(designerEnvManager.isSupportStringToFormula()); supportStringToFormulaBox.setSelected(designerEnvManager.isSupportStringToFormula());
shortCutLabel.setText(getDisplayShortCut(designerEnvManager.getAutoCompleteShortcuts())); shortCutLabel.setText(getDisplayShortCut(designerEnvManager.getAutoCompleteShortcuts()));
@ -744,6 +752,8 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setSupportDefaultParentCalculate(supportDefaultParentCalculateCheckBox.isSelected()); designerEnvManager.setSupportDefaultParentCalculate(supportDefaultParentCalculateCheckBox.isSelected());
designerEnvManager.setShowTemplateMissingPlugin(showTemplateMissingPlugin.isSelected());
designerEnvManager.setSupportStringToFormula(supportStringToFormulaBox.isSelected()); designerEnvManager.setSupportStringToFormula(supportStringToFormulaBox.isSelected());
designerEnvManager.setDefaultStringToFormula(defaultStringToFormulaBox.isSelected()); designerEnvManager.setDefaultStringToFormula(defaultStringToFormulaBox.isSelected());

5
designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

@ -77,6 +77,11 @@ public class DesignerAppUtils {
* @return 格式化后的多行插件错误信息详情 * @return 格式化后的多行插件错误信息详情
*/ */
public static String dealWithErrorDetailMultiLineAndCache(String key) { public static String dealWithErrorDetailMultiLineAndCache(String key) {
if (!DesignerEnvManager.getEnvManager().isShowTemplateMissingPlugin()) {
// 直接清空不提示
TemplateIOErrorContextHolder.reset();
return StringUtils.EMPTY;
}
Multimap<String, PluginMarkerAdapter> pendingPlugins = TemplateIOErrorContextHolder.getPendingPlugin(); Multimap<String, PluginMarkerAdapter> pendingPlugins = TemplateIOErrorContextHolder.getPendingPlugin();
if (pendingPlugins.isEmpty()) { if (pendingPlugins.isEmpty()) {
return StringUtils.EMPTY; return StringUtils.EMPTY;

Loading…
Cancel
Save