Browse Source

Merge pull request #162 in DESIGN/design from ~MATA.LI/designrel:release/10.0 to release/10.0

* commit 'c14b8877f1aac8fdfef0761f19f0248525759b85':
  REPORT-8968 REPORT-8950 REPORT-899999
master
Mata.Li 7 years ago
parent
commit
2d65a81362
  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 static void preview(JTemplate<?, ?> jt) {
preview(jt, null);
preview(jt, jt.getPreviewType());
}
@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 cancelButton;
private JDialog dialog;
private UILabel uiLabel;
// Database pane
public DatabaseConnectionPane() {
@ -46,6 +47,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
originalCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
newCharSetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
message = new UILabel();
uiLabel = new UILabel();
okButton = new UIButton(Inter.getLocText("OK"));
cancelButton = new UIButton(Inter.getLocText("Cancel"));
this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -113,6 +115,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
ActionListener testConnectionActionListener = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
// Try the java connection.
final SwingWorker connectionThread = new SwingWorker() {
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);
okButton.setEnabled(true);
message.setText(database.connectMessage(connect));
if (connect) {
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
}else{
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
}
} catch (Exception 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 upPane = 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.add(uiLabel);
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) {
if (!(e instanceof CancellationException)) {
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);
} 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);
}
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 {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Datasource-Connection_successfully"));
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> {
private UITextField itemNameTextField;
private boolean needRenamePane = false;
private UITextArea urlTextField;
private UITextField urlTextField;
public WebHyperNorthPane(boolean needRenamePane) {
this.needRenamePane = needRenamePane;
@ -48,7 +48,7 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
protected JPanel setHeaderPanel() {
JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
urlTextField = new UITextArea(1,headerPane.getWidth());
urlTextField = new UITextField(headerPane.getWidth());
urlTextField.setText(ProductConstants.WEBSITE_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
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
@ -152,7 +153,8 @@ public class TemplatePane extends JPanel implements MouseListener {
}
setJLabel(selectedName);
} 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;
}
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 UIButton okButton = new UIButton(Inter.getLocText("OK"));
private UIButton cancelButton = new UIButton(Inter.getLocText("Cancel"));
;
private UILabel uiLabel = new UILabel();
/**
* 是否启用 https 勾选框
@ -477,6 +477,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
protected Boolean doInBackground() throws Exception {
final RemoteDesignerWorkspaceInfo remoteEnv = updateBean();
return WorkContext.getConnector().testConnection(remoteEnv.getConnection());
}
@ -486,11 +487,14 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
try {
if (get()) {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Successful"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
} else {
message.setText(Inter.getLocText("Fine-Designer_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
}
} catch (InterruptedException | ExecutionException e) {
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 upPane = 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.add(uiLabel);
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;
import com.fr.Message.ErrorMessage_;
import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.design.actions.JWorkBookAction;
@ -133,7 +134,8 @@ public abstract class AbstractExportAction extends JWorkBookAction {
} catch (Exception exp) {
this.setProgress(100);
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;
}

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.ShortCut;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter;
@ -97,6 +100,12 @@ public class Designer extends BaseDesigner {
BuildContext.setBuildFilePath("/com/fr/stable/build.properties");
preloadResource();
SplashContext.getInstance().registerSplash(createSplash());
// 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了
if (DesignUtils.isStarted()) {
DesignUtils.clientSend(args);
return;
}
SplashContext.getInstance().show();
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 {
DesignUtils.setPort(getStartPort());
}
// 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了
if (DesignUtils.isStarted()) {
DesignUtils.clientSend(getModule().upFindSingleton(StartupArgs.class).get());
return true;
}
return false;
}

Loading…
Cancel
Save