Browse Source

Merge branch 'feature/10.0' of ssh://code.fineres.com:7999/~kerry/design_10.0 into feature/10.0

feature/10.0
kerry 3 years ago
parent
commit
7542dcf751
  1. 27
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 30
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  3. 277
      designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java
  4. 17
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  5. 17
      designer-base/src/main/java/com/fr/design/dialog/link/MessageWithLink.java
  6. 3
      designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java
  7. 1
      designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java
  8. 18
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java
  9. 12
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java
  10. 31
      designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java
  11. 154
      designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java
  12. 32
      designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java
  13. 7
      designer-base/src/main/java/com/fr/design/mod/ModClassFilter.java
  14. 36
      designer-base/src/main/java/com/fr/design/mod/impl/change/DSColumnContentChange.java
  15. 34
      designer-base/src/main/java/com/fr/design/mod/impl/change/FormHyperlinkContentChange.java
  16. 34
      designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java
  17. 34
      designer-base/src/main/java/com/fr/design/mod/impl/change/SimpleDSColumnContentChange.java
  18. 36
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CardSwitchButtonContentChange.java
  19. 37
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellExpandAttrContentChange.java
  20. 35
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellGUIAttrContentChange.java
  21. 37
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaConditionContentChange.java
  22. 9
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaContentChange.java
  23. 37
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaDictionaryContentChange.java
  24. 38
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaHFElementContentChange.java
  25. 38
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaPresentContentChange.java
  26. 35
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FunctionGrouperContentChange.java
  27. 37
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/RichCharContentChange.java
  28. 35
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/SelectCountContentChange.java
  29. 35
      designer-base/src/main/java/com/fr/design/mod/impl/change/formula/WidgetTitleContentChange.java
  30. 23
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4TableDataNameContentReplacer.java
  31. 19
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4WidgetNameContentReplacer.java
  32. 20
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormHyperlinkContentReplacer.java
  33. 22
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/Formula4TableDataNameContentReplacer.java
  34. 21
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/Formula4WidgetNameContentReplacer.java
  35. 247
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormulaReplacer.java
  36. 17
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java
  37. 20
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/SimpleDSColumnContentReplacer.java
  38. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  39. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  40. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  41. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  42. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  43. BIN
      designer-base/src/main/resources/com/fr/design/images/lookandfeel/TipIcon.png
  44. BIN
      designer-base/src/main/resources/com/fr/design/images/m_file/preview_sql.png
  45. 65
      designer-base/src/test/java/com/fr/design/mod/ContentReplaceUtilTest.java
  46. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java
  47. 14
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  48. 16
      designer-realize/src/main/java/com/fr/design/share/SharableInitManager.java
  49. 49
      designer-realize/src/main/java/com/fr/design/share/SharableManager.java
  50. 2
      designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java
  51. 5
      designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java
  52. 2
      designer-realize/src/main/java/com/fr/start/MainDesigner.java
  53. 4
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

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

