From 28465552b065be5c94cac41f3f4a89fafc0d56f6 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Wed, 12 Sep 2018 14:53:32 +0800 Subject: [PATCH 1/4] REPORT-11144 --- designer-realize/src/main/java/com/fr/start/Designer.java | 2 ++ .../src/main/java/com/fr/start/module/PreStartActivator.java | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index 812359e39f..3a5fe8f6ba 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; +import com.fr.design.RestartHelper; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.actions.file.newReport.NewPolyReportAction; @@ -102,6 +103,7 @@ public class Designer extends BaseDesigner { DesignUtils.clientSend(args); return; } + RestartHelper.deleteRecordFilesWhenStart(); preloadResource(); diff --git a/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java b/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java index 1f7db56227..c4eea3bada 100644 --- a/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java @@ -23,7 +23,6 @@ public class PreStartActivator extends Activator { @Override public void start() { - RestartHelper.deleteRecordFilesWhenStart(); CloudCenter.getInstance(); if (checkMultiStart()) { return; From ce29ce9ff5039b102896e6ad8c2d299d5ad0e12a Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Wed, 12 Sep 2018 16:35:52 +0800 Subject: [PATCH 2/4] what happen? --- .../design/mainframe/chart/gui/data/TableDataPane.java | 2 +- .../chart/AbstractExtendedChartReportDataPane.java | 9 +++++---- .../chart/AbstractExtendedChartTableDataPane.java | 2 +- .../com/fr/extended/chart/AbstractExtendedStylePane.java | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 5248fb08b1..09d92c9780 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -81,7 +81,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ * @return 返回标题. */ public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Tabledata"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TableData"); } diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java index 9e4a84f038..8420c7d5ce 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java @@ -11,8 +11,7 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; -import java.awt.BorderLayout; -import java.awt.Component; +import java.awt.*; import java.util.Arrays; /** @@ -32,7 +31,9 @@ public abstract class AbstractExtendedChartReportDataPane extends public AbstractExtendedStylePane() { } - public AbstractExtendedStylePane(AttributeChangeListener listener) { + public AbstractExtendedStylePane(AttributeChangeListener listener) { this.listener = listener; } From e42e066b5779e8b12fa9939b43652d0ff47e9b4b Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Wed, 12 Sep 2018 16:49:54 +0800 Subject: [PATCH 3/4] formatter --- .../chart/AbstractExtendedChartReportDataPane.java | 7 +++---- .../com/fr/extended/chart/AbstractExtendedStylePane.java | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java index 4cd7ccc1c7..1cfe2bf6b3 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java @@ -11,7 +11,8 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; import java.util.Arrays; /** @@ -31,9 +32,7 @@ public abstract class AbstractExtendedChartReportDataPane extends public AbstractExtendedStylePane() { } - public AbstractExtendedStylePane(AttributeChangeListener listener) { + public AbstractExtendedStylePane(AttributeChangeListener listener) { this.listener = listener; } From b376e9dc1bc360df2abd92b9c2afc03d10606b9b Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Thu, 13 Sep 2018 14:09:44 +0800 Subject: [PATCH 4/4] REPORT-11257 --- .../design/actions/file/SwitchExistEnv.java | 5 ++ .../java/com/fr/start/server/ServerTray.java | 81 +++++++++---------- 2 files changed, 45 insertions(+), 41 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java index d79df8d2c3..051f14bc3f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java @@ -15,6 +15,7 @@ import com.fr.design.menu.SeparatorDef; import com.fr.design.utils.DesignUtils; import com.fr.license.exception.RegistEditionException; import com.fr.log.FineLoggerFactory; +import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContextCallback; import com.fr.workspace.Workspace; @@ -110,6 +111,10 @@ public class SwitchExistEnv extends MenuDef { DesignUtils.refreshDesignerFrame(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea(); fireDSChanged(); + if (WorkContext.getCurrent().isLocal()) { + //初始化一下serverTray + ServerTray.init(); + } } }); } catch (AuthException exception) { diff --git a/designer-base/src/main/java/com/fr/start/server/ServerTray.java b/designer-base/src/main/java/com/fr/start/server/ServerTray.java index ce2da0407d..01cfc53fc6 100644 --- a/designer-base/src/main/java/com/fr/start/server/ServerTray.java +++ b/designer-base/src/main/java/com/fr/start/server/ServerTray.java @@ -17,32 +17,32 @@ import java.awt.event.MouseEvent; * Create server tray. */ public class ServerTray { - + private static ServerTray INSTANCE; - + private MenuItem startMenu; - + private MenuItem stopMenu; - + private Image trayStartedImage = BaseUtils.readImage("/com/fr/base/images/oem/trayStarted.png"); - + private Image trayStoppedImage = BaseUtils.readImage("/com/fr/base/images/oem/trayStopped.png"); - + private ServerManageFrame serverManageFrame; - + private TrayIcon trayIcon; - - + + private ServerTray() { - + listen(); //p:首先构建右键菜单 PopupMenu popup = new PopupMenu(); MenuItem manangeMenu = new MenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Open_Service_Manager")); manangeMenu.addActionListener(new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + serverManageFrame = ServerManageFrame.getServerManageFrame(); if (!serverManageFrame.isVisible()) { serverManageFrame.setVisible(true); @@ -55,9 +55,9 @@ public class ServerTray { MenuItem exitMenu = new MenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Exit")); //创建打开监听器 ActionListener startListener = new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + try { FineEmbedServer.start(); } catch (Exception exp) { @@ -66,9 +66,9 @@ public class ServerTray { } }; ActionListener stopListener = new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + try { FineEmbedServer.stop(); } catch (Throwable exp) { @@ -80,13 +80,13 @@ public class ServerTray { stopMenu.addActionListener(stopListener); //创建退出菜单监听器 ActionListener exitListener = new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + exit(); } }; - + exitMenu.addActionListener(exitListener); popup.add(manangeMenu); popup.addSeparator(); @@ -94,18 +94,18 @@ public class ServerTray { popup.add(stopMenu); popup.addSeparator(); popup.add(exitMenu); - + //p:开始创建托盘. trayIcon = new TrayIcon(trayStartedImage, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"), popup); trayIcon.setImageAutoSize(true); trayIcon.addMouseListener(new MouseAdapter() { - + public void mouseClicked(MouseEvent e) { - + if (e.getClickCount() < 2) { return; } - + ServerManageFrame serverManageFrame = ServerManageFrame.getServerManageFrame(); if (!serverManageFrame.isVisible()) { serverManageFrame.setVisible(true); @@ -113,56 +113,56 @@ public class ServerTray { serverManageFrame.toFront();//p:到第一个. } }); - + TrayIcon[] icons = SystemTray.getSystemTray().getTrayIcons(); for (TrayIcon icon : icons) { SystemTray.getSystemTray().remove(icon); } - + try { SystemTray.getSystemTray().add(trayIcon); } catch (AWTException e) { System.err.println("Can not create the System Tray:" + e); } - + checkPopupMenuItemEnabled(); } - + private void listen() { - + ListenerAdaptor listenerAdaptor = new ListenerAdaptor() { - + @Override protected void on(Event event) { - + checkPopupMenuItemEnabled(); } }; EventDispatcher.listen(EmbedServerEvent.AfterStart, listenerAdaptor); EventDispatcher.listen(EmbedServerEvent.AfterStop, listenerAdaptor); } - + private void exit() { - + FineEmbedServer.stop(); SystemTray.getSystemTray().remove(trayIcon); } - + private void checkPopupMenuItemEnabled() { - + try { if (FineEmbedServer.isRunning()) { startMenu.setEnabled(false); stopMenu.setEnabled(true); - + trayIcon.setImage(trayStartedImage); } else { startMenu.setEnabled(true); stopMenu.setEnabled(false); - + trayIcon.setImage(trayStoppedImage); } - + if (serverManageFrame != null) { serverManageFrame.checkButtonEnabled(); serverManageFrame.repaint(); @@ -171,10 +171,9 @@ public class ServerTray { FRContext.getLogger().error(exp.getMessage(), exp); } } - + public static void init() { - - INSTANCE = new ServerTray(); - + if (INSTANCE == null) + INSTANCE = new ServerTray(); } } \ No newline at end of file