Browse Source

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

final/10.0
vito 3 years ago
parent
commit
ab54e76156
  1. 39
      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

39
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 boolean showTemplateMissingPlugin = true;
/**
* DesignerEnvManager.
*/
@ -315,8 +317,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
}
LogHandler handler = new LogHandler<FileAppender>() {
final FileAppender appender = new FileAppender(
new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"),
fileName
new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"),
fileName
);
@Override
@ -621,6 +623,24 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.templateTreePaneExpanded = templateTreePaneExpanded;
}
/**
* 是否提示模板缺少插件
*
* @return 提示返回true
*/
public boolean isShowTemplateMissingPlugin() {
return showTemplateMissingPlugin;
}
/**
* 设置是否提示模板缺少插件
*
* @param showTemplateMissingPlugin 是否提示
*/
public void setShowTemplateMissingPlugin(boolean showTemplateMissingPlugin) {
this.showTemplateMissingPlugin = showTemplateMissingPlugin;
}
/**
* 知否自动备份
*
@ -1698,7 +1718,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
}
}
private void readComponentReuseNotificationInfo(XMLableReader reader){
private void readComponentReuseNotificationInfo(XMLableReader reader) {
reader.readXMLObject(this.notificationInfo);
}
@ -1792,6 +1812,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.setRecentSelectedConnection(tmpVal);
}
this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false));
this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true));
}
private void readReportPaneAttributions(XMLableReader reader) {
@ -2060,6 +2081,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (this.isEmbedServerLazyStartup()) {
writer.attr("embedServerLazyStartup", this.isEmbedServerLazyStartup());
}
if (!this.isShowTemplateMissingPlugin()) {
writer.attr("showTemplateMissingPlugin", this.isShowTemplateMissingPlugin());
}
writer.end();
}
@ -2212,11 +2236,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
enum XmlHandler {
Self;
public void handle(Throwable throwable) {
ErrorDialog dialog = new ErrorDialog(null,
Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"),
Toolkit.i18nText("Fine-Design_Error_Start_Report"),
throwable.getMessage()) {
Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"),
Toolkit.i18nText("Fine-Design_Error_Start_Report"),
throwable.getMessage()) {
@Override
protected void okEvent() {
dispose();
@ -2232,5 +2257,5 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
dialog.setVisible(true);
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.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.log4j.Level;
import com.fr.transaction.Configurations;
@ -141,6 +140,8 @@ public class PreferencePane extends BasicPane {
private UIComboBox maxUndoLimit;
//是非支持自动计算父格
private UICheckBox supportDefaultParentCalculateCheckBox;
//打开模板是否提示缺少插件
private UICheckBox showTemplateMissingPlugin;
//是否自动转化为公式
private UICheckBox supportStringToFormulaBox;
@ -361,6 +362,11 @@ public class PreferencePane extends BasicPane {
supportDefaultParentCalculateCheckBox = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate"));
functionPane.add(supportDefaultParentCalculateCheckBox);
//添加是否展示打开模板提示缺少插件选择项
showTemplateMissingPlugin = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin"));
functionPane.add(showTemplateMissingPlugin);
}
private void createEditPane(JPanel generalPane) {
@ -644,6 +650,8 @@ public class PreferencePane extends BasicPane {
supportDefaultParentCalculateCheckBox.setSelected(designerEnvManager.isSupportDefaultParentCalculate());
showTemplateMissingPlugin.setSelected(designerEnvManager.isShowTemplateMissingPlugin());
supportStringToFormulaBox.setSelected(designerEnvManager.isSupportStringToFormula());
shortCutLabel.setText(getDisplayShortCut(designerEnvManager.getAutoCompleteShortcuts()));
@ -744,6 +752,8 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setSupportDefaultParentCalculate(supportDefaultParentCalculateCheckBox.isSelected());
designerEnvManager.setShowTemplateMissingPlugin(showTemplateMissingPlugin.isSelected());
designerEnvManager.setSupportStringToFormula(supportStringToFormulaBox.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 格式化后的多行插件错误信息详情
*/
public static String dealWithErrorDetailMultiLineAndCache(String key) {
if (!DesignerEnvManager.getEnvManager().isShowTemplateMissingPlugin()) {
// 直接清空不提示
TemplateIOErrorContextHolder.reset();
return StringUtils.EMPTY;
}
Multimap<String, PluginMarkerAdapter> pendingPlugins = TemplateIOErrorContextHolder.getPendingPlugin();
if (pendingPlugins.isEmpty()) {
return StringUtils.EMPTY;

Loading…
Cancel
Save