@ -15,21 +15,19 @@ import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.design.env.RemoteDesignerWorkspaceInfo;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.DesignerPortProvider;
import com.fr.design.i18n.Toolkit;
import com.fr.design.locale.impl.ProductImproveMark;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.notification.SnapChatConfig;
import com.fr.design.port.DesignerPortContext;
import com.fr.design.update.push.DesignerPushUpdateConfigManager;
import com.fr.design.style.color.ColorSelectConfigManager;
import com.fr.design.update.push.DesignerPushUpdateConfigManager;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.DesignerPort;
import com.fr.exit.DesignerExiter;
import com.fr.file.FILEFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogFormatter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.SupportLocale;
@ -37,15 +35,14 @@ import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import com.fr.general.xml.GeneralXMLTools;
import com.fr.log.FineLoggerFactory;
import com.fr.log.LogHandler;
import com.fr.stable.CommonUtils;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.ListMap;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.core.UUID;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.xml.XMLPrintWriter;
@ -53,6 +50,7 @@ import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLWriter;
import com.fr.stable.xml.XMLableReader;
import com.fr.third.apache.log4j.FileAppender;
import com.fr.third.org.apache.commons.io.FilenameUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback;
@ -79,8 +77,6 @@ import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
/**
* The manager of Designer GUI.
@ -309,14 +305,23 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
calender.setTimeInMillis(System.currentTimeMillis());
String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH);
String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log");
final String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log");
if (!new File(fileName).exists()) {
StableUtils.makesureFileExist(new File(fileName));
}
Handler handler = new FileHandler(fileName, true);
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
);
@Override
public FileAppender getHandler() {
return appender;
}
};
handler.setFormatter(new FRLogFormatter());
FineLoggerFactory.getLogger().addLogHandler(handler);
FineLoggerFactory.getLogger().addLogAppender(handler);
} catch (SecurityException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (IOException e) {

30
designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java

@ -6,7 +6,7 @@ package com.fr.design.data.datapane.connect;
import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.operator.DataOperator;
import com.fr.data.operator.DataOperatorProvider;
import com.fr.data.solution.ExceptionSolutionSelector;
import com.fr.data.solution.entity.DriverPage;
import com.fr.data.solution.processor.ClassNotFoundExceptionSolutionProcessor;
@ -22,9 +22,12 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
@ -93,7 +96,26 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
Connection database = DatabaseConnectionPane.this.updateBean();
// 返回连接结果
DriverPage.updateCache();
DataOperator.getInstance().testConnectionWithException(database);
final Exception[] exception = new Exception[1];
WorkContext.getCurrent().get(DataOperatorProvider.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
// 正常调用发生的异常也会被捕获,因此需要对异常类型进行判断,如果是NoSuchMethodException 就要去调用 testConnection
// 如果不是 NoSuchMethodException 保存下异常上下文
// 两种情况下异常都需要抛出
if (exceptionInfo.getException() instanceof NoSuchMethodException) {
if (!WorkContext.getCurrent().get(DataOperatorProvider.class).testConnection(database)) {
exception[0] = new Exception(Toolkit.i18nText("Fine-Design_Description_Of_Test_Connection"));
}
} else {
exception[0] = exceptionInfo.getException();
}
return null;
}
}).testConnectionWithException(database);
if (exception[0] != null) {
throw exception[0];
}
return null;
}
@ -114,8 +136,8 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
okButton.setEnabled(true);
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
message.setText(Toolkit.i18nText("Fine-Design_Basic_Connection_Failed"));
SolutionProcessor select = ExceptionSolutionSelector.get().select(e);
Connection database = DatabaseConnectionPane.this.updateBean();
SolutionProcessor select = ExceptionSolutionSelector.get().select(e, database);
if (select instanceof ClassNotFoundExceptionSolutionProcessor) {
JPanel gridJpanel = new JPanel();
gridJpanel.setLayout(new GridLayout(5, 1, 0, 5));

277
designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java

@ -0,0 +1,277 @@
package com.fr.design.data.datapane.preview.sql;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.base.ParameterMapNameSpace;
import com.fr.data.impl.DBTableData;
import com.fr.data.impl.EscapeSqlHelper;
import com.fr.data.operator.DataOperator;
import com.fr.decision.webservice.v10.config.ConfigService;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.parameter.ParameterInputPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.injectable.PluginModule;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import com.fr.stable.fun.TableDataProvider;
import com.fr.stable.plugin.ExtraClassManagerProvider;
import com.fr.stable.script.NameSpace;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.UIManager;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultHighlighter;
import javax.swing.text.Highlighter;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Frame;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
private JPanel topPanel;
private JPanel centerPanel;
private JPanel bottomPanel;
private UILabel imageLabel;
public PreviewPerformedSqlPane(Frame frame, String sql) {
this(frame, sql, null, null, false);
}
public PreviewPerformedSqlPane(Frame frame, String sql, List<int[]> selectedSpecialCharIndex, String[] selectedSpecialChar, boolean highlight) {
super(frame, true);
// 提示信息
topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
JPanel imagePanel = new JPanel();
JPanel messagePanel;
if (isShowSpecialCharSqlPane(selectedSpecialCharIndex)) {
imageLabel = new UILabel(UIManager.getIcon("OptionPane.warningIcon"));
messagePanel = new JPanel();
messagePanel.setLayout(FRGUIPaneFactory.createBorderLayout());
messagePanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0));
// 日韩取消超链,直接显示文字
if (isNotShowLink()) {
JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql_Message") + Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention") + Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Back_Message"));
messagePanel.add(label);
} else {
MessageWithLink message = new MessageWithLink(Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Front_Message"), Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention"), CloudCenter.getInstance().acquireConf(Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention_Help"), "https://help.fanruan.com/finereport/doc-view-2219.html"), Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Back_Message"));
messagePanel.add(message);
}
// 提示图标
JPanel tipPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
UILabel tipLabel = new UILabel(UIManager.getIcon("OptionPane.tipIcon"));
StringBuilder textBuilder = new StringBuilder();
textBuilder.append("<html>").append(Toolkit.i18nText("Fine-Design_Basic_Processed_Special_Char")).append("<br/>");
for (String sChar : selectedSpecialChar) {
textBuilder.append(sChar).append("<br/>");
}
textBuilder.append("</html>");
tipLabel.setToolTipText(textBuilder.toString());
tipPanel.add(tipLabel, BorderLayout.SOUTH);
topPanel.add(tipPanel, BorderLayout.EAST);
} else {
imageLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon"));
messagePanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql_Message"));
messagePanel.add(label);
}
imagePanel.add(imageLabel);
topPanel.add(imagePanel, BorderLayout.WEST);
topPanel.add(messagePanel, BorderLayout.CENTER);
topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,0,10));
//中间的SQL面板
centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
centerPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
JScrollPane scrollPane = new JScrollPane();
JTextArea checkArea = new JTextArea(sql);
checkArea.setEditable(false);
checkArea.setCursor(new Cursor(Cursor.TEXT_CURSOR));
if (highlight) {
Highlighter highLighter = checkArea.getHighlighter();
DefaultHighlighter.DefaultHighlightPainter p = new DefaultHighlighter.DefaultHighlightPainter(Color.ORANGE);
for (int[] specialCharIndex : selectedSpecialCharIndex) {
try {
highLighter.addHighlight(specialCharIndex[0], specialCharIndex[1], p);
} catch (BadLocationException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
scrollPane.setViewportView(checkArea);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
centerPanel.add(scrollPane);
//底部的按钮面板
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
okButton.addActionListener(this);
bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
bottomPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
bottomPanel.add(okButton, BorderLayout.EAST);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql"));
this.setResizable(false);
this.add(topPanel, BorderLayout.NORTH);
this.add(centerPanel, BorderLayout.CENTER);
this.add(bottomPanel, BorderLayout.SOUTH);
this.setSize(600, 400);
GUICoreUtils.centerWindow(this);
}
private boolean isNotShowLink() {
return GeneralContext.getLocale().equals(Locale.JAPAN) || GeneralContext.getLocale().equals(Locale.KOREA);
}
public static void previewPerformedSql(DBTableData tableData) {
Calculator calculator = Calculator.createCalculator();
//参数
ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tableData);
if (ArrayUtils.isEmpty(parameters)) {
parameters = tableData.getParameters(calculator);
}
Map<String, Object> parameterMap = new HashMap<>();
if (needInputParams(parameters)) {
showParaWindow(parameterMap, parameters);
} else {
for (ParameterProvider parameter : parameters) {
parameterMap.put(parameter.getName(), parameter.getValue());
}
}
boolean showOriginSql = true;
for (ParameterProvider parameter : DataOperator.getInstance().getTableDataParameters(tableData)) {
if (parameterMap.containsKey(parameter.getName())) {
Object value = parameterMap.get(parameter.getName());
if (value != null && !StringUtils.EMPTY.equals(value)) {
showOriginSql = false;
}
parameter.setValue(value);
}
}
String sql;
// 计算高亮文本位置
List<int[]> specialCharParamIndex = null;
boolean highlight = true;
if (showOriginSql) {
sql = tableData.getQuery();
} else {
NameSpace ns = ParameterMapNameSpace.create(parameterMap);
calculator.pushNameSpace(ns);
Parameter[] paras = processParameters(tableData, calculator);
// 所有被转义参数的集合
Set<String> specialCharParam = EscapeSqlHelper.getInstance().getSpecialCharParam(paras);
// 将参数转义等
Set<TableDataProvider> tableDataProviders = getTableDataProviders();
for (TableDataProvider provider : tableDataProviders) {
provider.processParametersBeforeAnalyzeSQL(paras, calculator);
}
if (!specialCharParam.isEmpty()) {
specialCharParamIndex = ParameterHelper.analyzeCurrentContextTableData4Template(tableData.getQuery(), paras, specialCharParam);
}
String oldSql = ParameterHelper.analyzeCurrentContextTableData4Templatee(tableData.getQuery(), paras);
sql = processExtraSQL(paras, oldSql, calculator, tableDataProviders);
if (!StringUtils.equals(oldSql, sql)) {
highlight = false;
}
}
// sql内容复制到剪切板
StringSelection selection = new StringSelection(sql);
java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection);
// 弹窗
PreviewPerformedSqlPane pane;
if (isShowSpecialCharSqlPane(specialCharParamIndex)) {
pane = new PreviewPerformedSqlPane(DesignerContext.getDesignerFrame(), sql, specialCharParamIndex, ConfigService.getInstance().getPSIConfig().getSelectedSpecialChar(), highlight);
} else {
pane = new PreviewPerformedSqlPane(DesignerContext.getDesignerFrame(), sql);
}
pane.setVisible(true);
}
private static boolean isShowSpecialCharSqlPane(List<int[]> specialCharParamIndex) {
return specialCharParamIndex != null && !specialCharParamIndex.isEmpty();
}
private static Parameter[] processParameters(DBTableData tableData, Calculator calculator) {
ParameterProvider[] parameters = tableData.getParameters();
if (parameters == null || parameters.length == 0) {
tableData.setParameters(ParameterHelper.analyze4Parameters(tableData.getQuery(), false));
return new Parameter[0];
}
return Parameter.providers2Parameter(Calculator.processParameters(calculator, parameters));
}
private static String processExtraSQL(Parameter[] ps, String sql, Calculator ca, Set<TableDataProvider> tableDataProviders) {
for (TableDataProvider provider : tableDataProviders) {
String newSql = provider.processTableDataSQL(ps, sql, ca);
if (StringUtils.isNotEmpty(newSql)) {
sql = newSql;
}
}
return sql;
}
private static boolean needInputParams(ParameterProvider[] parameters) {
if (ArrayUtils.isNotEmpty(parameters)) {
return true;
}
for (ParameterProvider parameter : parameters) {
if (parameter.getValue() == null || StringUtils.EMPTY.equals(parameter.getValue())) {
return true;
}
}
return false;
}
private static void showParaWindow(final Map<String, Object> parameterMap, ParameterProvider[] inParameters) {
final ParameterInputPane pPane = new ParameterInputPane(inParameters);
pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
parameterMap.putAll(pPane.update());
}
}).setVisible(true);
}
private static Set<TableDataProvider> getTableDataProviders() {
ExtraClassManagerProvider classManagerProvider = PluginModule.getAgent(PluginModule.ExtraCore);
if (classManagerProvider == null) {
return new HashSet<>();
}
return classManagerProvider.getArray(TableDataProvider.XML_TAG, EscapeSqlHelper.getInstance());
}
@Override
public void actionPerformed(ActionEvent e) {
this.dispose();
}
}

17
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -16,6 +16,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.data.datapane.connect.ConnectionTableProcedurePane;
import com.fr.design.data.datapane.connect.ConnectionTableProcedurePane.DoubleClickSelectedNodeOnTreeListener;
import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.datapane.preview.sql.PreviewPerformedSqlPane;
import com.fr.design.data.datapane.sqlpane.SQLEditPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
@ -35,6 +36,7 @@ import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.ParameterUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.general.sql.SqlUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.script.Calculator;
@ -227,6 +229,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
// p:工具栏.
ToolBarDef toolBarDef = new ToolBarDef();
toolBarDef.addShortCut(new PreviewAction());
toolBarDef.addShortCut(new PreviewPerformedSQLAction());
toolBarDef.addShortCut(SeparatorDef.DEFAULT);
toolBarDef.addShortCut(new EditPageQueryAction());
dbTableDataMenuHandler = ExtraDesignClassManager.getInstance().getSingle(DBTableDataMenuHandler.MARK_STRING);
@ -368,6 +371,20 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
}
}
private class PreviewPerformedSQLAction extends UpdateAction {
public PreviewPerformedSQLAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_file/preview_sql.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
checkParameter();
PreviewPerformedSqlPane.previewPerformedSql(DBTableDataPane.this.updateBean());
}
}
private class EditPageQueryAction extends UpdateAction {
public EditPageQueryAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Layer_Page_Report_Page_Query"));

17
designer-base/src/main/java/com/fr/design/dialog/link/MessageWithLink.java

@ -3,13 +3,14 @@ package com.fr.design.dialog.link;
import com.fr.design.gui.ilable.UILabel;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import java.awt.Color;
import java.awt.Desktop;
import java.awt.Font;
import java.net.URI;
import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
/**
* 用来构建JOptionPane带超链的消息提示
@ -35,8 +36,16 @@ public class MessageWithLink extends JEditorPane {
this(message, linkName, link, color, LABEL.getFont());
}
public MessageWithLink(String frontMessage, String linkName, String link, String backMessage) {
this(frontMessage, linkName, link, backMessage, LABEL.getBackground(), LABEL.getFont());
}
public MessageWithLink(String message, String linkName, String link, Color color, Font font) {
super("text/html", "<html><body style=\"" + generateStyle(color, font) + "\">" + message + "<a href=\"" + link + "\">" + linkName + "</a>" + "</body></html>");
this(message, linkName, link, StringUtils.EMPTY, color, font);
}
public MessageWithLink(String frontMessage, String linkName, String link, String backMessage, Color color, Font font) {
super("text/html", "<html><body style=\"" + generateStyle(color, font) + "\">" + frontMessage + "<a href=\"" + link + "\">" + linkName + "</a>" + backMessage + "</body></html>");
initListener(link);
setEditable(false);
setBorder(null);

3
designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java

@ -5,6 +5,8 @@ import java.util.HashSet;
import java.util.Set;
/**
* classloader查找过滤器
*
* 过滤无需遍历的jdk class
*
* @author hades
@ -26,6 +28,7 @@ public class ClassFilter implements Filter<String> {
FILTER_SET.add("java.awt.image.BufferedImage");
FILTER_SET.add("sun.awt.AppContext");
FILTER_SET.add("com.fr.poly.creator.ECBlockCreator");
FILTER_SET.add("com.fr.form.ui.ElementCaseImage");
}
@Override

1
designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java

@ -177,6 +177,7 @@ public class UILookAndFeel extends MetalLookAndFeel {
table.put("OptionPane.narrow.down", loadIcon("Icon_Narrow_Down_16x16.png", this));
table.put("OptionPane.warningIcon", loadIcon("WarningIcon.png", this));
table.put("OptionPane.questionIcon", loadIcon("QuestionIcon.png", this));
table.put("OptionPane.tipIcon", loadIcon("TipIcon.png", this));
table.put("ScrollPane.border", new UIScrollPaneBorder());
table.put("ProgressBar.border", new UIProgressBarBorder());
table.put("Spinner.border", new UITextFieldBorder(new Insets(2, 2, 2, 2)));

18
designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java

@ -4,12 +4,14 @@ import com.fr.base.BaseUtils;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.file.FILE;
import com.fr.file.FileNodeFILE;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
@ -21,7 +23,6 @@ import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -40,7 +41,7 @@ public class CheckButton extends UIButton {
private UILabel message;
private UIButton okButton;
private JDialog dialog;
private UILabel uiLabel;
private UILabel imageLabel;
public CheckButton() {
this.setIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/check.png"));
@ -71,7 +72,7 @@ public class CheckButton extends UIButton {
}
if (set.isEmpty()) {
okButton.setEnabled(true);
uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png"));
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png"));
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + "</html>");
} else {
if (dialog != null) {
@ -161,7 +162,6 @@ public class CheckButton extends UIButton {
});
checkThread.execute();
dialog.setVisible(true);
dialog.dispose();
}
};
@ -171,7 +171,7 @@ public class CheckButton extends UIButton {
@Override
public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) {
uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png"));
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png"));
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + "</html>");
okButton.setEnabled(true);
return null;
@ -183,7 +183,7 @@ public class CheckButton extends UIButton {
private void initDialogPane() {
message = new UILabel();
message.setText(Toolkit.i18nText("Fine-Designer_Check_Font_Checking") + "...");
uiLabel = new UILabel();
imageLabel = new UILabel();
okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
okButton.setEnabled(false);
okButton.addActionListener(new ActionListener() {
@ -194,13 +194,13 @@ public class CheckButton extends UIButton {
dialog = new JDialog();
dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font"));
dialog.setModal(true);
dialog.setSize(new Dimension(268, 118));
dialog.setSize(DesignSizeI18nManager.getInstance().i18nDimension(this.getClass().getName()));
JPanel jp = new JPanel();
JPanel upPane = new JPanel();
JPanel downPane = new JPanel();
uiLabel = new UILabel(BaseUtils.readIcon("com/fr/design/images/waiting.png"));
imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/waiting.png"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(uiLabel);
upPane.add(imageLabel);
upPane.add(message);
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
downPane.add(okButton);

12
designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java

@ -3,11 +3,11 @@ package com.fr.design.mainframe.check;
import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import javax.swing.BorderFactory;
@ -17,13 +17,11 @@ import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Locale;
/**
* 字体缺失检测的具体结果对话框
@ -52,7 +50,7 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"),
Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"),
CloudCenter.getInstance().acquireUrlByKind("help.install.font", "https://help.fanruan.com/finereport/doc-view-3999.html"));
linkMessage.setPreferredSize(new Dimension(380, 31));
linkMessage.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink"));
messagePanel.add(linkMessage);
// 查看详情按钮
@ -89,11 +87,11 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
public void mouseClicked(MouseEvent e) {
if (hiddenPanel.isVisible()) {
hiddenPanel.setVisible(false);
CheckFontInfoDialog.this.setSize(new Dimension(380, 185));
CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse"));
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right"));
} else {
CheckFontInfoDialog.this.setSize(new Dimension(380, 280));
CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.unfold"));
hiddenPanel.setVisible(true);
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down"));
@ -114,7 +112,7 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
this.add(topPanel, BorderLayout.NORTH);
this.add(hiddenPanel, BorderLayout.CENTER);
this.add(bottomPanel, BorderLayout.SOUTH);
this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 400:380, 185));
this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse"));
GUICoreUtils.centerWindow(this);
}

31
designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java

@ -1,12 +1,26 @@
package com.fr.design.mod;
import com.fr.base.Formula;
import com.fr.base.headerfooter.FormulaHFElement;
import com.fr.base.present.FormulaPresent;
import com.fr.chart.web.ChartHyperRelateCellLink;
import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.file.filter.ClassFilter;
import com.fr.data.SimpleDSColumn;
import com.fr.data.condition.FormulaCondition;
import com.fr.data.impl.FormulaDictionary;
import com.fr.data.impl.NameTableData;
import com.fr.form.main.FormHyperlink;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.WidgetTitle;
import com.fr.invoke.ClassHelper;
import com.fr.js.JavaScriptImpl;
import com.fr.plugin.chart.base.VanChartHtmlLabel;
import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.report.cell.cellattr.core.RichChar;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.FunctionGrouper;
import com.fr.report.cell.cellattr.core.group.SelectCount;
import com.fr.stable.Filter;
import java.util.HashSet;
import java.util.Map;
@ -41,6 +55,21 @@ public class ContentObjectManager {
set.add(ChartHyperRelateCellLink.class.getName());
set.add(ChartHyperRelateFloatLink.class.getName());
set.add(VanChartHtmlLabel.class.getName());
set.add(NameTableData.class.getName());
set.add(SimpleDSColumn.class.getName());
set.add(DSColumn.class.getName());
set.add(FormHyperlink.class.getName());
set.add(CellExpandAttr.class.getName());
set.add(FormulaCondition.class.getName());
set.add(FormulaDictionary.class.getName());
set.add(FormulaHFElement.class.getName());
set.add(FormulaPresent.class.getName());
set.add(RichChar.class.getName());
set.add(CardSwitchButton.class.getName());
set.add(CellGUIAttr.class.getName());
set.add(SelectCount.class.getName());
set.add(WidgetTitle.class.getName());
set.add(FunctionGrouper.class.getName());
}
public void searchObject(Object ob) {

154
designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java

@ -1,5 +1,10 @@
package com.fr.design.mod;
import com.fr.parser.FRFormulaTransformer;
import com.fr.stable.StringUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author hades
* @version 10.0
@ -9,12 +14,159 @@ public class ContentReplaceUtil {
public static final String EQ_STRING = "=";
public static final String LEFT_BRACKET = "${";
public static final String RIGHT_BRACKET = "}";
public static String replaceContent(String content, String oldName, String newName) {
return content.replaceAll(generateStr(oldName), generateStr(newName));
String oldNameUpper = oldName.toUpperCase();
Matcher m = Pattern.compile(oldName + "|" + oldNameUpper).matcher(content);
StringBuilder sb = new StringBuilder();
int last = 0;
while (m.find()) {
sb.append(content, last, m.start());
if (oldNameUpper.equals(m.group())) {
// 处理大写情况
sb.append(newName.toUpperCase());
} else {
// 默认情况
sb.append(newName);
}
last = m.end();
}
sb.append(content.substring(last));
return sb.toString();
}
private static String generateStr(String str) {
return "\"" + str + "\"";
}
public static String getFormulaPureContent(String content) {
if (content.startsWith(EQ_STRING)) {
return content.substring(1);
} else {
return content;
}
}
/**
* 通过公式编辑框框输入的且带有"="
*
* @param content
* @param oldName
* @param newName
* @return
*/
public static String replaceFormulaContent4WidgetName(String content, String oldName, String newName) {
if (StringUtils.isNotEmpty(content)) {
return replaceFormulaContent4WidgetName0(content, oldName, newName);
}
return content;
}
public static String replaceFormulaContent4TableDataName(String content, String oldName, String newName) {
if (StringUtils.isNotEmpty(content)) {
return replaceFormulaContent4TableDataName0(content, oldName, newName);
}
return content;
}
private static String replaceFormulaContent4WidgetName0(String content, String oldName, String newName) {
content = getFormulaPureContent(content);
FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer();
frFormulaTransformer.addRenamedWidget(oldName, newName);
return EQ_STRING + frFormulaTransformer.transform(content);
}
private static String replaceFormulaContent4TableDataName0(String content, String oldName, String newName) {
content = getFormulaPureContent(content);
FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer();
frFormulaTransformer.addRenamedDataset(oldName, newName);
return EQ_STRING + frFormulaTransformer.transform(content);
}
public static String getRichCharFormulaPureContent(String content) {
if (content.startsWith(LEFT_BRACKET)) {
return content.substring(LEFT_BRACKET.length() + 1, content.length() - 1);
} else {
return content;
}
}
public static String replaceRichCharFormulaContent4TableDataName(String content, String oldName, String newName) {
if (StringUtils.isNotEmpty(content)) {
content = getRichCharFormulaPureContent(content);
FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer();
frFormulaTransformer.addRenamedDataset(oldName, newName);
return LEFT_BRACKET + EQ_STRING + frFormulaTransformer.transform(content) + RIGHT_BRACKET;
}
return content;
}
public static String replaceRichCharFormulaContent4WidgetName(String content, String oldName, String newName) {
if (StringUtils.isNotEmpty(content)) {
content = getRichCharFormulaPureContent(content);
FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer();
frFormulaTransformer.addRenamedWidget(oldName, newName);
return LEFT_BRACKET + EQ_STRING + frFormulaTransformer.transform(content) + RIGHT_BRACKET;
}
return content;
}
private static boolean isFormula(String content) {
return StringUtils.isNotEmpty(content) && content.startsWith(EQ_STRING);
}
/**
* 适用于替换非显示使用的公式的地方 有可能只是文本 需要先判断下
* 可通过使用位置是否使用公式编辑框区分
*
* @param content
* @param oldName
* @param newName
* @return
*/
public static String replaceFormulaString4WidgetName(String content, String oldName, String newName) {
if (isFormula(content)) {
return replaceFormulaContent4WidgetName0(content, oldName, newName);
}
return content;
}
public static String replaceFormulaString4TableDataName(String content, String oldName, String newName ) {
if (isFormula(content)) {
return replaceFormulaContent4TableDataName0(content, oldName, newName);
}
return content;
}
/**
* 替换纯公式内容 "="
*
* @param content
* @param oldName
* @param newName
* @return
*/
public static String replacePureFormula4WidgetName(String content, String oldName, String newName ) {
if (StringUtils.isNotEmpty(content)) {
FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer();
frFormulaTransformer.addRenamedWidget(oldName, newName);
return frFormulaTransformer.transform(content);
}
return content;
}
public static String replacePureFormula4TableDataName(String content, String oldName, String newName ) {
if (StringUtils.isNotEmpty(content)) {
FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer();
frFormulaTransformer.addRenamedDataset(oldName, newName);
return frFormulaTransformer.transform(content);
}
return content;
}
}

