Browse Source

Merge pull request #4542 in DESIGN/design from feature/10.0 to feature/x

* commit 'c25daaf9f12a30c2ae2751f29ab72de191c5de2d': (26 commits)
  KERNEL-7634 gradle 依赖问题
  REPORT-53695 设计器在未激活情况下弹出登录引导页面
  REPORT-53626 设计器启动异常
  REPORT-53674 已登录工程升级到最新版本jar后仍会有登录提醒
  登录面板不显示
  REPORT-51958 远程环境检测及同步
  REPORT-51958 远程环境检测及同步
  REPORT-51958 远程环境检测及同步
  REPORT-51958 远程环境检测及同步
  REPORT-53367 复制传参后sql-远程下,新增的转义字符提示失效
  REPORT-53601 & REPORT-53614  结果文本框框设置不可编辑。进度条更新设置
  REPORT-53601 & REPORT-53614  结果文本框框设置不可编辑。进度条更新设置
  REPORT-53157 值一样 对象地址不一样的对象同样需要被返回处理
  REPORT-53592 扩展图表创建共享组件npe问题
  REPORT-53362 复制传参后sql-鼠标悬浮查看设计器面板,会多出来查看执行sql的界面
  REPORT-53367 复制传参后sql-远程下,新增的转义字符提示失效
  REPORT-53367 复制传参后sql-远程下,新增的转义字符提示失效
  REPORT-52539 window上生成面板出现了滚动条
  REPORT-53133 组件复用-合入主版本-有俩商城下载下来的复用组件,拖入后组件树处没显示复用组件的图标,麻烦看下是这俩组件结构有啥问题嘛
  REPORT-53135 漏交
  ...
persist/11.0
superman 4 years ago
parent
commit
79980316f9
  1. 29
      build.gradle
  2. 3
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  3. 71
      designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java
  4. 176
      designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java
  5. 5
      designer-base/src/main/java/com/fr/design/dialog/NotificationDialogAction.java
  6. 3
      designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java
  7. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  8. 5
      designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java
  9. 8
      designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java
  10. 3
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  11. 32
      designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java
  12. 7
      designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java
  13. 5
      designer-base/src/main/java/com/fr/design/mod/ContentReplacer.java
  14. 10
      designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java
  15. 4
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/JavaScriptContentReplacer.java
  16. 5
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/VanChartHtmlLabelContentReplacer.java
  17. 19
      designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java
  18. 23
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  19. 50
      designer-base/src/main/java/com/fr/env/CheckServiceDialog.java
  20. 1
      designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java
  21. 2
      designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java
  22. BIN
      designer-base/src/main/resources/com/fr/design/images/lookandfeel/circularErrorIcon.png
  23. BIN
      designer-base/src/main/resources/com/fr/design/images/lookandfeel/circularWarningIcon.png
  24. BIN
      designer-base/src/main/resources/com/fr/design/images/lookandfeel/newMessageIcon.png
  25. 2
      designer-base/src/main/resources/com/fr/design/login/login.js
  26. 17
      designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java
  27. 14
      designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java
  28. 14
      designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java
  29. 10
      designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java
  30. 4
      designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java
  31. 28
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java
  32. 13
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java
  33. 3
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
  34. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

29
build.gradle

