Browse Source

Pull request #6446: 无JIRA任务 解决冲突

Merge in DESIGN/design from ~FANGLEI/design10.0:feature/x to feature/x

* commit '574d127a0e7ea88dd9626cb3f7d72b7dd1a26234':
  REPORT-58584 FR11-二轮回归-设计器菜单栏-服务器-控件管理-预定义控件重名时没有提示
  REPORT-58584
  REPORT-58584
  REPORT-61671:新创建报表的报表引擎属性默认选择新引擎时,新引擎选项下方不应该出现固定分页选项
  REPORT-58584 FR11-二轮回归-设计器菜单栏-服务器-控件管理-预定义控件重名时没有提示
  REPORT-57521 突然发现已经有关于websocket帮助文档的地址了
  REPORT-60538 还原改动
  REPORT-60538 还原改动
  REPORT-60538 还原改动
  REPORT-57521 远程设计时websocket断开情况下的提示优化
  REPORT-60538
  REPORT-60538 英日韩环境未屏蔽在线组件库
feature/x
ju|剧浩宇 3 years ago
parent
commit
7c399f5c34
  1. 55
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  2. 38
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  3. 52
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  4. 20
      designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java
  5. 9
      designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java
  6. 38
      designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java
  7. 58
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  8. 1
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java
  9. 18
      designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java