32
designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java

@ -6,9 +6,24 @@ import com.fr.design.mod.event.TableDataModifyEvent;
import com.fr.design.mod.event.WidgetNameModifyEvent;
import com.fr.design.mod.impl.change.ChartHyperRelateCellLinkContentChange;
import com.fr.design.mod.impl.change.ChartHyperRelateFloatLinkContentChange;
import com.fr.design.mod.impl.change.FormulaContentChange;
import com.fr.design.mod.impl.change.DSColumnContentChange;
import com.fr.design.mod.impl.change.FormHyperlinkContentChange;
import com.fr.design.mod.impl.change.formula.CardSwitchButtonContentChange;
import com.fr.design.mod.impl.change.formula.CellExpandAttrContentChange;
import com.fr.design.mod.impl.change.formula.CellGUIAttrContentChange;
import com.fr.design.mod.impl.change.formula.FormulaConditionContentChange;
import com.fr.design.mod.impl.change.formula.FormulaContentChange;
import com.fr.design.mod.impl.change.JavaScriptContentChange;
import com.fr.design.mod.impl.change.NameTableDataContentChange;
import com.fr.design.mod.impl.change.SimpleDSColumnContentChange;
import com.fr.design.mod.impl.change.VanChartHtmlLabelContentChange;
import com.fr.design.mod.impl.change.formula.FormulaDictionaryContentChange;
import com.fr.design.mod.impl.change.formula.FormulaHFElementContentChange;
import com.fr.design.mod.impl.change.formula.FormulaPresentContentChange;
import com.fr.design.mod.impl.change.formula.FunctionGrouperContentChange;
import com.fr.design.mod.impl.change.formula.RichCharContentChange;
import com.fr.design.mod.impl.change.formula.SelectCountContentChange;
import com.fr.design.mod.impl.change.formula.WidgetTitleContentChange;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
@ -73,6 +88,21 @@ public class ContentReplacerCenter {
contentChangeList.add(new FormulaContentChange());
contentChangeList.add(new JavaScriptContentChange());
contentChangeList.add(new VanChartHtmlLabelContentChange());
contentChangeList.add(new NameTableDataContentChange());
contentChangeList.add(new SimpleDSColumnContentChange());
contentChangeList.add(new DSColumnContentChange());
contentChangeList.add(new FormHyperlinkContentChange());
contentChangeList.add(new CellExpandAttrContentChange());
contentChangeList.add(new FormulaConditionContentChange());
contentChangeList.add(new FormulaDictionaryContentChange());
contentChangeList.add(new FormulaHFElementContentChange());
contentChangeList.add(new FormulaPresentContentChange());
contentChangeList.add(new RichCharContentChange());
contentChangeList.add(new CardSwitchButtonContentChange());
contentChangeList.add(new CellGUIAttrContentChange());
contentChangeList.add(new SelectCountContentChange());
contentChangeList.add(new WidgetTitleContentChange());
contentChangeList.add(new FunctionGrouperContentChange());
}
private void onRename(List<ContentChangeItem> contentChangeItemList, List<ContentChange> contentChangeList) {

7
designer-base/src/main/java/com/fr/design/mod/ModClassFilter.java

@ -5,6 +5,8 @@ import java.util.HashSet;
import java.util.Set;
/**
* 联动修改的类过滤器
*
* @author hades
* @version 10.0
* Created by hades on 2021/5/31
@ -15,6 +17,8 @@ public class ModClassFilter implements Filter<String> {
private static final Filter<String> INSTANCE = new ModClassFilter();
private static final String DESIGN_PREFIX = "com.fr.design";
public static Filter<String> getInstance() {
return INSTANCE;
}
@ -24,10 +28,11 @@ public class ModClassFilter implements Filter<String> {
FILTER_SET.add("sun.awt.AppContext");
FILTER_SET.add("com.fr.poly.creator.ECBlockCreator");
FILTER_SET.add("io.netty.channel.nio.SelectedSelectionKeySet");
FILTER_SET.add("com.fr.form.ui.ElementCaseImage");
}
@Override
public boolean accept(String s) {
return FILTER_SET.contains(s);
return FILTER_SET.contains(s) || s.startsWith(DESIGN_PREFIX);
}
}

36
designer-base/src/main/java/com/fr/design/mod/impl/change/DSColumnContentChange.java

@ -0,0 +1,36 @@
package com.fr.design.mod.impl.change;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.DSColumn4TableDataNameContentReplacer;
import com.fr.design.mod.impl.repalce.DSColumn4WidgetNameContentReplacer;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class DSColumnContentChange implements ContentChange<DSColumn> {
private final Map<ChangeItem, ContentReplacer<DSColumn>> map;
public DSColumnContentChange() {
map = new HashMap<>();
map.put(ChangeItem.TABLE_DATA_NAME, new DSColumn4TableDataNameContentReplacer());
map.put(ChangeItem.WIDGET_NAME, new DSColumn4WidgetNameContentReplacer());
}
@Override
public String type() {
return DSColumn.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<DSColumn>> changeInfo() {
return map;
}
}

34
designer-base/src/main/java/com/fr/design/mod/impl/change/FormHyperlinkContentChange.java

@ -0,0 +1,34 @@
package com.fr.design.mod.impl.change;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormHyperlinkContentReplacer;
import com.fr.form.main.FormHyperlink;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class FormHyperlinkContentChange implements ContentChange<FormHyperlink> {
private final Map<ChangeItem, ContentReplacer<FormHyperlink>> map;
public FormHyperlinkContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, new FormHyperlinkContentReplacer());
}
@Override
public String type() {
return FormHyperlink.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<FormHyperlink>> changeInfo() {
return map;
}
}

34
designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java

@ -0,0 +1,34 @@
package com.fr.design.mod.impl.change;
import com.fr.data.impl.NameTableData;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.NameTableDataContentReplacer;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class NameTableDataContentChange implements ContentChange<NameTableData> {
private final Map<ChangeItem, ContentReplacer<NameTableData>> map;
public NameTableDataContentChange() {
map = new HashMap<>();
map.put(ChangeItem.TABLE_DATA_NAME, new NameTableDataContentReplacer());
}
@Override
public String type() {
return NameTableData.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<NameTableData>> changeInfo() {
return map;
}
}

34
designer-base/src/main/java/com/fr/design/mod/impl/change/SimpleDSColumnContentChange.java

@ -0,0 +1,34 @@
package com.fr.design.mod.impl.change;
import com.fr.data.SimpleDSColumn;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.SimpleDSColumnContentReplacer;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class SimpleDSColumnContentChange implements ContentChange<SimpleDSColumn> {
private Map<ChangeItem, ContentReplacer<SimpleDSColumn>> map;
public SimpleDSColumnContentChange() {
map = new HashMap<>();
map.put(ChangeItem.TABLE_DATA_NAME, new SimpleDSColumnContentReplacer());
}
@Override
public String type() {
return SimpleDSColumn.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<SimpleDSColumn>> changeInfo() {
return map;
}
}

36
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CardSwitchButtonContentChange.java

@ -0,0 +1,36 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import com.fr.form.ui.CardSwitchButton;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/3
*/
public class CardSwitchButtonContentChange implements ContentChange<CardSwitchButton> {
private final Map<ChangeItem, ContentReplacer<CardSwitchButton>> map;
public CardSwitchButtonContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.CardSwitchButton4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.CardSwitchButton4TableDataNameContentReplacer);
}
@Override
public String type() {
return CardSwitchButton.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<CardSwitchButton>> changeInfo() {
return map;
}
}

