Browse Source

conflict

final/10.0
zheng 6 years ago
parent
commit
32e4797dca
  1. 5
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  2. 81
      designer-base/src/main/java/com/fr/start/server/ServerTray.java
  3. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  4. 2
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java
  5. 2
      designer-realize/src/main/java/com/fr/start/Designer.java
  6. 1
      designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java

5
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.design.utils.DesignUtils;
import com.fr.license.exception.RegistEditionException; import com.fr.license.exception.RegistEditionException;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.start.server.ServerTray;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback; import com.fr.workspace.WorkContextCallback;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
@ -110,6 +111,10 @@ public class SwitchExistEnv extends MenuDef {
DesignUtils.refreshDesignerFrame(); DesignUtils.refreshDesignerFrame();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea();
fireDSChanged(); fireDSChanged();
if (WorkContext.getCurrent().isLocal()) {
//初始化一下serverTray
ServerTray.init();
}
} }
}); });
} catch (AuthException exception) { } catch (AuthException exception) {

81
designer-base/src/main/java/com/fr/start/server/ServerTray.java

@ -17,32 +17,32 @@ import java.awt.event.MouseEvent;
* Create server tray. * Create server tray.
*/ */
public class ServerTray { public class ServerTray {
private static ServerTray INSTANCE; private static ServerTray INSTANCE;
private MenuItem startMenu; private MenuItem startMenu;
private MenuItem stopMenu; private MenuItem stopMenu;
private Image trayStartedImage = BaseUtils.readImage("/com/fr/base/images/oem/trayStarted.png"); 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 Image trayStoppedImage = BaseUtils.readImage("/com/fr/base/images/oem/trayStopped.png");
private ServerManageFrame serverManageFrame; private ServerManageFrame serverManageFrame;
private TrayIcon trayIcon; private TrayIcon trayIcon;
private ServerTray() { private ServerTray() {
listen(); listen();
//p:首先构建右键菜单 //p:首先构建右键菜单
PopupMenu popup = new PopupMenu(); PopupMenu popup = new PopupMenu();
MenuItem manangeMenu = new MenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Open_Service_Manager")); MenuItem manangeMenu = new MenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Open_Service_Manager"));
manangeMenu.addActionListener(new ActionListener() { manangeMenu.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
serverManageFrame = ServerManageFrame.getServerManageFrame(); serverManageFrame = ServerManageFrame.getServerManageFrame();
if (!serverManageFrame.isVisible()) { if (!serverManageFrame.isVisible()) {
serverManageFrame.setVisible(true); 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")); MenuItem exitMenu = new MenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Exit"));
//创建打开监听器 //创建打开监听器
ActionListener startListener = new ActionListener() { ActionListener startListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
try { try {
FineEmbedServer.start(); FineEmbedServer.start();
} catch (Exception exp) { } catch (Exception exp) {
@ -66,9 +66,9 @@ public class ServerTray {
} }
}; };
ActionListener stopListener = new ActionListener() { ActionListener stopListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
try { try {
FineEmbedServer.stop(); FineEmbedServer.stop();
} catch (Throwable exp) { } catch (Throwable exp) {
@ -80,13 +80,13 @@ public class ServerTray {
stopMenu.addActionListener(stopListener); stopMenu.addActionListener(stopListener);
//创建退出菜单监听器 //创建退出菜单监听器
ActionListener exitListener = new ActionListener() { ActionListener exitListener = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
exit(); exit();
} }
}; };
exitMenu.addActionListener(exitListener); exitMenu.addActionListener(exitListener);
popup.add(manangeMenu); popup.add(manangeMenu);
popup.addSeparator(); popup.addSeparator();
@ -94,18 +94,18 @@ public class ServerTray {
popup.add(stopMenu); popup.add(stopMenu);
popup.addSeparator(); popup.addSeparator();
popup.add(exitMenu); popup.add(exitMenu);
//p:开始创建托盘. //p:开始创建托盘.
trayIcon = new TrayIcon(trayStartedImage, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"), popup); trayIcon = new TrayIcon(trayStartedImage, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"), popup);
trayIcon.setImageAutoSize(true); trayIcon.setImageAutoSize(true);
trayIcon.addMouseListener(new MouseAdapter() { trayIcon.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getClickCount() < 2) { if (e.getClickCount() < 2) {
return; return;
} }
ServerManageFrame serverManageFrame = ServerManageFrame.getServerManageFrame(); ServerManageFrame serverManageFrame = ServerManageFrame.getServerManageFrame();
if (!serverManageFrame.isVisible()) { if (!serverManageFrame.isVisible()) {
serverManageFrame.setVisible(true); serverManageFrame.setVisible(true);
@ -113,56 +113,56 @@ public class ServerTray {
serverManageFrame.toFront();//p:到第一个. serverManageFrame.toFront();//p:到第一个.
} }
}); });
TrayIcon[] icons = SystemTray.getSystemTray().getTrayIcons(); TrayIcon[] icons = SystemTray.getSystemTray().getTrayIcons();
for (TrayIcon icon : icons) { for (TrayIcon icon : icons) {
SystemTray.getSystemTray().remove(icon); SystemTray.getSystemTray().remove(icon);
} }
try { try {
SystemTray.getSystemTray().add(trayIcon); SystemTray.getSystemTray().add(trayIcon);
} catch (AWTException e) { } catch (AWTException e) {
System.err.println("Can not create the System Tray:" + e); System.err.println("Can not create the System Tray:" + e);
} }
checkPopupMenuItemEnabled(); checkPopupMenuItemEnabled();
} }
private void listen() { private void listen() {
ListenerAdaptor listenerAdaptor = new ListenerAdaptor() { ListenerAdaptor listenerAdaptor = new ListenerAdaptor() {
@Override @Override
protected void on(Event event) { protected void on(Event event) {
checkPopupMenuItemEnabled(); checkPopupMenuItemEnabled();
} }
}; };
EventDispatcher.listen(EmbedServerEvent.AfterStart, listenerAdaptor); EventDispatcher.listen(EmbedServerEvent.AfterStart, listenerAdaptor);
EventDispatcher.listen(EmbedServerEvent.AfterStop, listenerAdaptor); EventDispatcher.listen(EmbedServerEvent.AfterStop, listenerAdaptor);
} }
private void exit() { private void exit() {
FineEmbedServer.stop(); FineEmbedServer.stop();
SystemTray.getSystemTray().remove(trayIcon); SystemTray.getSystemTray().remove(trayIcon);
} }
private void checkPopupMenuItemEnabled() { private void checkPopupMenuItemEnabled() {
try { try {
if (FineEmbedServer.isRunning()) { if (FineEmbedServer.isRunning()) {
startMenu.setEnabled(false); startMenu.setEnabled(false);
stopMenu.setEnabled(true); stopMenu.setEnabled(true);
trayIcon.setImage(trayStartedImage); trayIcon.setImage(trayStartedImage);
} else { } else {
startMenu.setEnabled(true); startMenu.setEnabled(true);
stopMenu.setEnabled(false); stopMenu.setEnabled(false);
trayIcon.setImage(trayStoppedImage); trayIcon.setImage(trayStoppedImage);
} }
if (serverManageFrame != null) { if (serverManageFrame != null) {
serverManageFrame.checkButtonEnabled(); serverManageFrame.checkButtonEnabled();
serverManageFrame.repaint(); serverManageFrame.repaint();
@ -171,10 +171,9 @@ public class ServerTray {
FRContext.getLogger().error(exp.getMessage(), exp); FRContext.getLogger().error(exp.getMessage(), exp);
} }
} }
public static void init() { public static void init() {
if (INSTANCE == null)
INSTANCE = new ServerTray(); INSTANCE = new ServerTray();
} }
} }

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -81,7 +81,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
* @return 返回标题. * @return 返回标题.
*/ */
public String title4PopupWindow() { 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");
} }

2
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java

@ -54,7 +54,7 @@ public abstract class AbstractExtendedChartReportDataPane<T extends AbstractData
Arrays.fill(rowSize, p); Arrays.fill(rowSize, p);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 24, 6); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 24, 6);
panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 15));
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());

2
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.FRContext;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.actions.file.WebPreviewUtils;
import com.fr.design.actions.file.newReport.NewPolyReportAction; import com.fr.design.actions.file.newReport.NewPolyReportAction;
@ -102,6 +103,7 @@ public class Designer extends BaseDesigner {
DesignUtils.clientSend(args); DesignUtils.clientSend(args);
return; return;
} }
RestartHelper.deleteRecordFilesWhenStart();
preloadResource(); preloadResource();

1
designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java

@ -23,7 +23,6 @@ public class PreStartActivator extends Activator {
@Override @Override
public void start() { public void start() {
RestartHelper.deleteRecordFilesWhenStart();
CloudCenter.getInstance(); CloudCenter.getInstance();
if (checkMultiStart()) { if (checkMultiStart()) {
return; return;

Loading…
Cancel
Save