55
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -9,7 +9,6 @@ import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.BasicTableDataUtils;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.NameInspector;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
@ -25,18 +24,18 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.third.org.apache.commons.collections4.MapUtils; import com.fr.third.org.apache.commons.collections4.MapUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.DefaultListModel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* TableDataList Pane. * TableDataList Pane.
@ -52,15 +51,12 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
@Override @Override
public void propertyChange() { public void propertyChange() {
isNamePermitted = true; isNamePermitted = true;
String tempName = getEditingName(); if (!checkName()) {
if (ComparatorUtils.equals(tempName, selectedName)) { isNamePermitted = false;
//说明双击之后又取消了,啥也不用做
return; return;
} }
Set<String> allDSNames = DesignTableDataManager.getGlobalDataSet().keySet();
String[] allListNames = nameableList.getAllNames();
allListNames[editingIndex] = StringUtils.EMPTY;
String tempName = getEditingName();
Object editingType = getEditingType(); Object editingType = getEditingType();
if (!BasicTableDataUtils.checkName(tempName)) { if (!BasicTableDataUtils.checkName(tempName)) {
@ -70,35 +66,36 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
return; return;
} }
if (StringUtils.isEmpty(tempName)) { if (editingType instanceof StoreProcedure && isIncludeUnderline(tempName)) {
isNamePermitted = false;
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this),
Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"),
Toolkit.i18nText("Fine-Design_Report_Alert"),
JOptionPane.WARNING_MESSAGE);
setIllegalIndex(editingIndex);
return;
}
boolean isRepeated = isNameRepeated(new Collection[]{allDSNames, Arrays.asList(allListNames)}, tempName);
if (isRepeated) {
isNamePermitted = false;
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", tempName));
setIllegalIndex(editingIndex);
} else if (editingType instanceof StoreProcedure && isIncludeUnderline(tempName)) {
isNamePermitted = false; isNamePermitted = false;
nameableList.stopEditing(); nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Stored_Procedure_Name_Tips")); FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Stored_Procedure_Name_Tips"));
setIllegalIndex(editingIndex); setIllegalIndex(editingIndex);
return;
} }
if (nameableList.getSelectedValue() instanceof ListModelElement) { if (nameableList.getSelectedValue() instanceof ListModelElement) {
rename(selectedName, isRepeated ? NameInspector.ILLEGAL_NAME_HOLDER : tempName); rename(selectedName, tempName);
} }
} }
}); });
} }
@Override
public String getEmptyNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips");
}
@Override
public String getDuplicatedNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", getEditingName());
}
@Override
public Collection getExtraItemsToCheckNameRepeat() {
return DesignTableDataManager.getGlobalDataSet().keySet();
}
@Override @Override
public void rename(String oldName, String newName) { public void rename(String oldName, String newName) {
//如果a改成了b,b又被改成了c,就认为是a改成了c //如果a改成了b,b又被改成了c,就认为是a改成了c

38
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -7,7 +7,6 @@ import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.ConnectionProvider; import com.fr.design.fun.ConnectionProvider;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
@ -16,21 +15,18 @@ import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils; import com.fr.file.ConnectionOperator;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.third.org.apache.commons.collections4.MapUtils; import com.fr.third.org.apache.commons.collections4.MapUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.file.ConnectionOperator;
import java.awt.Window; import java.awt.Window;
import javax.swing.SwingUtilities;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -50,32 +46,24 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
this.addEditingListener(new PropertyChangeAdapter() { this.addEditingListener(new PropertyChangeAdapter() {
public void propertyChange() { public void propertyChange() {
isNamePermitted = true; isNamePermitted = true;
String[] allListNames = nameableList.getAllNames(); if (!checkName()) {
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
String tempName = getEditingName();
if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name"));
setIllegalIndex(editingIndex);
isNamePermitted = false; isNamePermitted = false;
return; return;
} }
if (!ComparatorUtils.equals(tempName, selectedName) rename(selectedName, getEditingName());
&& isNameRepeated(new List[]{Arrays.asList(allListNames)}, tempName)) {
isNamePermitted = false;
nameableList.stopEditing();
String message = Toolkit.i18nText("Fine-Design_Basic_Connection_Duplicate_Name", tempName);
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message);
setIllegalIndex(editingIndex);
}
if (isNamePermitted && !ComparatorUtils.equals(tempName, selectedName)) {
rename(selectedName, tempName);
}
} }
}); });
} }
@Override
public String getEmptyNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name");
}
@Override
public String getDuplicatedNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Connection_Duplicate_Name", getEditingName());
}
protected void rename(String oldName, String newName) { protected void rename(String oldName, String newName) {
//如果a改成了b,b又被改成了c,就认为是a改成了c //如果a改成了b,b又被改成了c,就认为是a改成了c

52
designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

@ -1,10 +1,12 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.ModNameActionListener; import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -12,6 +14,7 @@ import com.fr.general.IOUtils;
import com.fr.invoke.Reflect; import com.fr.invoke.Reflect;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
@ -23,12 +26,16 @@ import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.util.Collection;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider { public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider {
private static final String LIST_NAME = "JControl_List"; private static final String LIST_NAME = "JControl_List";
@ -424,4 +431,47 @@ public abstract class JListControlPane extends JControlPane implements ListContr
} }
public boolean checkName() {
String tempName = getEditingName();
if (ComparatorUtils.equals(tempName, selectedName)) {
return false;
}
if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing();
showWarningDialog(getEmptyNameTip());
setIllegalIndex(editingIndex);
return false;
}
String[] allListNames = nameableList.getAllNames();
allListNames[editingIndex] = StringUtils.EMPTY;
if (isNameRepeated(new Collection[]{getExtraItemsToCheckNameRepeat(), Arrays.asList(allListNames)}, tempName)) {
nameableList.stopEditing();
showWarningDialog(getDuplicatedNameTip());
setIllegalIndex(editingIndex);
return false;
}
return true;
}
public String getEmptyNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Not_Null_Des");
}
public String getDuplicatedNameTip() {
return StringUtils.EMPTY;
}
public Collection getExtraItemsToCheckNameRepeat() {
return new ArrayList();
}
private void showWarningDialog(String tip) {
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this),
tip,
Toolkit.i18nText("Fine-Design_Basic_Alert"),
WARNING_MESSAGE);
}
} }

20
designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java