37
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellExpandAttrContentChange.java

@ -0,0 +1,37 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import com.fr.report.cell.cellattr.CellExpandAttr;
import java.util.HashMap;
import java.util.Map;
/**
* 扩展后排序公式
*
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class CellExpandAttrContentChange implements ContentChange<CellExpandAttr> {
private final Map<ChangeItem, ContentReplacer<CellExpandAttr>> map;
public CellExpandAttrContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.CellExpandAttr4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.CellExpandAttr4TableDataNameContentReplacer);
}
@Override
public String type() {
return CellExpandAttr.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<CellExpandAttr>> changeInfo() {
return map;
}
}

35
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellGUIAttrContentChange.java

@ -0,0 +1,35 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import com.fr.report.cell.cellattr.CellGUIAttr;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/3
*/
public class CellGUIAttrContentChange implements ContentChange<CellGUIAttr> {
private Map<ChangeItem, ContentReplacer<CellGUIAttr>> map;
public CellGUIAttrContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.CellGUIAttr4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.CellGUIAttr4TableDataNameContentReplacer);
}
@Override
public String type() {
return CellGUIAttr.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<CellGUIAttr>> changeInfo() {
return map;
}
}

37
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaConditionContentChange.java

@ -0,0 +1,37 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.data.condition.FormulaCondition;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import java.util.HashMap;
import java.util.Map;
/**
* 公式条件
*
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class FormulaConditionContentChange implements ContentChange<FormulaCondition> {
private final Map<ChangeItem, ContentReplacer<FormulaCondition>> map;
public FormulaConditionContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FormulaCondition4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FormulaCondition4TableDataNameContentReplacer);
}
@Override
public String type() {
return FormulaCondition.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<FormulaCondition>> changeInfo() {
return map;
}
}

9
designer-base/src/main/java/com/fr/design/mod/impl/change/FormulaContentChange.java → designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaContentChange.java

@ -1,11 +1,10 @@
package com.fr.design.mod.impl.change;
package com.fr.design.mod.impl.change.formula;
import com.fr.base.Formula;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.Formula4TableDataNameContentReplacer;
import com.fr.design.mod.impl.repalce.Formula4WidgetNameContentReplacer;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import java.util.HashMap;
import java.util.Map;
@ -20,8 +19,8 @@ public class FormulaContentChange implements ContentChange<Formula> {
public FormulaContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, new Formula4WidgetNameContentReplacer());
map.put(ChangeItem.TABLE_DATA_NAME, new Formula4TableDataNameContentReplacer());
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.Formula4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.Formula4TableDataNameContentReplacer);
}
@Override

37
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaDictionaryContentChange.java

@ -0,0 +1,37 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.data.impl.FormulaDictionary;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import java.util.HashMap;
import java.util.Map;
/**
* 数据字典公式
*
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class FormulaDictionaryContentChange implements ContentChange<FormulaDictionary> {
private final Map<ChangeItem, ContentReplacer<FormulaDictionary>> map;
public FormulaDictionaryContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FormulaDictionary4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FormulaDictionary4TableDataNameContentReplacer);
}
@Override
public String type() {
return FormulaDictionary.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<FormulaDictionary>> changeInfo() {
return map;
}
}

38
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaHFElementContentChange.java

@ -0,0 +1,38 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.base.headerfooter.FormulaHFElement;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import java.util.HashMap;
import java.util.Map;
/**
* 页面/页脚公式
*
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class FormulaHFElementContentChange implements ContentChange<FormulaHFElement> {
private final Map<ChangeItem, ContentReplacer<FormulaHFElement>> map;
public FormulaHFElementContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FormulaHFElement4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FormulaHFElement4TableDataNameContentReplacer);
}
@Override
public String type() {
return FormulaHFElement.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<FormulaHFElement>> changeInfo() {
return map;
}
}

38
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaPresentContentChange.java

@ -0,0 +1,38 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.base.present.FormulaPresent;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import java.util.HashMap;
import java.util.Map;
/**
* 公式形态
*
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class FormulaPresentContentChange implements ContentChange<FormulaPresent> {
private final Map<ChangeItem, ContentReplacer<FormulaPresent>> map;
public FormulaPresentContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FormulaPresent4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FormulaPresent4TableDataNameContentReplacer);
}
@Override
public String type() {
return FormulaPresent.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<FormulaPresent>> changeInfo() {
return map;
}
}

35
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FunctionGrouperContentChange.java

@ -0,0 +1,35 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import com.fr.report.cell.cellattr.core.group.FunctionGrouper;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/3
*/
public class FunctionGrouperContentChange implements ContentChange<FunctionGrouper> {
private final Map<ChangeItem, ContentReplacer<FunctionGrouper>> map;
public FunctionGrouperContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FunctionGrouper4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FunctionGrouper4TableDataNameContentReplacer);
}
@Override
public String type() {
return FunctionGrouper.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<FunctionGrouper>> changeInfo() {
return map;
}
}