@ -28,17 +28,6 @@ dependencies {
api project(':designer-realize')
}
configurations.all {
resolutionStrategy {
force 'com.fr.third:jxbrowser:6.23'
force 'com.fr.third:jxbrowser-mac:6.23'
force 'com.fr.third:jxbrowser-win64:6.23'
force 'com.fr.third:jxbrowser:7.5'
force 'com.fr.third:jxbrowser-mac:7.5'
force 'com.fr.third:jxbrowser-win64:7.5'
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'java-library'
@ -68,18 +57,12 @@ allprojects {
}
dependencies {
implementation ('com.fr.third:jxbrowser:6.23') {
force = true
}
implementation ('com.fr.third:jxbrowser-mac:6.23') {
force = true
}
implementation ('com.fr.third:jxbrowser-win64:6.23') {
force = true
}
implementation 'com.fr.third:jxbrowser:7.5'
implementation 'com.fr.third:jxbrowser-mac:7.5'
implementation 'com.fr.third:jxbrowser-win64:7.5'
implementation 'com.fr.third:jxbrowser:6.23'
implementation 'com.fr.third:jxbrowser-mac:6.23'
implementation 'com.fr.third:jxbrowser-win64:6.23'
implementation 'com.fr.third:jxbrowser-v7:7.5'
implementation 'com.fr.third:jxbrowser-mac-v7:7.5'
implementation 'com.fr.third:jxbrowser-win64-v7:7.5'
implementation 'com.fr.third:jxbrowser-swing:7.5'
implementation 'com.fr.third.server:servlet-api:3.0'
implementation 'org.swingexplorer:swexpl:2.0.1'

3
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -18,11 +18,10 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.DesignUtils;
import com.fr.env.CheckServiceDialog;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.env.EnvListPane;
import com.fr.env.RemoteWorkspaceURL;
import com.fr.env.TestConnectionResult;
import com.fr.env.VersionCheckMessageDialog;
import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;

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

@ -46,6 +46,8 @@ import java.awt.Frame;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@ -107,11 +109,11 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
topPanel.add(imagePanel, BorderLayout.WEST);
topPanel.add(messagePanel, BorderLayout.CENTER);
topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,0,10));
topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
//中间的SQL面板
centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
centerPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
JScrollPane scrollPane = new JScrollPane();
JTextArea checkArea = new JTextArea(sql);
checkArea.setEditable(false);
@ -135,7 +137,7 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
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.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
bottomPanel.add(okButton, BorderLayout.EAST);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql"));
@ -144,6 +146,12 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
this.add(centerPanel, BorderLayout.CENTER);
this.add(bottomPanel, BorderLayout.SOUTH);
this.setSize(600, 400);
this.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
close();
}
});
GUICoreUtils.centerWindow(this);
}
@ -167,42 +175,34 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
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);
parameter.setValue(parameterMap.get(parameter.getName()));
}
}
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);
}
NameSpace ns = ParameterMapNameSpace.create(parameterMap);
calculator.pushNameSpace(ns);
Parameter[] paras = processParameters(tableData, calculator);
// 所有被转义参数的集合
refreshEscapeSqlHelper();
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;
}
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);
@ -217,6 +217,13 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
pane.setVisible(true);
}
private static void refreshEscapeSqlHelper() {
EscapeSqlHelper.getInstance().setUseForbidWord(ConfigService.getInstance().getPSIConfig().isUseForbidWord());
EscapeSqlHelper.getInstance().setSelectedForbidWord(ConfigService.getInstance().getPSIConfig().getSelectedForbidWord());
EscapeSqlHelper.getInstance().setUseEscapeSpecialChar(ConfigService.getInstance().getPSIConfig().isUseEscapeSpecialChar());
EscapeSqlHelper.getInstance().setSelectedSpecialChar(ConfigService.getInstance().getPSIConfig().getSelectedSpecialChar());
}
private static boolean isShowSpecialCharSqlPane(List<int[]> specialCharParamIndex) {
return specialCharParamIndex != null && !specialCharParamIndex.isEmpty();
}
@ -274,4 +281,8 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener {
public void actionPerformed(ActionEvent e) {
this.dispose();
}
private void close() {
this.dispose();
}
}

176
designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java