@ -6,17 +6,17 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.Window;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JEditorPane; import javax.swing.JEditorPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font; import java.awt.Font;
import java.awt.Frame;
import java.awt.Window;
/** /**
* Created by kerry on 5/6/21 * Created by kerry on 5/6/21
@ -31,6 +31,13 @@ public class DesignerToastMsgUtil {
} }
public static ToastMsgDialog createPromptDialog(String text) {
return createDialog(PROMPT_ICON, toastPane(text), DesignerContext.getDesignerFrame());
}
public static ToastMsgDialog createPromptDialog(JPanel contentPane) {
return createDialog(PROMPT_ICON, contentPane, DesignerContext.getDesignerFrame());
}
public static void toastPrompt(JPanel contendPane) { public static void toastPrompt(JPanel contendPane) {
toastPane(PROMPT_ICON, contendPane, DesignerContext.getDesignerFrame()); toastPane(PROMPT_ICON, contendPane, DesignerContext.getDesignerFrame());
@ -69,6 +76,11 @@ public class DesignerToastMsgUtil {
} }
private static void toastPane(Icon icon, JPanel contendPane, Window parent) { private static void toastPane(Icon icon, JPanel contendPane, Window parent) {
ToastMsgDialog dialog = createDialog(icon, contendPane, parent);
dialog.setVisible(true);
}
private static ToastMsgDialog createDialog(Icon icon, JPanel contendPane, Window parent) {
JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane();
UILabel uiLabel = new UILabel(icon); UILabel uiLabel = new UILabel(icon);
uiLabel.setVerticalAlignment(SwingConstants.TOP); uiLabel.setVerticalAlignment(SwingConstants.TOP);
@ -83,7 +95,7 @@ public class DesignerToastMsgUtil {
} else { } else {
dialog = new ToastMsgDialog((Frame) parent, pane); dialog = new ToastMsgDialog((Frame) parent, pane);
} }
dialog.setVisible(true); return dialog;
} }

9
designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java

@ -5,8 +5,8 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.module.ModuleContext; import com.fr.module.ModuleContext;
import java.awt.Dialog;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Dialog;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Point; import java.awt.Point;
@ -24,6 +24,7 @@ public class ToastMsgDialog extends UIDialog {
private ScheduledExecutorService TIMER; private ScheduledExecutorService TIMER;
private int hide_height = 0; private int hide_height = 0;
private JPanel contentPane; private JPanel contentPane;
private boolean show = false;
public ToastMsgDialog(Frame parent, JPanel panel) { public ToastMsgDialog(Frame parent, JPanel panel) {
super(parent); super(parent);
@ -65,6 +66,7 @@ public class ToastMsgDialog extends UIDialog {
public void display(JPanel outerJPanel) { public void display(JPanel outerJPanel) {
show = true;
outerJPanel.setLocation(0, -hide_height); outerJPanel.setLocation(0, -hide_height);
ScheduledExecutorService TIP_TOOL_TIMER = createToastScheduleExecutorService(); ScheduledExecutorService TIP_TOOL_TIMER = createToastScheduleExecutorService();
TIP_TOOL_TIMER.scheduleAtFixedRate(new Runnable() { TIP_TOOL_TIMER.scheduleAtFixedRate(new Runnable() {
@ -98,6 +100,7 @@ public class ToastMsgDialog extends UIDialog {
TIP_TOOL_TIMER.shutdown(); TIP_TOOL_TIMER.shutdown();
ToastMsgDialog.this.setVisible(false); ToastMsgDialog.this.setVisible(false);
ToastMsgDialog.this.dispose(); ToastMsgDialog.this.dispose();
ToastMsgDialog.this.show = false;
} }
outerJPanel.setLocation(point.x, point.y - 5); outerJPanel.setLocation(point.x, point.y - 5);
Dimension dimension = ToastMsgDialog.this.getSize(); Dimension dimension = ToastMsgDialog.this.getSize();
@ -159,5 +162,7 @@ public class ToastMsgDialog extends UIDialog {
super.dispose(); super.dispose();
} }
public boolean isShow() {
return show;
}
} }

38
designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java

@ -2,20 +2,16 @@ package com.fr.design.parameter;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ParameterConfig; import com.fr.base.ParameterConfig;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.NameableSelfCreator; import com.fr.design.gui.controlpane.NameableSelfCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper; import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.general.ComparatorUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.Collection;
public class ParameterArrayPane extends JListControlPane { public class ParameterArrayPane extends JListControlPane {
@ -29,27 +25,25 @@ public class ParameterArrayPane extends JListControlPane {
this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue()); this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue());
this.addEditingListener(new PropertyChangeAdapter() { this.addEditingListener(new PropertyChangeAdapter() {
public void propertyChange() { public void propertyChange() {
Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); checkName();
String[] allListNames = nameableList.getAllNames();
allListNames[editingIndex] = StringUtils.EMPTY;
String tempName = getEditingName();
if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name"));
setIllegalIndex(editingIndex);
return;
}
if (!ComparatorUtils.equals(tempName, selectedName)
&& isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) {
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this),
Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name"));
setIllegalIndex(editingIndex);
}
} }
}); });
} }
@Override
public String getEmptyNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name");
}
@Override
public String getDuplicatedNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name");
}
@Override
public Collection getExtraItemsToCheckNameRepeat() {
return Arrays.asList(ParameterConfig.getInstance().getGlobalParameters());
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {

58
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -3,15 +3,19 @@ package com.fr.design.mainframe.socketio;
import com.fr.config.RemoteConfigEvent; import com.fr.config.RemoteConfigEvent;
import com.fr.decision.webservice.utils.DecisionServiceConstants; import com.fr.decision.webservice.utils.DecisionServiceConstants;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.EnvChangeEntrance;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceInfoContext; import com.fr.design.env.DesignerWorkspaceInfoContext;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.loghandler.DesignerLogger; import com.fr.design.mainframe.loghandler.DesignerLogger;
import com.fr.design.mainframe.share.ui.base.MouseClickListener;
import com.fr.design.mainframe.toast.DesignerToastMsgUtil;
import com.fr.design.mainframe.toast.ToastMsgDialog;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.BrowseUtils;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.RemoteDesignConstants; import com.fr.report.RemoteDesignConstants;
@ -29,20 +33,24 @@ import com.fr.workspace.Workspace;
import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.base.WorkspaceConstants;
import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnection;
import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.server.socket.SocketInfoOperator;
import io.socket.client.IO; import io.socket.client.IO;
import io.socket.client.Socket; import io.socket.client.Socket;
import io.socket.emitter.Emitter; import io.socket.emitter.Emitter;
import javax.net.ssl.SSLContext;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.event.MouseEvent;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.security.KeyStore;
import java.util.Arrays;
import javax.net.ssl.SSLContext;
import javax.swing.*;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.net.URL; import java.net.URL;
import java.security.KeyStore;
import java.util.Arrays;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
@ -54,6 +62,7 @@ public class DesignerSocketIO {
Disconnecting Disconnecting
} }
private static final String WEBSOCKET_HELP_DOC = CloudCenter.getInstance().acquireUrlByKind("websocketConnect", "https://help.fanruan.com/finereport/doc-view-2512.html");
private static final String HTTPS = "https"; private static final String HTTPS = "https";
private static final String HTTP = "http"; private static final String HTTP = "http";
private static Socket socket = null; private static Socket socket = null;
@ -66,6 +75,7 @@ public class DesignerSocketIO {
private static int count; private static int count;
// 当前webSocket选择的协议 // 当前webSocket选择的协议
private static String currentProtocol; private static String currentProtocol;
private static ToastMsgDialog dialog = null;
public static void close() { public static void close() {
@ -185,6 +195,7 @@ public class DesignerSocketIO {
private static final Emitter.Listener failRetry = new Emitter.Listener() { private static final Emitter.Listener failRetry = new Emitter.Listener() {
@Override @Override
public void call(Object... args) { public void call(Object... args) {
showConnectionLostDialog();
printLog(args, PrintEventLogImpl.WARN, "failed args: {}"); printLog(args, PrintEventLogImpl.WARN, "failed args: {}");
status = Status.Disconnecting; status = Status.Disconnecting;
socket.close(); socket.close();
@ -251,13 +262,13 @@ public class DesignerSocketIO {
UIUtil.invokeLaterIfNeeded(new Runnable() { UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override @Override
public void run() { public void run() {
FineJOptionPane.showMessageDialog( if (dialog == null) {
DesignerContext.getDesignerFrame(), dialog = DesignerToastMsgUtil.createPromptDialog(createDialogContent());
Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"), }
UIManager.getString("OptionPane.messageDialogTitle"),
JOptionPane.ERROR_MESSAGE, if (!dialog.isShow()) {
UIManager.getIcon("OptionPane.errorIcon")); dialog.setVisible(true);
EnvChangeEntrance.getInstance().chooseEnv(); }
} }
}); });
} catch (Exception e) { } catch (Exception e) {
@ -265,6 +276,23 @@ public class DesignerSocketIO {
} }
} }
private static JPanel createDialogContent() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_WebSocket_Lost_Tip")), BorderLayout.WEST);
UILabel hyperLinkLabel = new UILabel(Toolkit.i18nText("Fine-Design_WebSocket_Lost_Tip_HyperLink_Text"));
hyperLinkLabel.addMouseListener(new MouseClickListener() {
@Override
public void mouseClicked(MouseEvent e) {
BrowseUtils.browser(WEBSOCKET_HELP_DOC);
}
});
hyperLinkLabel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0));
hyperLinkLabel.setForeground(Color.BLUE);
hyperLinkLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jPanel.add(hyperLinkLabel, BorderLayout.CENTER);
return jPanel;
}
//配置变更监听器 //配置变更监听器
private static final Emitter.Listener modifyConfig = new Emitter.Listener() { private static final Emitter.Listener modifyConfig = new Emitter.Listener() {
@Override @Override

1
designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -104,6 +104,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
engineSettingPane.setBounds(0, 0, 570, 240); engineSettingPane.setBounds(0, 0, 570, 240);
createEngineXSettingPane(); createEngineXSettingPane();
createLineEngineSettingPane(); createLineEngineSettingPane();
outLineEngineSettingPane.setVisible(false);
engineSettingPane.add(outEngineXSettingPane, JLayeredPane.DEFAULT_LAYER); engineSettingPane.add(outEngineXSettingPane, JLayeredPane.DEFAULT_LAYER);
engineSettingPane.add(outLineEngineSettingPane, JLayeredPane.DEFAULT_LAYER); engineSettingPane.add(outLineEngineSettingPane, JLayeredPane.DEFAULT_LAYER);
engineSettingPane.moveToFront(outEngineXSettingPane); engineSettingPane.moveToFront(outEngineXSettingPane);

18
designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java

@ -4,11 +4,13 @@ import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.core.WidgetConstants; import com.fr.design.gui.core.WidgetConstants;
import com.fr.design.i18n.Toolkit;
import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.UserDefinedWidgetConfig;
import com.fr.form.ui.WidgetConfig; import com.fr.form.ui.WidgetConfig;
import com.fr.form.ui.WidgetInfoConfig; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.core.PropertyChangeAdapter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -19,7 +21,21 @@ import java.util.List;
*/ */
public class WidgetConfigPane extends JListControlPane { public class WidgetConfigPane extends JListControlPane {
/** public WidgetConfigPane() {
super();
this.addEditingListener(new PropertyChangeAdapter() {
public void propertyChange() {
checkName();
}
});
}
@Override
public String getDuplicatedNameTip() {
return Toolkit.i18nText("Fine_Design_Predefine_Widget_Name_Duplicated");
}
/**
* 创建用户自定义widget组件 * 创建用户自定义widget组件
* *
* @return 组件面板 * @return 组件面板

Loading…
Cancel
Save