37
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/RichCharContentChange.java

@ -0,0 +1,37 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import com.fr.report.cell.cellattr.core.RichChar;
import java.util.HashMap;
import java.util.Map;
/**
* 富文本
*
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class RichCharContentChange implements ContentChange<RichChar> {
private final Map<ChangeItem, ContentReplacer<RichChar>> map;
public RichCharContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.RichChar4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.RichChar4TableDataNameContentReplacer);
}
@Override
public String type() {
return RichChar.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<RichChar>> changeInfo() {
return map;
}
}

35
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/SelectCountContentChange.java

@ -0,0 +1,35 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import com.fr.report.cell.cellattr.core.group.SelectCount;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/3
*/
public class SelectCountContentChange implements ContentChange<SelectCount> {
private final Map<ChangeItem, ContentReplacer<SelectCount>> map;
public SelectCountContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.SelectCount4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.SelectCount4TableDataNameContentReplacer);
}
@Override
public String type() {
return SelectCount.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<SelectCount>> changeInfo() {
return map;
}
}

35
designer-base/src/main/java/com/fr/design/mod/impl/change/formula/WidgetTitleContentChange.java

@ -0,0 +1,35 @@
package com.fr.design.mod.impl.change.formula;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.FormulaReplacer;
import com.fr.form.ui.WidgetTitle;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/3
*/
public class WidgetTitleContentChange implements ContentChange<WidgetTitle> {
private final Map<ChangeItem, ContentReplacer<WidgetTitle>> map;
public WidgetTitleContentChange() {
map = new HashMap<>();
map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.WidgetTitle4WidgetNameContentReplacer);
map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.WidgetTitle4TableDataNameContentReplacer);
}
@Override
public String type() {
return WidgetTitle.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<WidgetTitle>> changeInfo() {
return map;
}
}