@ -0,0 +1,176 @@
package com.fr.design.dialog;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.UIManager;
/**
* 带查看详情的简要通知框
*
*/
public class NotificationDialog extends JDialog {
public static final int ERROR_MESSAGE = 0;
public static final int NEW_MESSAGE = 1;
public static final int WARNING_MESSAGE = 2;
public static final String HTML_TAG_1 = "<html>";
public static final String HTML_TAG_2 = "</html>";
private UILabel messageText;
private NotificationDialogAction notificationDialogAction;
public NotificationDialog(Frame owner, String title, boolean isModal, int messageType, String message,NotificationDialogAction action) {
super(owner);
setTitle(title);
initComponents(messageType, message, isModal,action);
}
public NotificationDialog(Builder builder) {
super(builder.owner);
setTitle(builder.title);
initComponents(builder.messageType, builder.message, builder.modal, builder.action);
}
public void initComponents(int messageType, String message, boolean isModal,NotificationDialogAction action) {
notificationDialogAction = action;
setModal(isModal);
setResizable(false);
//消息内容
UILabel icon = new UILabel(getIconForType(messageType));
JPanel iconPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
iconPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 8));
iconPanel.add(icon);
add(iconPanel, BorderLayout.WEST);
messageText = new UILabel(HTML_TAG_1 + message + HTML_TAG_2);
messageText.setForeground(new Color(51, 51, 52));
JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
centerPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 10));
JScrollPane jScrollPane = new JScrollPane(messageText, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane.setBorder(BorderFactory.createEmptyBorder());
centerPanel.add(jScrollPane, BorderLayout.CENTER);
add(centerPanel, BorderLayout.CENTER);
//查看详情
UILabel detailLabel = new UILabel();
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
detailLabel.setForeground(Color.BLUE);
JPanel detailPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
detailPanel.add(detailLabel, BorderLayout.EAST);
add(detailPanel, BorderLayout.SOUTH);
setPreferredSize(new Dimension(262, 135));
detailLabel.addMouseListener(detailClickListener);
messageText.addMouseListener(detailClickListener);
pack();
if (getOwner() != null) {
GUICoreUtils.setWindowCenter(getOwner(), this);
}
}
private MouseListener detailClickListener = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if(notificationDialogAction != null){
hideDialog();
notificationDialogAction.doClick();
}
}
};
/**
* 设置通知消息
*/
public void setMessage(String message){
messageText.setText(HTML_TAG_1 + message + HTML_TAG_2);
}
private void hideDialog(){
this.dispose();
}
protected Icon getIconForType(int messageType) {
String propertyName;
switch (messageType) {
case 0:
propertyName = "OptionPane.circularErrorIcon";
break;
case 1:
propertyName = "OptionPane.newMessageIcon";
break;
case 2:
propertyName = "OptionPane.warningIcon";
break;
default:
return null;
}
return UIManager.getIcon(propertyName);
}
public static Builder Builder() {
return new NotificationDialog.Builder();
}
public static final class Builder {
public int messageType = WARNING_MESSAGE;
public String message;
public boolean modal = true;
public Frame owner = null;
public String title;
public NotificationDialogAction action;
private Builder() {
}
public NotificationDialog build() {
return new NotificationDialog(this);
}
public Builder owner(Frame owner) {
this.owner = owner;
return this;
}
public Builder messageType(int messageType) {
this.messageType = messageType;
return this;
}
public Builder message(String message) {
this.message = message;
return this;
}
public Builder modal(boolean modal) {
this.modal = modal;
return this;
}
public Builder title(String title) {
this.title = title;
return this;
}
public Builder notificationDialogAction(NotificationDialogAction action) {
this.action = action;
return this;
}
}
}

5
designer-base/src/main/java/com/fr/design/dialog/NotificationDialogAction.java

@ -0,0 +1,5 @@
package com.fr.design.dialog;
public interface NotificationDialogAction {
void doClick();
}

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

