Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

master
ju 7 years ago
parent
commit
63fc78a70a
  1. 2
      designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java
  2. 11
      designer-base/src/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  3. 3
      designer-base/src/com/fr/design/data/datapane/preview/PreviewTablePane.java
  4. 3
      designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  5. 4
      designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java
  6. 6
      designer-base/src/com/fr/design/mainframe/TemplatePane.java
  7. 8
      designer-base/src/com/fr/env/RemoteEnvPane.java
  8. 4
      designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java
  9. 9
      designer-realize/src/com/fr/start/Designer.java
  10. 6
      designer-realize/src/com/fr/start/module/PreStartActivator.java

2
designer-base/src/com/fr/design/actions/file/WebPreviewUtils.java

@ -20,7 +20,7 @@ import java.util.Map;
public final class WebPreviewUtils { public final class WebPreviewUtils {
public static void preview(JTemplate<?, ?> jt) { public static void preview(JTemplate<?, ?> jt) {
preview(jt, null); preview(jt, jt.getPreviewType());
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")

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

@ -36,6 +36,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
private UIButton okButton; private UIButton okButton;
private UIButton cancelButton; private UIButton cancelButton;
private JDialog dialog; private JDialog dialog;
private UILabel uiLabel;
// Database pane // Database pane
public DatabaseConnectionPane() { public DatabaseConnectionPane() {
@ -46,6 +47,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
originalCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); originalCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
newCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); newCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
message = new UILabel(); message = new UILabel();
uiLabel = new UILabel();
okButton = new UIButton(Inter.getLocText("OK")); okButton = new UIButton(Inter.getLocText("OK"));
cancelButton = new UIButton(Inter.getLocText("Cancel")); cancelButton = new UIButton(Inter.getLocText("Cancel"));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -113,6 +115,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
ActionListener testConnectionActionListener = new ActionListener() { ActionListener testConnectionActionListener = new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
// Try the java connection. // Try the java connection.
final SwingWorker connectionThread = new SwingWorker() { final SwingWorker connectionThread = new SwingWorker() {
protected Object doInBackground() throws Exception { protected Object doInBackground() throws Exception {
@ -121,6 +124,11 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
boolean connect = DataOperator.getInstance().testConnection(database); boolean connect = DataOperator.getInstance().testConnection(database);
okButton.setEnabled(true); okButton.setEnabled(true);
message.setText(database.connectMessage(connect)); message.setText(database.connectMessage(connect));
if (connect) {
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
}else{
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
}
} catch (Exception exp) { } catch (Exception exp) {
FineLoggerFactory.getLogger().error(exp.getMessage(), exp); FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
} }
@ -165,7 +173,8 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
JPanel jp = new JPanel(); JPanel jp = new JPanel();
JPanel upPane = new JPanel(); JPanel upPane = new JPanel();
JPanel downPane = new JPanel(); JPanel downPane = new JPanel();
UILabel uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(uiLabel); upPane.add(uiLabel);
upPane.add(message); upPane.add(message);

3
designer-base/src/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -390,7 +390,8 @@ public class PreviewTablePane extends BasicPane {
} catch (Exception e) { } catch (Exception e) {
if (!(e instanceof CancellationException)) { if (!(e instanceof CancellationException)) {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage()); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
} }
dialog.setVisible(false); dialog.setVisible(false);
} finally { } finally {

3
designer-base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -221,7 +221,8 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);
} }
if (in == null) { if (in == null) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Datasource-Connection_failed")); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Datasource-Connection_failed"),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
} else { } else {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Datasource-Connection_successfully")); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Datasource-Connection_successfully"));
try { try {

4
designer-base/src/com/fr/design/hyperlink/WebHyperNorthPane.java

@ -24,7 +24,7 @@ import java.awt.BorderLayout;
public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> { public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
private UITextField itemNameTextField; private UITextField itemNameTextField;
private boolean needRenamePane = false; private boolean needRenamePane = false;
private UITextArea urlTextField; private UITextField urlTextField;
public WebHyperNorthPane(boolean needRenamePane) { public WebHyperNorthPane(boolean needRenamePane) {
this.needRenamePane = needRenamePane; this.needRenamePane = needRenamePane;
@ -48,7 +48,7 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
protected JPanel setHeaderPanel() { protected JPanel setHeaderPanel() {
JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
urlTextField = new UITextArea(1,headerPane.getWidth()); urlTextField = new UITextField(headerPane.getWidth());
urlTextField.setText(ProductConstants.WEBSITE_URL); urlTextField.setText(ProductConstants.WEBSITE_URL);
JPanel urlWithHelp = GUICoreUtils.createNamedPane(urlTextField, "URL:"); JPanel urlWithHelp = GUICoreUtils.createNamedPane(urlTextField, "URL:");

6
designer-base/src/com/fr/design/mainframe/TemplatePane.java

@ -137,7 +137,8 @@ public class TemplatePane extends JPanel implements MouseListener {
@Override @Override
public void fail() { public void fail() {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"})); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
} }
@Override @Override
@ -152,7 +153,8 @@ public class TemplatePane extends JPanel implements MouseListener {
} }
setJLabel(selectedName); setJLabel(selectedName);
} catch (Exception e) { } catch (Exception e) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"})); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
return false; return false;
} }
TemplateTreePane.getInstance().refreshDockingView(); TemplateTreePane.getInstance().refreshDockingView();

8
designer-base/src/com/fr/env/RemoteEnvPane.java vendored

@ -64,7 +64,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private UILabel message = new UILabel(); private UILabel message = new UILabel();
private UIButton okButton = new UIButton(Inter.getLocText("OK")); private UIButton okButton = new UIButton(Inter.getLocText("OK"));
private UIButton cancelButton = new UIButton(Inter.getLocText("Cancel")); private UIButton cancelButton = new UIButton(Inter.getLocText("Cancel"));
; private UILabel uiLabel = new UILabel();
/** /**
* 是否启用 https 勾选框 * 是否启用 https 勾选框
@ -477,6 +477,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
protected Boolean doInBackground() throws Exception { protected Boolean doInBackground() throws Exception {
final RemoteDesignerWorkspaceInfo remoteEnv = updateBean(); final RemoteDesignerWorkspaceInfo remoteEnv = updateBean();
return WorkContext.getConnector().testConnection(remoteEnv.getConnection()); return WorkContext.getConnector().testConnection(remoteEnv.getConnection());
} }
@ -486,11 +487,14 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
try { try {
if (get()) { if (get()) {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Successful")); message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Successful"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
} else { } else {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed")); message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
} }
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed")); message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
} }
} }
}; };
@ -530,7 +534,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
JPanel jp = new JPanel(); JPanel jp = new JPanel();
JPanel upPane = new JPanel(); JPanel upPane = new JPanel();
JPanel downPane = new JPanel(); JPanel downPane = new JPanel();
UILabel uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(uiLabel); upPane.add(uiLabel);
upPane.add(message); upPane.add(message);

4
designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java

@ -3,6 +3,7 @@
*/ */
package com.fr.design.actions.file.export; package com.fr.design.actions.file.export;
import com.fr.Message.ErrorMessage_;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.design.actions.JWorkBookAction; import com.fr.design.actions.JWorkBookAction;
@ -133,7 +134,8 @@ public abstract class AbstractExportAction extends JWorkBookAction {
} catch (Exception exp) { } catch (Exception exp) {
this.setProgress(100); this.setProgress(100);
FineLoggerFactory.getLogger().error(exp.getMessage(), exp); FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_Export_failed") + "\n" + filePath); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_Export_failed") + "\n" + filePath,
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
} }
return null; return null;
} }

9
designer-realize/src/com/fr/start/Designer.java

@ -35,6 +35,9 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
@ -97,6 +100,12 @@ public class Designer extends BaseDesigner {
BuildContext.setBuildFilePath("/com/fr/stable/build.properties"); BuildContext.setBuildFilePath("/com/fr/stable/build.properties");
preloadResource(); preloadResource();
SplashContext.getInstance().registerSplash(createSplash()); SplashContext.getInstance().registerSplash(createSplash());
// 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了
if (DesignUtils.isStarted()) {
DesignUtils.clientSend(args);
return;
}
SplashContext.getInstance().show(); SplashContext.getInstance().show();
Module designerRoot = ModuleContext.parseRoot("designer-startup.xml"); Module designerRoot = ModuleContext.parseRoot("designer-startup.xml");
//传递启动参数 //传递启动参数

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

@ -38,11 +38,7 @@ public class PreStartActivator extends Activator {
} else { } else {
DesignUtils.setPort(getStartPort()); DesignUtils.setPort(getStartPort());
} }
// 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了
if (DesignUtils.isStarted()) {
DesignUtils.clientSend(getModule().upFindSingleton(StartupArgs.class).get());
return true;
}
return false; return false;
} }

Loading…
Cancel
Save