23
designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4TableDataNameContentReplacer.java

@ -0,0 +1,23 @@
package com.fr.design.mod.impl.repalce;
import com.fr.design.mod.ContentReplaceUtil;
import com.fr.design.mod.ContentReplacer;
import com.fr.general.ComparatorUtils;
import com.fr.report.cell.cellattr.core.group.DSColumn;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class DSColumn4TableDataNameContentReplacer implements ContentReplacer<DSColumn> {
@Override
public void replace(DSColumn dsColumn, String oldName, String newName) {
if (ComparatorUtils.equals(dsColumn.getDSName(), oldName)) {
dsColumn.setDSName(newName);
}
dsColumn.setResult(ContentReplaceUtil.replacePureFormula4TableDataName(dsColumn.getResult(), oldName, newName));
dsColumn.setSortFormula(ContentReplaceUtil.replacePureFormula4TableDataName(dsColumn.getSortFormula(), oldName, newName));
}
}

19
designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4WidgetNameContentReplacer.java

@ -0,0 +1,19 @@
package com.fr.design.mod.impl.repalce;
import com.fr.design.mod.ContentReplaceUtil;
import com.fr.design.mod.ContentReplacer;
import com.fr.report.cell.cellattr.core.group.DSColumn;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/3
*/
public class DSColumn4WidgetNameContentReplacer implements ContentReplacer<DSColumn> {
@Override
public void replace(DSColumn dsColumn, String oldName, String newName) {
dsColumn.setResult(ContentReplaceUtil.replacePureFormula4WidgetName(dsColumn.getResult(), oldName, newName));
dsColumn.setSortFormula(ContentReplaceUtil.replacePureFormula4WidgetName(dsColumn.getSortFormula(), oldName, newName));
}
}

20
designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormHyperlinkContentReplacer.java

@ -0,0 +1,20 @@
package com.fr.design.mod.impl.repalce;
import com.fr.design.mod.ContentReplacer;
import com.fr.form.main.FormHyperlink;
import com.fr.general.ComparatorUtils;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class FormHyperlinkContentReplacer implements ContentReplacer<FormHyperlink> {
@Override
public void replace(FormHyperlink formHyperlink, String oldName, String newName) {
if (ComparatorUtils.equals(formHyperlink.getRelateEditorName(), oldName)) {
formHyperlink.setRelateEditorName(newName);
}
}
}

22
designer-base/src/main/java/com/fr/design/mod/impl/repalce/Formula4TableDataNameContentReplacer.java

@ -1,22 +0,0 @@
package com.fr.design.mod.impl.repalce;
import com.fr.base.Formula;
import com.fr.design.mod.ContentReplaceUtil;
import com.fr.design.mod.ContentReplacer;
import com.fr.parser.FRFormulaTransformer;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/5/28
*/
public class Formula4TableDataNameContentReplacer implements ContentReplacer<Formula> {
@Override
public void replace(Formula formula, String oldName, String newName) {
FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer();
frFormulaTransformer.addRenamedDataset(oldName, newName);
formula.setContent(ContentReplaceUtil.EQ_STRING + frFormulaTransformer.transform(formula.getPureContent()));
}
}

21
designer-base/src/main/java/com/fr/design/mod/impl/repalce/Formula4WidgetNameContentReplacer.java

@ -1,21 +0,0 @@
package com.fr.design.mod.impl.repalce;
import com.fr.base.Formula;
import com.fr.design.mod.ContentReplaceUtil;
import com.fr.design.mod.ContentReplacer;
import com.fr.parser.FRFormulaTransformer;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/5/28
*/
public class Formula4WidgetNameContentReplacer implements ContentReplacer<Formula> {
@Override
public void replace(Formula formula, String oldName, String newName) {
FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer();
frFormulaTransformer.addRenamedWidget(oldName, newName);
formula.setContent(ContentReplaceUtil.EQ_STRING + frFormulaTransformer.transform(formula.getPureContent()));
}
}

247
designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormulaReplacer.java