@ -176,6 +176,9 @@ public class UILookAndFeel extends MetalLookAndFeel {
table.put("OptionPane.narrow.right", loadIcon("Icon_Narrow_Right_16x16.png", this));
table.put("OptionPane.narrow.down", loadIcon("Icon_Narrow_Down_16x16.png", this));
table.put("OptionPane.warningIcon", loadIcon("WarningIcon.png", this));
table.put("OptionPane.circularWarningIcon", loadIcon("circularWarningIcon.png", this));
table.put("OptionPane.newMessageIcon", loadIcon("newMessageIcon.png", this));
table.put("OptionPane.circularErrorIcon", loadIcon("circularErrorIcon.png", this));
table.put("OptionPane.questionIcon", loadIcon("QuestionIcon.png", this));
table.put("OptionPane.tipIcon", loadIcon("TipIcon.png", this));
table.put("ScrollPane.border", new UIScrollPaneBorder());

4
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -482,7 +482,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L
UILabel label = new UILabel(labelText + getWrapperLabelText()) {
@Override
public void paint(Graphics g) {
((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));
((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
super.paint(g);
}
};
@ -490,7 +490,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L
label.setOpaque(true);
label.setBackground(Color.WHITE);
label.setForeground(Color.decode("#333334"));
label.setFont(label.getFont().deriveFont(10F));
label.setFont(label.getFont().deriveFont(11F));
label.setPreferredSize(new Dimension(224, 26));
this.nameEdList = nameEdList;
this.add(label, BorderLayout.NORTH);

5
designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java

@ -68,12 +68,9 @@ public class DesignerLoginHelper {
if (dialog == null) {
if (window instanceof Dialog) {
dialog = new DesignerLoginShowDialog((Dialog) window, designerLoginPane);
} else if (window instanceof Frame) {
dialog = new DesignerLoginShowDialog((Frame) window, designerLoginPane);
} else {
return;
dialog = new DesignerLoginShowDialog((Frame) window, designerLoginPane);
}
}
dialog.setVisible(true);
}

8
designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java

@ -5,6 +5,7 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.event.DesignerOpenedListener;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.stable.StringUtils;
import javax.swing.WindowConstants;
/**
@ -54,7 +55,12 @@ public class DesignerGuideHelper {
* 激活满一周
*/
private static boolean isActivatedForOneWeek() {
return (System.currentTimeMillis() - DesignerEnvManager.getEnvManager().getDesignerActivatedTime()) > ONE_WEEK;
DesignerEnvManager manager = DesignerEnvManager.getEnvManager();
String key = manager.getActivationKey();
if (StringUtils.isEmpty(key)) {
return false;
}
return (System.currentTimeMillis() - manager.getDesignerActivatedTime()) > ONE_WEEK;
}
/**

3
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -72,6 +72,7 @@ import com.fr.start.OemHandler;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import java.util.concurrent.CopyOnWriteArrayList;
import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
@ -133,7 +134,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private static final Integer TOP_LAYER = 200;
private List<DesignerOpenedListener> designerOpenedListenerList = new ArrayList<>();
private List<DesignerOpenedListener> designerOpenedListenerList = new CopyOnWriteArrayList<>();
private ToolBarMenuDock ad;

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

@ -9,6 +9,8 @@ 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.design.mod.impl.repalce.JavaScriptContentReplacer;
import com.fr.design.mod.impl.repalce.VanChartHtmlLabelContentReplacer;
import com.fr.form.main.FormHyperlink;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.WidgetTitle;
@ -22,6 +24,8 @@ 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.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@ -45,10 +49,12 @@ public class ContentObjectManager {
/**
* 放置所有需要替换内容的对象
*/
private Map<String, Set<Object>> objectMap;
private Map<String, Collection<Object>> objectMap;
private final Set<String> set = new HashSet<>();
private final Map<String, ContentReplacer> map = new HashMap<>();
private ContentObjectManager() {
set.add(Formula.class.getName());
set.add(JavaScriptImpl.class.getName());
@ -70,6 +76,8 @@ public class ContentObjectManager {
set.add(SelectCount.class.getName());
set.add(WidgetTitle.class.getName());
set.add(FunctionGrouper.class.getName());
map.put(JavaScriptImpl.class.getName(), new JavaScriptContentReplacer());
map.put(VanChartHtmlLabel.class.getName(), new VanChartHtmlLabelContentReplacer());
}
public void searchObject(Object ob) {
@ -84,12 +92,32 @@ public class ContentObjectManager {
objectMap = ClassHelper.searchObject(ob, set, filter);
}
public void clearObject() {
if (objectMap != null) {
objectMap.clear();
}
objectMap = null;
}
@Nullable
public Map<String, Set<Object>> getObjectMap() {
public Map<String, Collection<Object>> getObjectMap() {
return objectMap;
}
public boolean needContentTip(Object ob, Set<String> nameSet) {
objectMap = ClassHelper.searchObject(ob, set, ModClassFilter.getInstance());
for (Map.Entry<String, Collection<Object>> entry : objectMap.entrySet()) {
for (Object o : entry.getValue()) {
for (String name : nameSet) {
ContentReplacer contentReplacer = map.get(entry.getKey());
if (contentReplacer!= null && contentReplacer.contain(o, name)) {
clearObject();
return true;
}
}
}
}
clearObject();
return false;
}
}

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

@ -168,5 +168,12 @@ public class ContentReplaceUtil {
return content;
}
public static boolean containsName(String content, String name) {
if (StringUtils.isNotEmpty(content)) {
return content.contains(name);
}
return false;
}
}

5
designer-base/src/main/java/com/fr/design/mod/ContentReplacer.java

@ -10,4 +10,9 @@ public interface ContentReplacer<T> {
void replace(T t, String oldName, String newName);
default boolean contain(T t, String name) {
return false;
}
}

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

@ -29,9 +29,9 @@ import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.log.FineLoggerFactory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 默认联动内容替换器实现
@ -106,14 +106,14 @@ public class ContentReplacerCenter {
}
private void onRename(List<ContentChangeItem> contentChangeItemList, List<ContentChange> contentChangeList) {
Map<String, Set<Object>> objectMap = ContentObjectManager.getInstance().getObjectMap();
Map<String, Collection<Object>> objectMap = ContentObjectManager.getInstance().getObjectMap();
if (objectMap != null) {
long start = System.currentTimeMillis();
for (ContentChange contentChange : contentChangeList) {
Set<Object> set = objectMap.get(contentChange.type());
Collection<Object> objects = objectMap.get(contentChange.type());
// 所有需要处理的js等对象
if (set != null) {
for (Object ob : set) {
if (objects != null) {
for (Object ob : objects) {
fireChange(ob, contentChange, contentChangeItemList);
}
}

4
designer-base/src/main/java/com/fr/design/mod/impl/repalce/JavaScriptContentReplacer.java

@ -19,4 +19,8 @@ public class JavaScriptContentReplacer implements ContentReplacer<JavaScriptImpl
}
}
@Override
public boolean contain(JavaScriptImpl javaScript, String name) {
return ContentReplaceUtil.containsName(javaScript.getContent(), name);
}
}

5
designer-base/src/main/java/com/fr/design/mod/impl/repalce/VanChartHtmlLabelContentReplacer.java

@ -19,4 +19,9 @@ public class VanChartHtmlLabelContentReplacer implements ContentReplacer<VanChar
ContentReplaceUtil.replaceContent(vanChartHtmlLabel.getCustomText(), oldName, newName));
}
}
@Override
public boolean contain(VanChartHtmlLabel vanChartHtmlLabel, String name) {
return ContentReplaceUtil.containsName(vanChartHtmlLabel.getCustomText(), name);
}
}

19
designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java

@ -2,22 +2,33 @@ package com.fr.design.update.actions;
import com.fr.decision.update.SyncExecutor;
import com.fr.decision.update.info.UpdateCallBack;
import com.fr.decision.update.info.UpdateProgressCallBack;
import com.fr.design.i18n.Toolkit;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.log.FineLoggerFactory;
import java.util.concurrent.ExecutionException;
import javax.swing.JProgressBar;
import javax.swing.SwingWorker;
public abstract class SyncFileProcess extends SwingWorker<Boolean, Void> {
private UpdateCallBack callBack;
private String buildNo;
private JProgressBar bar;
public SyncFileProcess(UpdateCallBack callBack,String buildNo) {
this.callBack = callBack;
public SyncFileProcess(JProgressBar bar, String buildNo) {
this.bar = bar;
this.buildNo = buildNo;
}
@Override
protected Boolean doInBackground() throws Exception {
return SyncExecutor.getInstance().execute(callBack,buildNo);
UpdateCallBack callBack = new UpdateProgressCallBack(bar);
boolean result = SyncExecutor.getInstance().execute(callBack, buildNo);
if (result) {
bar.setValue(0);
bar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins"));
VersionCheckUtils.syncPlugins(VersionCheckUtils.checkLocalAndRemotePlugin());
}
return result;
}
@Override

23
designer-base/src/main/java/com/fr/design/VersionCheckUtils.java → designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -1,11 +1,14 @@
package com.fr.design;
package com.fr.design.versioncheck;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.NotificationDialog;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.RemoteWorkspace;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.env.CheckServiceDialog;
import com.fr.env.VersionCheckMessageDialog;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
@ -30,6 +33,9 @@ import com.fr.workspace.engine.base.FineObjectPool;
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest;
import com.fr.workspace.engine.exception.WorkspaceConnectionException;
import com.fr.workspace.engine.rpc.WorkspaceProxyPool;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.lang.reflect.Method;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
@ -226,21 +232,21 @@ public class VersionCheckUtils {
}
remotePlugin.put("type", INCONSISTENCY);
}
}
remotePlugin.put("type", MISSING);
if (remotePlugin.getString(NAME) == null) {
remotePlugin.put(NAME, remotePlugin.getString("id"));
} else {
remotePlugin.put("type", MISSING);
if (remotePlugin.getString(NAME) == null) {
remotePlugin.put(NAME, remotePlugin.getString("id"));
}
}
differentPlugins.put(remotePlugin);
}
return differentPlugins;
}
public static JSONArray syncPlugins(JSONArray differentPlugins) {
public static void syncPlugins(JSONArray differentPlugins) {
Set<String> uninstallFailed = uninstallPlugins(differentPlugins);
List<PluginMarker> plugins = getSyncPlugins(differentPlugins, uninstallFailed);
installPlugins(plugins);
return getPluginsSyncFailed(differentPlugins);
}
private static List<PluginMarker> getSyncPlugins(JSONArray differentPlugins, Set<String> uninstallFailed) {
@ -296,7 +302,7 @@ public class VersionCheckUtils {
return uninstallFailedID;
}
private static JSONArray getPluginsSyncFailed(JSONArray differentPlugins){
public static JSONArray getPluginsSyncFailed(JSONArray differentPlugins){
JSONArray pluginsNeedSync = JSONArray.create();
List<PluginContext> localPlugins = PluginManager.getContexts();
Map<String, String> localPluginsInfo = new HashMap<>();
@ -326,6 +332,7 @@ public class VersionCheckUtils {
@Override
public void done(PluginTaskResult result) {
latch.countDown();
FineLoggerFactory.getLogger().info("installPlugin: " + result.getCurrentTask().getMarker().getPluginID());
}
});
}

50
designer-base/src/main/java/com/fr/env/CheckServiceDialog.java vendored

@ -1,10 +1,7 @@
package com.fr.env;
import com.fr.decision.update.data.UpdateConstants;
import com.fr.decision.update.info.UpdateCallBack;
import com.fr.decision.update.info.UpdateProgressCallBack;
import com.fr.design.RestartHelper;
import com.fr.design.VersionCheckUtils;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
@ -15,6 +12,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.update.actions.SyncFileProcess;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.general.CloudCenter;
import com.fr.general.CloudCenterConfig;
import com.fr.general.ComparatorUtils;
@ -40,7 +38,6 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.util.List;
import java.util.concurrent.ExecutionException;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JDialog;
@ -155,7 +152,7 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
detailsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {affectedFunctionsDetailsPane}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}};
hideAffectedFunctionsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}};
if (noExistServiceDescription.size() > 0 && !ComparatorUtils.equals(remoteBranch, localBranch)) {
detailsRowSize = new double[]{p, p, p, p,p,p};
detailsRowSize = new double[]{p, p, p, p, p, p};
detailsInnerPane = TableLayoutHelper.createTableLayoutPane(detailsComponents, detailsRowSize, detailsColumnSize);
} else {
detailsRowSize = new double[]{p, p, 0, 0, p, p};
@ -316,7 +313,6 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION, QUESTION_MESSAGE, IOUtils.readIcon("com/fr/design/icon/versioncheck/question.png"), option, 1);
if (0 == a) {
//jar包一致的话只更新插件
UpdateCallBack callBack = new UpdateProgressCallBack(progressBar);
progressBar.setVisible(true);
progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message"));
syncButton.setEnabled(false);
@ -326,36 +322,17 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
final JFrame frame = DesignerContext.getDesignerFrame();
final RestartHelper helper = new RestartHelper();
FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY);
new SyncFileProcess(callBack, remoteBuildNo) {
new SyncFileProcess(progressBar, remoteBuildNo) {
@Override
public void onDownloadSuccess() {
deleteForDesignerUpdate(installLib);
//主jar下载成功之后再卸载安装插件
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins"));
progressBar.setValue(0);
new SwingWorker<JSONArray, Void>() {
@Override
protected JSONArray doInBackground() {
return VersionCheckUtils.syncPlugins(differentPlugins);
}
@Override
protected void done() {
progressBar.setVisible(false);
JSONArray syncFailedPlugins = null;
try {
syncFailedPlugins = get();
} catch (Exception ex) {
FineLoggerFactory.getLogger().error(ex.getMessage(), ex);
}
if (syncFailedPlugins != null && syncFailedPlugins.size() > 0) {
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins);
syncFailedPluginsDialog.setVisible(true);
}
helper.restartForUpdate(frame);
}
}.execute();
progressBar.setVisible(false);
JSONArray syncFailedPlugins = VersionCheckUtils.getPluginsSyncFailed(differentPlugins);
if (syncFailedPlugins.size() > 0) {
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins);
syncFailedPluginsDialog.setVisible(true);
}
helper.restartForUpdate(frame);
}
@Override
@ -369,13 +346,14 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
}.execute();
} else {
//到这边说明主jar是一致的,就只尝试同步插件
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins"));
progressBar.setValue(0);
new SwingWorker<JSONArray, Void>() {
@Override
protected JSONArray doInBackground() {
return VersionCheckUtils.syncPlugins(differentPlugins);
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins"));
progressBar.setValue(0);
VersionCheckUtils.syncPlugins(differentPlugins);
return VersionCheckUtils.getPluginsSyncFailed(differentPlugins);
}
@Override

1
designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java vendored

@ -77,6 +77,7 @@ public class SyncFailedPluginsDialog extends JDialog {
detailsText.append(plugin.getString("name")).append(",").append(Toolkit.i18nText("Fine-Design_Basic_Sync_Server_Version")).append(plugin.getString("version")).append("\n");
}
detailsTextArea.setText(detailsText.toString());
detailsTextArea.setEditable(false);
scrollPane = new JScrollPane(detailsTextArea);
centerPanel.add(detailsTitlePanel,BorderLayout.NORTH);
centerPanel.add(scrollPane,BorderLayout.CENTER);

2
designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java vendored

@ -1,6 +1,6 @@
package com.fr.env;
import com.fr.design.VersionCheckUtils;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

2
designer-base/src/main/resources/com/fr/design/login/login.js

File diff suppressed because one or more lines are too long

17
designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java

@ -112,6 +112,21 @@ public class XWTitleLayout extends DedicateLayoutContainer {
return null;
}
/**
* 返回body组件
* @return body组件
*/
public XCreator getBodyCreator() {
for (int i=0; i < getXCreatorCount(); i++) {
XCreator creator = getXCreator(i);
if (creator.hasTitleStyle()) {
return creator;
}
}
return null;
}
/**
* 编辑状态的时候需要重新绘制下边框
*
@ -196,4 +211,4 @@ public class XWTitleLayout extends DedicateLayoutContainer {
super.setShareId(shareId);
this.getEditingChildCreator().setShareId(shareId);
}
}
}

14
designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java

@ -1,13 +1,11 @@
package com.fr.design.designer.treeview;
import com.fr.base.BaseUtils;
import com.fr.base.iofile.attr.ExtendSharableAttrMark;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.design.mainframe.share.util.ShareComponentUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
@ -38,7 +36,7 @@ public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer {
}
if (icon != null) {
setIcon(icon);
this.needAddShareIcon = isShareWidget((XCreator) value);
this.needAddShareIcon = ShareComponentUtils.isShareWidgetWithChild((XCreator) value);
}
}
@ -47,14 +45,6 @@ public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer {
return this;
}
private boolean isShareWidget(XCreator xCreator) {
if (!xCreator.toData().acceptType(AbstractBorderStyleWidget.class)) {
return false;
}
ExtendSharableAttrMark attrMark = ((AbstractBorderStyleWidget) xCreator.toData()).getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG);
return attrMark != null && StringUtils.isNotEmpty(attrMark.getShareId());
}
public void paint(Graphics g) {
super.paint(g);

14
designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java

@ -5,6 +5,7 @@ import com.fr.base.iofile.attr.ExtendSharableAttrMark;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWTitleLayout;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.FormSelection;
@ -91,6 +92,19 @@ public class ShareComponentUtils {
return false;
}
public static boolean isShareWidgetWithChild(XCreator xCreator) {
boolean result = isShareWidget(xCreator);
if (result) {
return true;
}
//做下兼容处理,老的组件结构的共享信息存储在子组件上
if (xCreator instanceof XWTitleLayout) {
XCreator child = ((XWTitleLayout) xCreator).getBodyCreator();
return isShareWidget(child);
}
return false;
}
public static List<XCreator> getHelpConfigXCreatorList(XCreator root) {
List<XCreator> helpConfigXCreatorList = new ArrayList<>();

10
designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java

@ -111,8 +111,11 @@ public class EffectItemGroup {
ChartCollection chartCollection = (ChartCollection) value;
for (int index = 0; index < chartCollection.getChartCount(); index++) {
Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class);
SourceNode chartSourceNode = SourceNodeUtils.createSourceNode(chart.getPlot(), chartCollection.getChartName(index), cellSourceNode);
Plot plot = chart.getPlot();
if (plot == null) {
continue;
}
SourceNode chartSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), cellSourceNode);
initChartPlot(plot, chartSourceNode, false);
}
@ -126,8 +129,11 @@ public class EffectItemGroup {
ChartCollection chartCollection = (ChartCollection) editor.getChartCollection();
for (int index = 0; index < chartCollection.getChartCount(); index++) {
Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class);
SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(chart.getPlot(), chartCollection.getChartName(index), null);
Plot plot = chart.getPlot();
if (plot == null) {
continue;
}
SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), null);
initChartPlot(plot, plotSourceNode, false);
}

4
designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java

@ -56,8 +56,8 @@ public class EffectContent extends JPanel {
Object[] columnNames = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_From"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Rename")};
JTable table = new JTable(new EffectTableModel(effectItemGroup, columnNames));
table.setRowHeight(25);
table.getColumnModel().getColumn(0).setPreferredWidth(235);
table.getColumnModel().getColumn(1).setPreferredWidth(325);
table.getColumnModel().getColumn(0).setPreferredWidth(230);
table.getColumnModel().getColumn(1).setPreferredWidth(320);
table.setDefaultEditor(EffectTableModel.class, new EffectItemEditor(table));

28
designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java

@ -1,5 +1,6 @@
package com.fr.design.share.ui.generate;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -11,11 +12,14 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.share.Bean.ComponentGenerateInfo;
import com.fr.design.mainframe.share.action.ShareUIAspect;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.exception.LackOfValueException;
import com.fr.design.mainframe.share.generate.ComponentGeneratorCenter;
import com.fr.design.mainframe.share.select.ComponentTransformerFactory;
import com.fr.design.mod.ContentObjectManager;
import com.fr.form.share.exception.NetWorkFailedException;
import com.fr.form.share.group.DefaultShareGroup;
import com.fr.design.mainframe.share.util.ShareUIUtils;
@ -31,6 +35,8 @@ import com.fr.form.ui.Widget;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import java.util.HashSet;
import java.util.Set;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
@ -56,7 +62,7 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE;
**/
public class ShareGeneratePane extends BasicPane {
private static final Dimension DIALOG_SIZE = new Dimension(670, 740);
private static final Dimension DIALOG_SIZE = new Dimension(670, 760);
private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610);
private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6);
@ -100,8 +106,9 @@ public class ShareGeneratePane extends BasicPane {
JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.mainPane = FRGUIPaneFactory.createCardLayout_S_Pane();
this.simplePane = new ShareMainPane(shareCover, rec, false, effectItemGroups);
this.uploadPane = new ShareMainPane(shareCover, rec, true, effectItemGroups);
boolean needContentTip = needContentTip();
this.simplePane = new ShareMainPane(shareCover, rec, false, effectItemGroups, needContentTip);
this.uploadPane = new ShareMainPane(shareCover, rec, true, effectItemGroups, needContentTip);
//暂时换一下,目前不用上传
this.mainPane.add(simplePane, ShareUIUtils.convertStateChange(ItemEvent.DESELECTED));
this.mainPane.add(uploadPane, ShareUIUtils.convertStateChange(ItemEvent.SELECTED));
@ -161,6 +168,21 @@ public class ShareGeneratePane extends BasicPane {
}
}
private boolean needContentTip() {
long start = System.currentTimeMillis();
XCreator xCreator = ComponentTransformerFactory.getInstance().transform(WidgetPropertyPane.getInstance().getEditingFormDesigner().getSelectionModel().getSelection()).getMiddle();
Set<XCreator> xCreators = new HashSet<>();
xCreator.traversalNameRelatedXCreators(xCreators);
Set<String> nameSet = new HashSet<>();
for (XCreator creator : xCreators) {
nameSet.add(creator.toData().getWidgetName());
}
boolean result = ContentObjectManager.getInstance().needContentTip(shareWidget, nameSet);
FineLoggerFactory.getLogger().debug("needContentTip spend {} ms", (System.currentTimeMillis() - start));
return result;
}
private JPanel createUploadCheckBox() {
JPanel panel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();

13
designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java

@ -131,13 +131,15 @@ public class ShareMainPane extends JPanel {
private boolean upload;
private List<EffectItemGroup> effectItemGroups;
private final boolean needContentTip;
public ShareMainPane(Image shareCover, Rectangle rec, boolean upload, List<EffectItemGroup> effectItemGroups) {
public ShareMainPane(Image shareCover, Rectangle rec, boolean upload, List<EffectItemGroup> effectItemGroups, boolean needContentTip) {
this.shareCover = shareCover;
this.rec = rec;
this.upload = upload;
this.effectItemGroups = effectItemGroups;
this.needContentTip = needContentTip;
initCover(shareCover);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -174,7 +176,14 @@ public class ShareMainPane extends JPanel {
private JPanel createOverviewPane(boolean upload) {
JPanel componentPane = createComponentOverviewPane(upload);
String title = Toolkit.i18nText("Fine-Design_Share_Overview");
JPanel overviewPane = FRGUIPaneFactory.createTitledBorderPane(title);
JPanel overviewPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(title);
if (needContentTip) {
UILabel tipsLabel = ShareUIUtils.createTipsLabel(Toolkit.i18nText("Fine-Design_Share_Generate_Content_Tip"));
tipsLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
panel.add(tipsLabel);
overviewPane.add(panel, BorderLayout.NORTH);
}
overviewPane.add(componentPane, BorderLayout.CENTER);
return overviewPane;

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

@ -448,9 +448,10 @@ public class DesignerActivator extends Activator implements Prepare {
manager.setDesignerLoginUsername(MarketConfig.getInstance().getBbsUsername());
manager.setDesignerLoginAppId(MarketConfig.getInstance().getBbsAppId());
manager.setDesignerLoginRefreshToken(MarketConfig.getInstance().getBbsRefreshToken());
manager.setCurrentVersionFirstLaunch(false);
manager.setDesignerLastLoginTime(System.currentTimeMillis());
manager.setLastLoginType(DesignerLoginType.NORMAL_LOGIN);
manager.setLastLoginAccount(MarketConfig.getInstance().getBbsUsername());
manager.setCurrentVersionFirstLaunch(false);
DesignerEnvManager.getEnvManager().saveXMLFile();
}
}

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

@ -2,7 +2,6 @@ package com.fr.start.module;
import com.fr.design.DesignerEnvManager;
import com.fr.design.EnvChangeEntrance;
import com.fr.design.VersionCheckUtils;
import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.editlock.ConnectionLockChangeChecker;
import com.fr.design.editlock.ServerTableDataLockChangeChecker;
@ -10,6 +9,7 @@ import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.design.i18n.Toolkit;
import com.fr.design.versioncheck.VersionCheckUtils;
import com.fr.env.TestConnectionResult;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;

Loading…
Cancel
Save