@ -0,0 +1,247 @@
package com.fr.design.mod.impl.repalce;
import com.fr.base.Formula;
import com.fr.base.headerfooter.FormulaHFElement;
import com.fr.base.present.FormulaPresent;
import com.fr.data.condition.FormulaCondition;
import com.fr.data.impl.FormulaDictionary;
import com.fr.design.mod.ContentReplaceUtil;
import com.fr.design.mod.ContentReplacer;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.WidgetTitle;
import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.report.cell.cellattr.core.RichChar;
import com.fr.report.cell.cellattr.core.group.FunctionGrouper;
import com.fr.report.cell.cellattr.core.group.SelectCount;
/**
* 持有公式内容对象汇总
*
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class FormulaReplacer {
/**
* 扩展后排序公式
*/
public static final ContentReplacer<CellExpandAttr> CellExpandAttr4TableDataNameContentReplacer = new ContentReplacer<CellExpandAttr>() {
@Override
public void replace(CellExpandAttr cellExpandAttr, String oldName, String newName) {
cellExpandAttr.setSortFormula(ContentReplaceUtil.replaceFormulaContent4TableDataName(cellExpandAttr.getSortFormula(), oldName, newName));
}
};
public static final ContentReplacer<CellExpandAttr> CellExpandAttr4WidgetNameContentReplacer = new ContentReplacer<CellExpandAttr>() {
@Override
public void replace(CellExpandAttr cellExpandAttr, String oldName, String newName) {
cellExpandAttr.setSortFormula(ContentReplaceUtil.replaceFormulaContent4WidgetName(cellExpandAttr.getSortFormula(), oldName, newName));
}
};
/**
* 典型单元格公式
*/
public static final ContentReplacer<Formula> Formula4TableDataNameContentReplacer = new ContentReplacer<Formula>() {
@Override
public void replace(Formula formula, String oldName, String newName) {
formula.setContent(ContentReplaceUtil.replaceFormulaContent4TableDataName(formula.getPureContent(), oldName, newName));
}
};
public static final ContentReplacer<Formula> Formula4WidgetNameContentReplacer = new ContentReplacer<Formula>() {
@Override
public void replace(Formula formula, String oldName, String newName) {
formula.setContent(ContentReplaceUtil.replaceFormulaContent4WidgetName(formula.getPureContent(), oldName, newName));
}
};
/**
* 公式条件
*/
public static final ContentReplacer<FormulaCondition> FormulaCondition4TableDataNameContentReplacer = new ContentReplacer<FormulaCondition>() {
@Override
public void replace(FormulaCondition formulaCondition, String oldName, String newName) {
formulaCondition.setFormula(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaCondition.getFormula(), oldName, newName));
}
};
public static final ContentReplacer<FormulaCondition> FormulaCondition4WidgetNameContentReplacer = new ContentReplacer<FormulaCondition>() {
@Override
public void replace(FormulaCondition formulaCondition, String oldName, String newName) {
formulaCondition.setFormula(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaCondition.getFormula(), oldName, newName));
}
};
/**
* 数据字典公式
*/
public static final ContentReplacer<FormulaDictionary> FormulaDictionary4TableDataNameContentReplacer = new ContentReplacer<FormulaDictionary>() {
@Override
public void replace(FormulaDictionary formulaDictionary, String oldName, String newName) {
formulaDictionary.setExcuteFormula(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaDictionary.getExcuteFormula(), oldName, newName));
formulaDictionary.setProduceFormula(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaDictionary.getProduceFormula(), oldName, newName));
}
};
public static final ContentReplacer<FormulaDictionary> FormulaDictionary4WidgetNameContentReplacer = new ContentReplacer<FormulaDictionary>() {
@Override
public void replace(FormulaDictionary formulaDictionary, String oldName, String newName) {
formulaDictionary.setExcuteFormula(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaDictionary.getExcuteFormula(), oldName, newName));
formulaDictionary.setProduceFormula(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaDictionary.getProduceFormula(), oldName, newName));
}
};
/**
* 页面/页脚公式
*/
public static final ContentReplacer<FormulaHFElement> FormulaHFElement4TableDataNameContentReplacer = new ContentReplacer<FormulaHFElement>() {
@Override
public void replace(FormulaHFElement formulaHFElement, String oldName, String newName) {
formulaHFElement.setFormulaContent(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaHFElement.getFormulaContent(), oldName, newName));
}
};
public static final ContentReplacer<FormulaHFElement> FormulaHFElement4WidgetNameContentReplacer = new ContentReplacer<FormulaHFElement>() {
@Override
public void replace(FormulaHFElement formulaHFElement, String oldName, String newName) {
formulaHFElement.setFormulaContent(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaHFElement.getFormulaContent(), oldName, newName));
}
};
/**
* 公式形态
*/
public static final ContentReplacer<FormulaPresent> FormulaPresent4TableDataNameContentReplacer = new ContentReplacer<FormulaPresent>() {
@Override
public void replace(FormulaPresent formulaPresent, String oldName, String newName) {
formulaPresent.setFormulaContent(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaPresent.getFormulaContent(), oldName, newName));
}
};
public static final ContentReplacer<FormulaPresent> FormulaPresent4WidgetNameContentReplacer = new ContentReplacer<FormulaPresent>() {
@Override
public void replace(FormulaPresent formulaPresent, String oldName, String newName) {
formulaPresent.setFormulaContent(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaPresent.getFormulaContent(), oldName, newName));
}
};
/**
* 富文本公式
*/
public static final ContentReplacer<RichChar> RichChar4TableDataNameContentReplacer = new ContentReplacer<RichChar>() {
@Override
public void replace(RichChar richChar, String oldName, String newName) {
if (richChar.isFormula()) {
richChar.setText(ContentReplaceUtil.replaceRichCharFormulaContent4TableDataName(richChar.getText(), oldName, newName));
}
}
};
public static final ContentReplacer<RichChar> RichChar4WidgetNameContentReplacer = new ContentReplacer<RichChar>() {
@Override
public void replace(RichChar richChar, String oldName, String newName) {
if (richChar.isFormula()) {
richChar.setText(ContentReplaceUtil.replaceRichCharFormulaContent4WidgetName(richChar.getText(), oldName, newName));
}
}
};
/**
* 公式分组
*
*/
public static final ContentReplacer<FunctionGrouper> FunctionGrouper4TableDataNameContentReplacer = new ContentReplacer<FunctionGrouper>() {
@Override
public void replace(FunctionGrouper functionGrouper, String oldName, String newName) {
functionGrouper.setFormulaContent(ContentReplaceUtil.replacePureFormula4TableDataName(functionGrouper.getFormulaContent(), oldName, newName));
}
};
public static final ContentReplacer<FunctionGrouper> FunctionGrouper4WidgetNameContentReplacer = new ContentReplacer<FunctionGrouper>() {
@Override
public void replace(FunctionGrouper functionGrouper, String oldName, String newName) {
functionGrouper.setFormulaContent(ContentReplaceUtil.replacePureFormula4WidgetName(functionGrouper.getFormulaContent(), oldName, newName));
}
};
/**
* 结果集筛选
*/
public static final ContentReplacer<SelectCount> SelectCount4TableDataNameContentReplacer = new ContentReplacer<SelectCount>() {
@Override
public void replace(SelectCount selectCount, String oldName, String newName) {
selectCount.setFormulaCount(ContentReplaceUtil.replacePureFormula4TableDataName(selectCount.getFormulaCount(), oldName, newName));
}
};
public static final ContentReplacer<SelectCount> SelectCount4WidgetNameContentReplacer = new ContentReplacer<SelectCount>() {
@Override
public void replace(SelectCount selectCount, String oldName, String newName) {
selectCount.setFormulaCount(ContentReplaceUtil.replacePureFormula4WidgetName(selectCount.getFormulaCount(), oldName, newName));
}
};
/**
* tab块标题
*/
public static final ContentReplacer<CardSwitchButton> CardSwitchButton4TableDataNameContentReplacer = new ContentReplacer<CardSwitchButton>() {
@Override
public void replace(CardSwitchButton cardSwitchButton, String oldName, String newName) {
cardSwitchButton.setText(ContentReplaceUtil.replaceFormulaString4TableDataName(cardSwitchButton.getText(), oldName, newName));
}
};
public static final ContentReplacer<CardSwitchButton> CardSwitchButton4WidgetNameContentReplacer = new ContentReplacer<CardSwitchButton>() {
@Override
public void replace(CardSwitchButton cardSwitchButton, String oldName, String newName) {
cardSwitchButton.setText(ContentReplaceUtil.replaceFormulaString4WidgetName(cardSwitchButton.getText(), oldName, newName));
}
};
/**
* 悬浮提示
*/
public static final ContentReplacer<CellGUIAttr> CellGUIAttr4TableDataNameContentReplacer = new ContentReplacer<CellGUIAttr>() {
@Override
public void replace(CellGUIAttr cellGUIAttr, String oldName, String newName) {
cellGUIAttr.setTooltipText(ContentReplaceUtil.replaceFormulaString4TableDataName(cellGUIAttr.getTooltipText(), oldName, newName));
}
};
public static final ContentReplacer<CellGUIAttr> CellGUIAttr4WidgetNameContentReplacer = new ContentReplacer<CellGUIAttr>() {
@Override
public void replace(CellGUIAttr cellGUIAttr, String oldName, String newName) {
cellGUIAttr.setTooltipText(ContentReplaceUtil.replaceFormulaString4WidgetName(cellGUIAttr.getTooltipText(), oldName, newName));
}
};
/**
* 图表/报表块等标题
*/
public static final ContentReplacer<WidgetTitle> WidgetTitle4TableDataNameContentReplacer = new ContentReplacer<WidgetTitle>() {
@Override
public void replace(WidgetTitle widgetTitle, String oldName, String newName) {
if (widgetTitle.getTextObject() instanceof String) {
String content = (String) widgetTitle.getTextObject();
widgetTitle.setTextObject(ContentReplaceUtil.replaceFormulaString4TableDataName(content, oldName, newName));
}
}
};
public static final ContentReplacer<WidgetTitle> WidgetTitle4WidgetNameContentReplacer = new ContentReplacer<WidgetTitle>() {
@Override
public void replace(WidgetTitle widgetTitle, String oldName, String newName) {
if (widgetTitle.getTextObject() instanceof String) {
String content = (String) widgetTitle.getTextObject();
widgetTitle.setTextObject(ContentReplaceUtil.replaceFormulaString4WidgetName(content, oldName, newName));
}
}
};
}

17
designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java

@ -0,0 +1,17 @@
package com.fr.design.mod.impl.repalce;
import com.fr.data.impl.NameTableData;
import com.fr.design.mod.ContentReplacer;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class NameTableDataContentReplacer implements ContentReplacer<NameTableData> {
@Override
public void replace(NameTableData nameTableData, String oldName, String newName) {
nameTableData.rename(oldName, newName);
}
}

20
designer-base/src/main/java/com/fr/design/mod/impl/repalce/SimpleDSColumnContentReplacer.java

@ -0,0 +1,20 @@
package com.fr.design.mod.impl.repalce;
import com.fr.data.SimpleDSColumn;
import com.fr.design.mod.ContentReplacer;
import com.fr.general.ComparatorUtils;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class SimpleDSColumnContentReplacer implements ContentReplacer<SimpleDSColumn> {
@Override
public void replace(SimpleDSColumn simpleDSColumn, String oldName, String newName) {
if (ComparatorUtils.equals(simpleDSColumn.getDsName(), oldName)) {
simpleDSColumn.setDsName(newName);
}
}
}

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -1 +1,5 @@
com.fr.design.mainframe.check.CheckButton=305*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=630*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=630*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=630*280
com.fr.design.report.ReportColumnsPane=800*600

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -0,0 +1,4 @@
com.fr.design.mainframe.check.CheckButton=280*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=610*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=610*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -0,0 +1,4 @@
com.fr.design.mainframe.check.CheckButton=230*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=490*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -1 +1,5 @@
# \u9ED8\u8BA4\u4E3A\u7C7B\u7684\u5168\u9650\u5B9A\u540D\uFF08\u53EF\u81EA\u5B9A\u4E49key\uFF09= width * height
com.fr.design.mainframe.check.CheckButton=250*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -0,0 +1,4 @@
com.fr.design.mainframe.check.CheckButton=250*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280

BIN
designer-base/src/main/resources/com/fr/design/images/lookandfeel/TipIcon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

BIN
designer-base/src/main/resources/com/fr/design/images/m_file/preview_sql.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

65
designer-base/src/test/java/com/fr/design/mod/ContentReplaceUtilTest.java

@ -0,0 +1,65 @@
package com.fr.design.mod;
import junit.framework.TestCase;
import org.junit.Assert;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class ContentReplaceUtilTest extends TestCase {
public void testReplaceContent() {
String text = "setTimeout(function() {\n" +
"\n" +
"\t$(\"div[widgetname=DATEEDITOR0]\").css({\n" +
"\n" +
"\t\t'opacity': '0.3'\n" +
"\n" +
"\t});\n" +
"\n" +
"}, 50);\n" +
"var a = \"dateEditor0\"";
String oldName = "dateEditor0";
String newName = "dateEditor00";
String result = "setTimeout(function() {\n" +
"\n" +
"\t$(\"div[widgetname=DATEEDITOR00]\").css({\n" +
"\n" +
"\t\t'opacity': '0.3'\n" +
"\n" +
"\t});\n" +
"\n" +
"}, 50);\n" +
"var a = \"dateEditor00\"";
Assert.assertEquals(result, ContentReplaceUtil.replaceContent(text, oldName, newName));
String text1 = "setInterval(function() {\n" +
"\t//获取当前body中tab的索引位置\n" +
" var aa = _g().getWidgetByName(\"tabpane00\").getShowIndex();\n" +
" //根据tab索引轮播tab块,索引从0开始,到最后一个tab块后跳转到第一个\n" +
"\tif(aa == TAB轮播-测试-2) {\n" +
" _g().getWidgetByName('tabpane00').showCardByIndex(0);\n" +
" } else {\n" +
"\n" +
" _g().getWidgetByName('tabpane00').showCardByIndex(aa + TAB轮播-测试-1);\n" +
" }\n" +
"}, TAB轮播-测试-2000);";
String oldName1 = "tabpane00";
String newName1 = "tabpane0";
String result1 = "setInterval(function() {\n" +
"\t//获取当前body中tab的索引位置\n" +
" var aa = _g().getWidgetByName(\"tabpane0\").getShowIndex();\n" +
" //根据tab索引轮播tab块,索引从0开始,到最后一个tab块后跳转到第一个\n" +
"\tif(aa == TAB轮播-测试-2) {\n" +
" _g().getWidgetByName('tabpane0').showCardByIndex(0);\n" +
" } else {\n" +
"\n" +
" _g().getWidgetByName('tabpane0').showCardByIndex(aa + TAB轮播-测试-1);\n" +
" }\n" +
"}, TAB轮播-测试-2000);";
Assert.assertEquals(result1, ContentReplaceUtil.replaceContent(text1, oldName1, newName1));
}
}

7
designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

@ -5,6 +5,7 @@ import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chartx.attr.ChartProvider;
import com.fr.design.DesignModelAdapter;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.HoverPainter;
@ -34,6 +35,7 @@ import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import java.util.Collections;
import java.util.HashMap;
import javax.swing.BorderFactory;
import javax.swing.JWindow;
import java.util.List;
@ -112,8 +114,13 @@ public class FormCreatorDropTarget extends DropTarget {
tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource(), true);
//合并数据集之后,可能会有数据集名称变化,做一下联动
//共享的组件拿的时候都是克隆的,这边改拖拽中克隆的对象而非新克隆对象,上面这个新克隆的对象只是为了拿数据集
Map<String, String> map = new HashMap<>();
for (Map.Entry<String, String> entry : tdNameMap.entrySet()) {
designer.getTarget().renameTableData(widget, entry.getKey(), entry.getValue());
map.put(entry.getKey(), entry.getValue());
}
if (!map.isEmpty()) {
DesignTableDataManager.fireDSChanged(map);
}
}
EventDispatcher.fire(TableDataModifyEvent.INSTANCE, new ContentChangeItem(tdNameMap, widget, ChangeItem.TABLE_DATA_NAME));

14
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -346,20 +346,6 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
if (jt == null) {
return;
}
int useCount = 0;
if (!jt.getProcessInfo().isTestTemplate()) {
JForm jForm = (JForm) jt;
XLayoutContainer root = jForm.getFormDesign().getRootComponent();
List<XCreator> xCreators = ShareComponentUtils.getHelpConfigXCreatorList(root);
JSONArray helpConfigUseInfo = ComponentCollector.getInstance().getHelpConfigUseInfoWithTemplate(jt.getTarget().getTemplateID());
for (XCreator xCreator : xCreators) {
if (helpConfigUseInfo.contains(ShareComponentUtils.getWidgetId(xCreator.toData()))) {
useCount++;
}
}
ComponentCollector.getInstance().collectHelpConfigInfo(jt.getTarget().getTemplateID(), xCreators.size(), useCount);
}
}
});

16
designer-realize/src/main/java/com/fr/design/share/SharableInitManager.java

@ -1,16 +0,0 @@
package com.fr.design.share;
import com.fr.design.base.clipboard.ClipboardFilter;
import com.fr.design.mainframe.share.collect.SharableCollectorManager;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler;
import com.fr.design.mainframe.share.util.SharableXMLUtils;
public class SharableInitManager {
public static void start() {
SharableXMLUtils.registerSharableReadHelper();
SharableCollectorManager.getInstance().execute();
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance());
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance());
}
}

49
designer-realize/src/main/java/com/fr/design/share/SharableManager.java

@ -0,0 +1,49 @@
package com.fr.design.share;
import com.fr.design.base.clipboard.ClipboardFilter;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.collect.SharableCollectorManager;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler;
import com.fr.design.mainframe.share.util.SharableXMLUtils;
import com.fr.design.mainframe.share.util.ShareComponentUtils;
import com.fr.design.share.utils.EffectItemUtils;
import com.fr.json.JSONArray;
import java.util.List;
public class SharableManager {
public static void start() {
SharableXMLUtils.registerSharableReadHelper();
SharableCollectorManager.getInstance().execute();
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance());
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance());
}
public static void saveTemplate(JTemplate jt) {
if (jt instanceof JForm) {
int showCount = 0;
int useCount = 0;
if (!jt.getProcessInfo().isTestTemplate()) {
JForm jForm = (JForm) jt;
XLayoutContainer root = jForm.getFormDesign().getRootComponent();
List<XCreator> xCreators = ShareComponentUtils.getHelpConfigXCreatorList(root);
JSONArray helpConfigUseInfo = ComponentCollector.getInstance().getHelpConfigUseInfoWithTemplate(jForm.getTarget().getTemplateID());
for (XCreator xCreator : xCreators) {
if (EffectItemUtils.hasEffectItem(xCreator.toData())) {
showCount ++;
if (helpConfigUseInfo.contains(ShareComponentUtils.getWidgetId(xCreator.toData()))) {
useCount++;
}
}
}
ComponentCollector.getInstance().collectHelpConfigInfo(jForm.getTarget().getTemplateID(), showCount, useCount);
}
}
}
}

2
designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java

@ -17,6 +17,7 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.ui.base.PlaceholderTextArea;
import com.fr.design.mainframe.share.util.ShareComponentUtils;
import com.fr.design.share.SharableManager;
import com.fr.design.share.effect.EffectItemGroup;
import com.fr.design.share.utils.EffectItemUtils;
import com.fr.design.share.utils.ShareDialogUtils;
@ -201,6 +202,7 @@ public class ShareConfigPane extends BasicPane {
}
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().saveTemplate();
ComponentCollector.getInstance().setHelpConfigUseInfo(ShareComponentUtils.getCurrentTemplateID(), ShareComponentUtils.getWidgetId(widget));
SharableManager.saveTemplate(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate());
}
});
dialog.setVisible(true);

5
designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java

@ -19,4 +19,9 @@ public class EffectItemUtils {
}
return effectItemGroupList;
}
public static boolean hasEffectItem(Widget widget) {
EffectItemGroup effectItemGroup = new EffectItemGroup(widget);
return effectItemGroup.getEffectItems().size() > 0;
}
}

2
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -38,6 +38,7 @@ import com.fr.design.module.ChartEmptyDataStyleAction;
import com.fr.design.module.ChartPreStyleAction;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.monitor.DesignerLifecycleMonitorContext;
import com.fr.design.share.SharableManager;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.event.Event;
@ -235,6 +236,7 @@ public class MainDesigner extends BaseDesigner {
jt.stopEditing();
jt.saveDirectly();
jt.requestFocus();
SharableManager.saveTemplate(jt);
}
});
}

4
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -61,7 +61,7 @@ import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.parameter.FormParameterReader;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.design.parameter.WorkBookParameterReader;
import com.fr.design.share.SharableInitManager;
import com.fr.design.share.SharableManager;
import com.fr.design.share.ui.config.ShareConfigPane;
import com.fr.design.share.ui.generate.ShareGeneratePane;
import com.fr.design.update.actions.RecoverForDesigner;
@ -207,7 +207,7 @@ public class DesignerActivator extends Activator {
designerRegister();
InformationCollector.getInstance().collectStartTime();
SharableInitManager.start();
SharableManager.start();
}
private void createPluginListener() {

Loading…
Cancel
Save