diff --git a/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java
new file mode 100644
index 0000000000..310e75dce0
--- /dev/null
+++ b/designer-base/src/main/java/com/fr/common/detect/CommonPortDetector.java
@@ -0,0 +1,59 @@
+package com.fr.common.detect;
+
+import com.fr.concurrent.NamedThreadFactory;
+import com.fr.design.DesignerEnvManager;
+import com.fr.log.FineLoggerFactory;
+import com.fr.module.ModuleContext;
+import com.fr.web.WebSocketConfig;
+
+import java.net.Socket;
+import java.util.concurrent.ExecutorService;
+
+/**
+ * @author hades
+ * @version 10.0
+ * Created by hades on 2020/3/10
+ */
+public class CommonPortDetector {
+
+ private static final CommonPortDetector INSTANCE = new CommonPortDetector();
+ private ExecutorService service = ModuleContext.getExecutor().newSingleThreadExecutor(new NamedThreadFactory("CommonPortDetector"));
+
+ public static CommonPortDetector getInstance() {
+ return INSTANCE;
+ }
+
+ public void execute() {
+ service.submit(new Runnable() {
+ @Override
+ public void run() {
+ detectTomcatPort();
+ detectWebSocketPort();
+ }
+ });
+ }
+
+ private void detectTomcatPort() {
+ int port = DesignerEnvManager.getEnvManager().getEmbedServerPort();
+ if (checkPort(port)) {
+ FineLoggerFactory.getLogger().error("EmbedTomcat Port: {} is not available, maybe occupied by other programs, please check it!", port);
+ }
+ }
+
+ private void detectWebSocketPort() {
+ Integer[] ports = WebSocketConfig.getInstance().getPort();
+ for (int port : ports) {
+ if (checkPort(port)) {
+ FineLoggerFactory.getLogger().error("WebSocKet Port: {} is not available, maybe occupied by other programs, please check it!", port);
+ }
+ }
+ }
+
+ private boolean checkPort(int port) {
+ try (Socket socket = new Socket("localhost", port)) {
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+}
diff --git a/designer-base/src/main/java/com/fr/common/report/ReportState.java b/designer-base/src/main/java/com/fr/common/report/ReportState.java
new file mode 100644
index 0000000000..cc32e439cf
--- /dev/null
+++ b/designer-base/src/main/java/com/fr/common/report/ReportState.java
@@ -0,0 +1,21 @@
+package com.fr.common.report;
+
+/**
+ * @author hades
+ * @version 10.0
+ * Created by hades on 2020/3/27
+ */
+public enum ReportState {
+
+ STOP("stop"), ACTIVE("active");
+
+ private String value;
+
+ ReportState(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+}
\ No newline at end of file
diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
index 6ebd349cbb..77c779ce3e 100644
--- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
+++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
@@ -8,17 +8,21 @@ import com.fr.base.Utils;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
+import com.fr.design.dialog.ErrorDialog;
import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.design.env.RemoteDesignerWorkspaceInfo;
import com.fr.design.file.HistoryTemplateListPane;
+import com.fr.design.i18n.Toolkit;
import com.fr.design.locale.impl.ProductImproveMark;
import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.update.push.DesignerPushUpdateConfigManager;
import com.fr.design.style.color.ColorSelectConfigManager;
import com.fr.design.utils.DesignUtils;
+import com.fr.design.utils.DesignerPort;
+import com.fr.exit.DesignerExiter;
import com.fr.file.FILEFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogFormatter;
@@ -81,6 +85,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private static final String VERSION_80 = "80";
private static final int CACHINGTEMPLATE_LIMIT = 5;
private static final String WEB_NAME = "webapps";
+ /**
+ * 指定默认工作空间
+ */
+ public static final String DEFAULT_WORKSPACE_PATH = "fr.designer.workspace.default";
private static DesignerEnvManager designerEnvManager; // gui.
private String activationKey = null;
@@ -194,6 +202,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
+ XmlHandler.Self.handle(e);
}
// james:如果没有env定义,要设置一个默认的
@@ -340,6 +349,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
+ XmlHandler.Self.handle(e);
} finally {
if (null != fileWriter) {
try {
@@ -554,6 +564,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private String getDefaultenvPath(String installHome) {
+ String defaultWorkspacePath = System.getProperty(DEFAULT_WORKSPACE_PATH);
+ if (defaultWorkspacePath != null) {
+ return defaultWorkspacePath;
+ }
//这里需要转成反斜杠和生成默认路径一致
return new File(StableUtils.pathJoin(installHome, WEB_NAME, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)).getPath();
}
@@ -1396,6 +1410,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
/**
* 对国际化进行校验
* 非简繁英日韩的默认环境 设计器全部默认为英文版本
+ *
* @param locale
* @return
*/
@@ -1545,6 +1560,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
readDesignerPushUpdateAttr(reader);
} else if (name.equals(vcsConfigManager.XML_TAG)) {
readVcsAttr(reader);
+ } else if (DesignerPort.XML_TAG.equals(name)) {
+ readDesignerPort(reader);
} else {
readLayout(reader, name);
}
@@ -1736,6 +1753,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
reader.readXMLObject(vcsConfigManager);
}
+ public void readDesignerPort(XMLableReader reader) {
+ reader.readXMLObject(DesignerPort.getInstance());
+ }
+
/**
* Write XML.
* The method will be invoked when save data to XML file.
@@ -1761,6 +1782,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
writeOpenDebug(writer);
writeDesignerPushUpdateAttr(writer);
writeVcsAttr(writer);
+ writeDesignerPort(writer);
writer.end();
}
@@ -2010,6 +2032,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.vcsConfigManager.writeXML(writer);
}
+ private void writeDesignerPort(XMLPrintWriter writer) {
+ DesignerPort.getInstance().writeXML(writer);
+ }
+
public VcsConfigManager getVcsConfigManager() {
return vcsConfigManager;
@@ -2018,4 +2044,28 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
public void setVcsConfigManager(VcsConfigManager vcsConfigManager) {
this.vcsConfigManager = vcsConfigManager;
}
+
+ enum XmlHandler {
+ Self;
+ public void handle(Throwable throwable) {
+ ErrorDialog dialog = new ErrorDialog(null,
+ Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"),
+ Toolkit.i18nText("Fine-Design_Error_Start_Report"),
+ throwable.getMessage()) {
+ @Override
+ protected void okEvent() {
+ dispose();
+ DesignerExiter.getInstance().execute();
+ }
+
+ @Override
+ protected void restartEvent() {
+ dispose();
+ RestartHelper.restart();
+ }
+ };
+ dialog.setVisible(true);
+ DesignerExiter.getInstance().execute();
+ }
+ };
}
diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
index c1c11553f7..81e62239b4 100644
--- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
+++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
@@ -1,37 +1,62 @@
package com.fr.design;
+import com.fr.common.report.ReportState;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType;
+import com.fr.design.env.RemoteWorkspace;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.DesignUtils;
+import com.fr.env.CheckServiceDialog;
import com.fr.env.EnvListPane;
+import com.fr.exit.DesignerExiter;
import com.fr.general.GeneralContext;
+import com.fr.general.GeneralUtils;
+import com.fr.invoke.Reflect;
+import com.fr.json.JSONArray;
import com.fr.license.exception.RegistEditionException;
+import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
+import com.fr.process.ProcessEventPipe;
+import com.fr.process.engine.core.CarryMessageEvent;
+import com.fr.process.engine.core.FineProcessContext;
+import com.fr.rpc.Result;
import com.fr.stable.AssistUtils;
import com.fr.stable.EnvChangedListener;
+import com.fr.stable.StringUtils;
import com.fr.start.server.ServerTray;
import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback;
import com.fr.workspace.Workspace;
+import com.fr.workspace.base.WorkspaceAPI;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
+import com.fr.workspace.engine.base.FineObjectPool;
import com.fr.workspace.engine.channel.http.FunctionalHttpRequest;
import com.fr.workspace.engine.exception.WorkspaceAuthException;
+import com.fr.workspace.engine.exception.WorkspaceConnectionException;
+import com.fr.workspace.engine.rpc.WorkspaceProxyPool;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
+import java.lang.reflect.Method;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
import static javax.swing.JOptionPane.ERROR_MESSAGE;
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
@@ -83,6 +108,7 @@ public class EnvChangeEntrance {
private boolean switch2Env(final String envName, PopTipStrategy strategy) {
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(envName);
+ WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection();
try {
Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
@@ -91,18 +117,13 @@ public class EnvChangeEntrance {
strategy.showTip(new PopTip() {
@Override
public void show() {
- JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"),
- UIManager.getString("OptionPane.messageDialogTitle"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
+ FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"),
+ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
}
});
return false;
}
- // 如果版本不一致,且确认 不继续 连接,这里返回 false.
- if (!versionCheckAndConfirm(selectedEnv)) {
- return false;
- }
-
WorkContext.switchTo(workspace, new WorkContextCallback() {
@Override
public void done() {
@@ -115,20 +136,25 @@ public class EnvChangeEntrance {
}
}
});
+ // REPORT-25688如果是war包部署的服务器,给与提示
+ if (WorkContext.getCurrent().isWarDeploy()) {
+ FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Basic_War_Deploy_Tip"),
+ Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.INFORMATION_MESSAGE);
+ }
//REPORT-13810如果只是添加了工作目录,没有切换,这里ToolArea也是要显示新建的工作目录
JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
template.refreshToolArea();
}
-
+ showServiceDialog(selectedEnv);
} catch (WorkspaceAuthException | RegistEditionException e) {
// String title = Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed");
// String title = Toolkit.i18nText("Fine-Design_Basic_Lic_Does_Not_Support_Remote");
strategy.showTip(new PopTip() {
@Override
public void show() {
- JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"),
- UIManager.getString("OptionPane.messageDialogTitle"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
+ FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"),
+ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
}
});
return false;
@@ -137,8 +163,8 @@ public class EnvChangeEntrance {
strategy.showTip(new PopTip() {
@Override
public void show() {
- JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"),
- UIManager.getString("OptionPane.messageDialogTitle"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
+ FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"),
+ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
}
});
@@ -153,6 +179,7 @@ public class EnvChangeEntrance {
}
/**
+ * 这个功能留着,可能会加回来,先做注释处理
* 切换远程环境之前,进行版本检测,当版本不一致的时候,提示。
* 当用户确认选择 ok 时,才继续。
*
@@ -196,6 +223,148 @@ public class EnvChangeEntrance {
return true;
}
+ /**
+ * 对选择的环境做服务检测
+ * @param selectedEnv 选择的工作环境
+ */
+ public void showServiceDialog(DesignerWorkspaceInfo selectedEnv) throws Exception {
+ //是否需要做服务校验
+ if(needCheckBranch(selectedEnv)) {
+ String localBranch;
+ String remoteBranch;
+ WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection();
+ localBranch = GeneralUtils.readFullBuildNO();
+ try {
+ remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch();
+ } catch (WorkspaceConnectionException e) {
+ remoteBranch = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") + formatBranch(localBranch);
+ }
+ //通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本)
+ if (localBranch.contains("#") && localBranch.equals(remoteBranch)) {
+ //说明版本一致,仅做日志记录
+ FineLoggerFactory.getLogger().info("Remote Designer version consistency");
+ } else {
+ localBranch = formatBranch(localBranch);
+ remoteBranch = formatBranch(remoteBranch);
+ Set noExistServiceSet = getNoExistServiceSet(connectionInfo);
+ StringBuilder textBuilder = new StringBuilder();
+ for (Class clazz : noExistServiceSet) {
+ WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class);
+ if(workspaceAPI == null){
+ FineLoggerFactory.getLogger().info("workspace service {} get annotation failed", clazz);
+ continue;
+ }
+ if(workspaceAPI.ignore()){
+ continue;
+ }
+ String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description());
+ textBuilder.append(descriptionOfCN).append("\n");
+ }
+ String areaText = textBuilder.toString();
+ if(StringUtils.isEmpty(areaText)){
+ return;
+ }
+ CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch);
+ dialog.setVisible(true);
+ }
+ }
+ }
+
+ /**
+ * 判断是否需要做版本验证,判断依据为
+ * 1、选择的环境为远程环境
+ * 2、一个月内不弹出是否勾选
+ * @param selectedEnv 选择的环境
+ * @return
+ */
+ private boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv){
+ if(selectedEnv.getType() == DesignerWorkspaceType.Remote){
+ try {
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+ Calendar calendar = Calendar.getInstance();
+ if(StringUtils.isEmpty(selectedEnv.getRemindTime())){
+ return true;
+ }
+ //获取记录的时间
+ Date remindTime = format.parse(selectedEnv.getRemindTime());
+ calendar.setTime(remindTime);
+ //获取一个月后的时间
+ calendar.add(Calendar.MONTH,1);
+ //与当前时间作对比,然后判断是否提示
+ if(new Date().after(calendar.getTime())){
+ return true;
+ }
+ } catch (ParseException e) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * 获取不存在的服务列表
+ * @param info 环境连接信息
+ * @return 以Set形式返回不存在的服务
+ */
+ public Set getNoExistServiceSet(WorkspaceConnectionInfo info){
+ Set noExistServiceSet = new HashSet();
+ Set remoteServiceSet = new HashSet();
+ Set localServiceSet = FineObjectPool.getInstance().getServerPool().keySet();
+
+ try {
+ JSONArray serviceArray = new FunctionalHttpRequest(info).getServiceList();
+ for(int i = 0; i < serviceArray.size(); i++){
+ try{
+ Class clazz = Class.forName((String) serviceArray.get(i));
+ remoteServiceSet.add(clazz);
+ } catch (Exception e){
+ continue;
+ }
+ }
+ noExistServiceSet.addAll(localServiceSet);
+ noExistServiceSet.removeAll(remoteServiceSet);
+ return noExistServiceSet;
+ } catch (WorkspaceConnectionException e) {
+ FineLoggerFactory.getLogger().info(e.getMessage());
+ //根据本地的服务列表做逐一检测
+ for(Class clazz : localServiceSet) {
+ Method testMethod = Reflect.on(Method.class).create(clazz, "connectTest", new Class[0], String.class, new Class[0], 1025, 8, null, null, null, null).get();
+ WorkspaceProxyPool proxyPool = (WorkspaceProxyPool) (((RemoteWorkspace) WorkContext.getCurrent()).getClient()).getPool();
+ Result result = proxyPool.testInvoker(testMethod);
+ Exception invokeException = (Exception) result.getException();
+ if(invokeException != null){
+ Exception cause = (Exception) invokeException.getCause();
+ //获取被包装最底层的异常
+ while (cause != null) {
+ invokeException = cause;
+ cause = (Exception) invokeException.getCause();
+ }
+ //该异常表示服务不存在
+ if(invokeException instanceof ClassNotFoundException){
+ noExistServiceSet.add(clazz);
+ }
+ }
+ }
+ return noExistServiceSet;
+ } catch (Exception e){
+ FineLoggerFactory.getLogger().error(e.getMessage(),e);
+ return noExistServiceSet;
+ }
+ }
+
+ /**
+ * 格式化分支版本号
+ * @param branch 初始的分支版本号
+ * @return 格式化后的版本号
+ */
+ private String formatBranch(String branch){
+ if(branch.contains("#")){
+ return branch.substring(branch.lastIndexOf("#") + 1, branch.length() - 13);
+ }
+ return branch;
+ }
+
+
/**
* 编辑items
*
@@ -242,14 +411,18 @@ public class EnvChangeEntrance {
@Override
public void doOk() {
+ ProcessEventPipe pipe = FineProcessContext.getParentPipe();
+ if (FineProcessContext.getParentPipe() != null) {
+ pipe.fire(new CarryMessageEvent(ReportState.ACTIVE.getValue()));
+ }
if (!envListOkAction(envListPane, PopTipStrategy.NOW)) {
- System.exit(0);
+ DesignerExiter.getInstance().execute();
}
}
@Override
public void doCancel() {
- System.exit(0);
+ DesignerExiter.getInstance().execute();
}
});
envListDialog.setVisible(true);
diff --git a/designer-base/src/main/java/com/fr/design/RestartHelper.java b/designer-base/src/main/java/com/fr/design/RestartHelper.java
index cdb4fc532e..64fdda7baa 100644
--- a/designer-base/src/main/java/com/fr/design/RestartHelper.java
+++ b/designer-base/src/main/java/com/fr/design/RestartHelper.java
@@ -2,6 +2,7 @@ package com.fr.design;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.RestartAction;
+import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.log.FineLoggerFactory;
@@ -152,7 +153,14 @@ public class RestartHelper {
} finally {
WorkContext.getCurrent().close();
frame.dispose();
- System.exit(0);
+ try {
+ // 更新升级过渡用 供当前测试 后面可删除
+ Class.forName("com.fr.exit.DesignerExiter");
+ DesignerExiter.getInstance().execute();
+ } catch (Exception ignore) {
+ } finally {
+ System.exit(0);
+ }
}
}
@@ -194,7 +202,11 @@ public class RestartHelper {
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
- DesignerContext.getDesignerFrame().exit();
+ if (DesignerContext.getDesignerFrame() != null) {
+ DesignerContext.getDesignerFrame().exit();
+ } else {
+ DesignerExiter.getInstance().execute();
+ }
}
}
}
\ No newline at end of file
diff --git a/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java b/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java
index 157f775b8c..9e550377f0 100644
--- a/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java
@@ -2,6 +2,7 @@ package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.CloudCenter;
import com.fr.log.FineLoggerFactory;
@@ -38,7 +39,7 @@ public class UpAction extends UpdateAction
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
- JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser"));
+ FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser"));
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java
index 83aeaefe3d..574195470b 100644
--- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java
+++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java
@@ -260,6 +260,13 @@ public class ActionFactory {
}
}
+ public static void referCellInsertActionClass(Class>[] cls) {
+ if (cls != null) {
+ actionClasses.clear();
+ Collections.addAll(actionClasses, cls);
+ }
+ }
+
/**
* 生成单元格插入相关的Action
* 表单中报表块编辑需要屏蔽掉"插入子报表"
@@ -318,6 +325,13 @@ public class ActionFactory {
}
}
+ public static void referFloatInsertActionClass(Class>[] cls) {
+ if (cls != null) {
+ floatActionClasses.clear();
+ Collections.addAll(floatActionClasses, cls);
+ }
+ }
+
/**
* 生成悬浮元素插入相关的Action
*
diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
index 55ccfce636..3fc03f438f 100644
--- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
+++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
@@ -38,6 +38,7 @@ import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
+import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.log4j.Level;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
@@ -218,22 +219,23 @@ public class PreferencePane extends BasicPane {
oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables"));
oraclePane.add(oracleSpace);
- JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager"));
- useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager"));
- upmSelectorPane.add(useOptimizedUPMCheckbox);
- advancePane.add(upmSelectorPane);
+ if (!OperatingSystem.isLinux()) {
+ JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager"));
+ useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager"));
+ upmSelectorPane.add(useOptimizedUPMCheckbox);
+ advancePane.add(upmSelectorPane);
+ }
- //REPORT-23578 先屏蔽掉
- //JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager"));
- //useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
- //dbmSelectorPane.add(useUniverseDBMCheckbox);
- //advancePane.add(dbmSelectorPane);
+ JPanel dbmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Database_Manager"));
+ useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
+ dbmSelectorPane.add(useUniverseDBMCheckbox);
+ advancePane.add(dbmSelectorPane);
JPanel improvePane = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Product_Improve"));
joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve"));
improvePane.add(joinProductImproveCheckBox);
- if(SupportOSImpl.AUTOPUSHUPDATE.support()){
+ if (SupportOSImpl.AUTOPUSHUPDATE.support()) {
autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update"));
improvePane.add(autoPushUpdateCheckBox);
}
@@ -511,23 +513,8 @@ public class PreferencePane extends BasicPane {
JPanel logLevelPane = FRGUIPaneFactory.createTitledBorderPane("log" + i18nText("Fine-Design_Basic_Level_Setting"));
logPane.add(logLevelPane);
logLevelComboBox = new UIComboBox(LOG);
+ logLevelComboBox.setEnabled(WorkContext.getCurrent().isLocal());
logLevelPane.add(logLevelComboBox);
- logLevelComboBox.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- Configurations.update(new Worker() {
- @Override
- public void run() {
- Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem());
- }
-
- @Override
- public Class extends Configuration>[] targets() {
- return new Class[]{Log4jConfig.class};
- }
- });
- }
- });
}
private void createLanPane(JPanel generalPane) {
@@ -555,8 +542,8 @@ public class PreferencePane extends BasicPane {
});
UILabel noticeLabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer"));//sail:提示重启后生效
double p = TableLayout.PREFERRED;
- double rowSize[] = {p};
- double columnSize[] = {p, p, p};
+ double[] rowSize = {p};
+ double[] columnSize = {p, p, p};
Component[][] components = {
{languageLabel, languageComboBox, noticeLabel},
};
@@ -596,7 +583,7 @@ public class PreferencePane extends BasicPane {
private void createLengthPane(JPanel advancePane) {
double p = TableLayout.PREFERRED;
- double rowSize[] = {p};
+ double[] rowSize = {p};
// 长度单位选择
JPanel lengthPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Setting_Ruler_Units"));
@@ -618,8 +605,8 @@ public class PreferencePane extends BasicPane {
private void createServerPane(JPanel advancePane) {
double p = TableLayout.PREFERRED;
- double rowSize[] = {p};
- double columnSize[] = {p, p, p};
+ double[] rowSize = {p};
+ double[] columnSize = {p, p, p};
JPanel serverPortPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Web_Preview_Port_Setting"));
advancePane.add(serverPortPane);
@@ -658,7 +645,7 @@ public class PreferencePane extends BasicPane {
/**
* The method of populate.
*
- * @param designerEnvManager
+ * @param designerEnvManager 设计器环境管理器
*/
public void populate(DesignerEnvManager designerEnvManager) {
if (designerEnvManager == null) {
@@ -687,7 +674,7 @@ public class PreferencePane extends BasicPane {
defaultStringToFormulaBox.setSelected(false);
}
VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager();
- if (WorkContext.getCurrent().isCluster()) {
+ if (WorkContext.getCurrent().isCluster()){
vcsEnableCheckBox.setEnabled(false);
gcEnableCheckBox.setEnabled(false);
}
@@ -727,9 +714,11 @@ public class PreferencePane extends BasicPane {
this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort()));
- useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM());
+ if (useOptimizedUPMCheckbox != null) {
+ useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM());
+ }
- //useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM());
+ useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM());
this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace());
this.cachingTemplateSpinner.setValue(designerEnvManager.getCachingTemplateLimit());
@@ -826,23 +815,32 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50);
}
- Configurations.update(new Worker() {
- @Override
- public void run() {
- Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem()));
- }
+ if (WorkContext.getCurrent().isLocal()) {
+ Configurations.update(new Worker() {
+ @Override
+ public void run() {
+ Level level = (Level) logLevelComboBox.getSelectedItem();
+ if (level != null) {
+ Log4jConfig.getInstance().setRootLevel(level);
+ }
+ }
- @Override
- public Class extends Configuration>[] targets() {
- return new Class[]{Log4jConfig.class};
- }
- });
+ @Override
+ public Class extends Configuration>[] targets() {
+ @SuppressWarnings("unchecked")
+ Class extends Configuration>[] classes = new Class[]{Log4jConfig.class};
+ return classes;
+ }
+ });
+ }
Configurations.update(new Worker() {
@Override
public void run() {
- ServerPreferenceConfig.getInstance().setUseOptimizedUPM(useOptimizedUPMCheckbox.isSelected());
- //ServerPreferenceConfig.getInstance().setUseUniverseDBM(useUniverseDBMCheckbox.isSelected());
+ if (useOptimizedUPMCheckbox != null) {
+ ServerPreferenceConfig.getInstance().setUseOptimizedUPM(useOptimizedUPMCheckbox.isSelected());
+ }
+ ServerPreferenceConfig.getInstance().setUseUniverseDBM(useUniverseDBMCheckbox.isSelected());
}
@Override
diff --git a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
index f3bfe5622e..f3c5236b52 100644
--- a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
+++ b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
@@ -21,7 +21,7 @@ import java.util.Map;
import static javax.swing.JOptionPane.OK_CANCEL_OPTION;
import static javax.swing.JOptionPane.OK_OPTION;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
-import static javax.swing.JOptionPane.showConfirmDialog;
+import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog;
public final class WebPreviewUtils {
diff --git a/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java b/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java
index 4f8424c41f..5277d2ebf1 100644
--- a/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java
@@ -2,6 +2,7 @@ package com.fr.design.actions.file.export;
import com.fr.design.actions.JTemplateAction;
import com.fr.design.base.mode.DesignModeContext;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.iprogressbar.FRProgressBar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
@@ -132,10 +133,10 @@ public abstract class AbstractExportAction> extends JT
E e = getEditingComponent();
if (!e.isALLSaved() && !DesignModeContext.isVcsMode()) {
e.stopEditing();
- int returnVal = JOptionPane.showConfirmDialog(
+ int returnVal = FineJOptionPane.showConfirmDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + e.getEditingFILE() + "\" ?",
- ProductConstants.PRODUCT_NAME,
+ Toolkit.i18nText("Fine-Design_Basic_Confirm"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE
);
@@ -171,30 +172,30 @@ public abstract class AbstractExportAction> extends JT
this.setProgress(100);
FineLoggerFactory.getLogger().info("\"" + name + "\"" + Toolkit.i18nText("Fine-Design_Report_Finish_Export") + "!");
- JOptionPane.showMessageDialog(
+ FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Report_Exported_Successfully") + "\n" + name);
} catch (RemoteDesignPermissionDeniedException exp) {
- FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
this.setProgress(100);
target.closeTemplate();
- JOptionPane.showMessageDialog(
+ FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
+ FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Engine_Remote_Design_Permission_Denied"),
- UIManager.getString("OptionPane.messageDialogTitle"),
+ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"),
JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon")
);
} catch (Exception exp) {
- FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
this.setProgress(100);
target.closeTemplate();
- JOptionPane.showMessageDialog(
+ FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
+ FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Report_Export_Failed") + "\n" + path,
- UIManager.getString("OptionPane.messageDialogTitle"),
+ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"),
JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon")
);
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java b/designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java
index 4b09de8562..0839c14767 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java
@@ -51,7 +51,7 @@ public class FineUIAction extends UpdateAction {
BasicDialog dialog = pane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
-
+ // Do nothing
}
});
dialog.setVisible(true);
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/ForumAction.java b/designer-base/src/main/java/com/fr/design/actions/help/ForumAction.java
index 2d4814d2ed..0f3c5e9cc1 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/ForumAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/ForumAction.java
@@ -6,6 +6,7 @@ package com.fr.design.actions.help;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.CloudCenter;
import com.fr.log.FineLoggerFactory;
@@ -47,7 +48,7 @@ public class ForumAction extends UpdateAction {
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
- JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser"));
+ FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser"));
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/SupportQQAction.java b/designer-base/src/main/java/com/fr/design/actions/help/SupportQQAction.java
index a118f9d878..16b8b19eba 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/SupportQQAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/SupportQQAction.java
@@ -6,6 +6,7 @@ package com.fr.design.actions.help;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.menu.MenuKeySet;
import com.fr.log.FineLoggerFactory;
@@ -37,7 +38,7 @@ public class SupportQQAction extends UpdateAction {
try {
Desktop.getDesktop().browse(new URI(ProductConstants.SUPPORT_QQ));
} catch (IOException exp) {
- JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser"));
+ FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser"));
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindDialog.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindDialog.java
index fe894437d7..e2d7b63c9f 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindDialog.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindDialog.java
@@ -31,7 +31,7 @@ public class RemindDialog extends UIDialog {
@Override
public void checkValid() throws Exception {
-
+ // Do nothing
}
public RemindPane getRemindPane() {
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java
index 7591c2af3d..1d8d99266e 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/RemindPane.java
@@ -114,6 +114,7 @@ public class RemindPane extends JPanel {
@Override
public void removeLayoutComponent(Component comp) {
+ // Do nothing
}
@Override
@@ -139,6 +140,7 @@ public class RemindPane extends JPanel {
@Override
public void addLayoutComponent(String name, Component comp) {
+ // Do nothing
}
};
}
diff --git a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
index 15c6cb705c..50ecd0ea6d 100644
--- a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
@@ -57,49 +57,6 @@ public class ConnectionListAction extends UpdateAction {
osBasedAction.execute();
}
- /* private void openDesignDatabaseManager() {
- DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
- final ConnectionConfig datasourceManager = ConnectionConfig.getInstance();
- final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() {
- public void complete() {
- ConnectionConfig connectionConfig = datasourceManager.mirror();
- populate(connectionConfig);
- }
-
- protected void renameConnection(String oldName, String newName) {
- datasourceManager.renameConnection(oldName, newName);
- }
- };
- final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
- databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
- public void doOk() {
- if (!databaseManagerPane.isNamePermitted()) {
- databaseListDialog.setDoOKSucceed(false);
- return;
- }
- Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
- @Override
- public void run() {
- databaseManagerPane.update(datasourceManager);
- }
- }.addCallBack(new CallBackAdaptor() {
- @Override
- public boolean beforeCommit() {
- //如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
- return doWithDatasourceManager(datasourceManager, databaseManagerPane, databaseListDialog);
- }
-
- @Override
- public void afterCommit() {
- DesignerContext.getDesignerBean("databasename").refreshBeanElement();
- }
- }));
- }
- });
- databaseListDialog.setVisible(true);
- }
-*/
-
/**
* 更新datasourceManager
*
diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
index deef91f0c7..84591579ec 100644
--- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
@@ -77,17 +77,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
}
protected void renameConnection(final String oldName, final String newName) {
- Configurations.update(new Worker() {
- @Override
- public void run() {
- tableDataConfig.renameTableData(oldName, newName);
- }
-
- @Override
- public Class extends Configuration>[] targets() {
- return new Class[]{TableDataConfig.class, ProcedureConfig.class};
- }
- });
+ tableDataConfig.renameTableData(oldName, newName);
}
};
final BasicDialog globalTableDataDialog = globalTableDataPane.showLargeWindow(designerFrame, null);
diff --git a/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java b/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java
index 7b41f6fd81..d000dbbbb0 100644
--- a/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java
@@ -16,7 +16,6 @@ import java.awt.event.ActionEvent;
* @since 8.0
*/
public class PluginManagerAction extends UpdateAction {
- private static String PLUGIN_MANAGER_ROUTE = "#management/plugin";
public PluginManagerAction() {
this.setMenuKeySet(PLUGIN_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName());
diff --git a/designer-base/src/main/java/com/fr/design/condition/ContinuousTreeSelectionModel.java b/designer-base/src/main/java/com/fr/design/condition/ContinuousTreeSelectionModel.java
index 69d3a51aa8..8e83255cf3 100644
--- a/designer-base/src/main/java/com/fr/design/condition/ContinuousTreeSelectionModel.java
+++ b/designer-base/src/main/java/com/fr/design/condition/ContinuousTreeSelectionModel.java
@@ -16,8 +16,6 @@ import com.fr.design.utils.gui.GUICoreUtils;
* 一个层次连续节点.
*/
public class ContinuousTreeSelectionModel extends DefaultTreeSelectionModel {
- public ContinuousTreeSelectionModel() {
- }
public void addSelectionPaths(TreePath[] paths) {
if (paths == null || paths.length == 0) {
diff --git a/designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java b/designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java
index 193c35775a..98f5f36530 100644
--- a/designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java
+++ b/designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java
@@ -10,6 +10,7 @@ import com.fr.data.condition.ListCondition;
import com.fr.data.condition.ObjectCondition;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fr.design.formula.VariableResolver;
@@ -123,7 +124,7 @@ public abstract class LiteConditionPane extends BasicBeanPa
ExpandMutableTreeNode parentTreeNode = getParentTreeNode();
boolean result = isExistedInParentTreeNode(parentTreeNode, liteCondition, false);
if (result) {
- JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(LiteConditionPane.this),
+ FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(LiteConditionPane.this),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_BindColumn_This_Condition_Has_Been_Existed"));
return;
}
@@ -222,7 +223,7 @@ public abstract class LiteConditionPane extends BasicBeanPa
return;
}
- int returnVal = JOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(LiteConditionPane.this),
+ int returnVal = FineJOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(LiteConditionPane.this),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"),
JOptionPane.OK_CANCEL_OPTION);
if (returnVal == JOptionPane.OK_OPTION) {
@@ -610,7 +611,7 @@ public abstract class LiteConditionPane extends BasicBeanPa
//修改的时候加入判断条件重复 REPORT-13441
boolean result = isExistedInParentTreeNode(parentTreeNode, liteCondition, true);
if (result) {
- JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(LiteConditionPane.this),
+ FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(LiteConditionPane.this),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_BindColumn_This_Condition_Has_Been_Existed"));
return;
}
diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java
index 1e119d27ed..15a7c87c08 100644
--- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java
+++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java
@@ -145,7 +145,6 @@ public interface UIConstants {
public static final Color LIST_ITEM_SPLIT_LINE = new Color(0xf0f0f3);
-
public static final BufferedImage DRAG_BAR = IOUtils.readImage("com/fr/design/images/control/bar.png");
public static final BufferedImage DRAG_BAR_LIGHT = IOUtils.readImage("com/fr/design/images/control/bar-light.png");
public static final BufferedImage ARROW_NORTH = IOUtils.readImage("com/fr/design/images/control/up_arrow.png");
@@ -196,6 +195,7 @@ public interface UIConstants {
public static final Icon ANA_SMALL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/anas.png");
public static final Icon REFRESH_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/refresh.png");
public static final Icon FONT_ICON = IOUtils.readIcon("/com/fr/design/images/gui/color/foreground.png");
+ public static final Icon AUTO_FONT_ICON = IOUtils.readIcon("/com/fr/design/images/gui/color/autoForeground.png");
public static final Icon HISTORY_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/history.png");
public static final Icon DELETE_ICON = IOUtils.readIcon("com/fr/design/images/m_file/close.png");
public static final Icon EDIT_ICON = IOUtils.readIcon("com/fr/design/images/m_file/edit.png");
diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
index 313ca0e2f7..45b3ac6a2a 100644
--- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
+++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
@@ -272,10 +272,12 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
*/
@Override
public void editingCanceled(ChangeEvent e) {
+ // Do nothing
}
@Override
public void editingStopped(ChangeEvent e) {
+ // Do nothing
}
}
diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
index 44ec26127b..dc7002fa85 100644
--- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
+++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
@@ -83,6 +83,7 @@ public abstract class DesignTableDataManager {
//用于记录是否要弹出参数框
private static ThreadLocal threadLocal = new ThreadLocal();
+ private static Map> columnCache = new HashMap<>();
/**
* 清除全局 数据集缓存.
@@ -113,11 +114,14 @@ public abstract class DesignTableDataManager {
public static void closeTemplate(JTemplate, ?> template) {
if (template != null) {
+ template.whenClose();
+ columnCache.remove(getEditingTableDataSource());
dsListenersMap.remove(template.getPath());
}
}
public static void envChange() {
+ columnCache.clear();
dsListenersMap.clear();
dsNameChangedMap.clear();
clearGlobalDs();
@@ -197,7 +201,60 @@ public abstract class DesignTableDataManager {
java.util.Map resMap = getAllEditingDataSet(source);
java.util.Map dsMap = getAllDataSetIncludingProcedure(resMap);
TableDataWrapper tabledataWrapper = dsMap.get(dsName);
- return tabledataWrapper == null ? new String[0] : tabledataWrapper.calculateColumnNameList().toArray(new String[0]);
+ if (tabledataWrapper == null) {
+ return new String[0];
+ } else {
+ return getSelectedColumnNamesFromCache(source, dsName, tabledataWrapper);
+ }
+ }
+
+ private static String[] getSelectedColumnNamesFromCache(TableDataSource dataSource, String dsName, TableDataWrapper tableDataWrapper) {
+ Map map = columnCache.get(dataSource);
+ if (map == null) {
+ map = new HashMap<>();
+ String[] columnNames = tableDataWrapper.calculateColumnNameList().toArray(new String[0]);
+ map.put(dsName, columnNames);
+ columnCache.put(dataSource, map);
+ return columnNames;
+ } else {
+ String[] columnNames = map.get(dsName);
+ if (columnNames == null) {
+ columnNames = tableDataWrapper.calculateColumnNameList().toArray(new String[0]);
+ map.put(dsName, columnNames);
+ return columnNames;
+ } else {
+ return columnNames;
+ }
+ }
+ }
+
+ public static void removeSelectedColumnNames(String dsName) {
+ Map map = columnCache.get(getEditingTableDataSource());
+ if (map == null) {
+ return;
+ }
+ map.remove(dsName);
+ }
+
+ public static void addDsColumnNames(String dsName, String[] columnNames) {
+ TableDataSource dataSource = getEditingTableDataSource();
+ Map map = columnCache.get(dataSource);
+ if (map == null) {
+ map = new HashMap<>();
+ map.put(dsName, columnNames);
+ columnCache.put(dataSource, map);
+ } else {
+ map.put(dsName, columnNames);
+ }
+ }
+
+ public static String[] getDsColumnNames(String dsName) {
+ TableDataSource dataSource = getEditingTableDataSource();
+ Map map = columnCache.get(dataSource);
+ if (map == null) {
+ return new String[0];
+ }
+ return map.get(dsName);
}
/**
diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
index 028f71363b..eda6414671 100644
--- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
+++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
@@ -17,6 +17,7 @@ import com.fr.design.data.datapane.preview.PreviewLabel;
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable;
import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.icombobox.FilterableComboBoxModel;
import com.fr.design.gui.icombobox.UIComboBox;
@@ -103,10 +104,12 @@ public class ChoosePane extends BasicBeanPane implements Refresha
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
+ // Do nothing
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
+ // Do nothing
}
};
@@ -114,10 +117,12 @@ public class ChoosePane extends BasicBeanPane implements Refresha
private PopupMenuListener listener = new PopupMenuListener() {
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
+ // Do nothing
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
+ // Do nothing
}
@Override
@@ -199,6 +204,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha
}
protected void addFocusListener() {
+ // Do nothing
}
@SuppressWarnings("unchecked")
@@ -332,7 +338,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha
DBUtils.refreshDatabase();
String schema = StringUtils.isEmpty(schemaBox.getSelectedItem()) ? null : schemaBox.getSelectedItem();
DataCoreUtils.refreshTables(getConnection(), TableProcedure.TABLE, schema);
- JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Successfully") + "!", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Database"),
+ FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Successfully") + "!", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Database"),
JOptionPane.INFORMATION_MESSAGE);
}
@@ -438,7 +444,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
- JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"),
+ FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Failed"), JOptionPane.ERROR_MESSAGE);
}
}
@@ -462,7 +468,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha
}
if (!connect) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
- JOptionPane.showMessageDialog(designerFrame, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"),
+ FineJOptionPane.showMessageDialog(designerFrame, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Failed"), JOptionPane.ERROR_MESSAGE);
failedToFindTable();
return null;
@@ -492,6 +498,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha
}
protected void failedToFindTable() {
+ // Do nothing
}
protected String getTableName() {
diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java
index 0ca42c0f92..14d0431e25 100644
--- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java
+++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java
@@ -75,6 +75,7 @@ public class ChoosePaneSupportFormula extends ChoosePane {
}
protected void addFocusListener() {
+ // Do nothing
}
/**
diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
index 59880cc4ef..d2fdc32291 100644
--- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
+++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
@@ -5,6 +5,7 @@ import com.fr.data.TableDataSource;
import com.fr.data.api.StoreProcedureAssist;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.data.DesignTableDataManager;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilist.ListModelElement;
@@ -49,7 +50,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
if (StringUtils.isEmpty(tempName)) {
isNamePermitted = false;
nameableList.stopEditing();
- JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"));
+ FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"));
setIllegalIndex(editingIndex);
return;
}
@@ -58,17 +59,17 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
&& isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName)) {
isNamePermitted = false;
nameableList.stopEditing();
- JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", tempName));
+ 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;
nameableList.stopEditing();
- JOptionPane.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);
}
if (nameableList.getSelectedValue() instanceof ListModelElement) {
Nameable selected = ((ListModelElement) nameableList.getSelectedValue()).wrapper;
- if (!ComparatorUtils.equals(tempName, selected.getName())) {
+ if (!ComparatorUtils.equals(tempName, selected.getName()) && !isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName)) {
rename(selected.getName(), tempName);
}
@@ -255,6 +256,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
}
protected void checkRepeatedDSName(List exsitTableDataNameList) {
+ // Do nothing
}
/**
diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
index 56f81e9a5b..531e128484 100644
--- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
+++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
@@ -16,6 +16,9 @@ import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
+import com.fr.design.dialog.FineJOptionPane;
+import com.fr.design.file.HistoryTemplateListCache;
+import com.fr.design.fun.TableDataDefineProvider;
import com.fr.design.fun.TableDataPaneProcessor;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icontainer.UIScrollPane;
@@ -24,12 +27,12 @@ import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
+import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
-
import com.fr.general.NameObject;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
@@ -38,8 +41,13 @@ import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.core.PropertyChangeAdapter;
-import javax.swing.*;
-import java.awt.*;
+import javax.swing.BorderFactory;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import javax.swing.ToolTipManager;
+import java.awt.BorderLayout;
+import java.awt.GridLayout;
import java.awt.dnd.DnDConstants;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
@@ -89,23 +97,9 @@ public class TableDataTreePane extends BasicTableDataTreePane {
createAddMenuDef();
- GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) {
-
- @Override
- public void on(PluginEvent event) {
-
- addMenuDef.clearShortCuts();
- createAddMenuDef();
- }
- }, new PluginFilter() {
-
- @Override
- public boolean accept(PluginContext context) {
+ // 创建插件监听
+ createPluginListener();
- return context.contain(PluginModule.ExtraDesign);
- }
- });
-
editAction = new EditAction();
removeAction = new RemoveAction();
previewTableDataAction = new PreviewTableDataAction(dataTree);
@@ -145,8 +139,57 @@ public class TableDataTreePane extends BasicTableDataTreePane {
new TableDataTreeDragSource(dataTree, DnDConstants.ACTION_COPY);
checkButtonEnabled();
}
+
+ private void createPluginListener() {
+
+ //菜单栏监听
+ GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) {
+
+ @Override
+ public void on(PluginEvent event) {
+
+ addMenuDef.clearShortCuts();
+ createAddMenuDef();
+ }
+ }, new PluginFilter() {
+
+ @Override
+ public boolean accept(PluginContext context) {
+
+ return context.contain(PluginModule.ExtraDesign);
+ }
+ });
+
+ //监听数据集插件
+ GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
+ @Override
+ public void on(PluginEvent event) {
+ //REPORT-25577
+ //如果数据集插件禁用或启用。需要清空当前模板中的缓存
+ reloadCurrTemplate();
+ }
+ private void reloadCurrTemplate() {
+ JTemplate, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
+ if (accept(jt)) {
+ jt.refreshResource();
+ }
+ }
+
+ private boolean accept(JTemplate, ?> jt) {
+
+ return jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists();
+ }
+ }, new PluginFilter() {
+ @Override
+ public boolean accept(PluginContext pluginContext) {
+ return pluginContext.contain(TableDataDefineProvider.XML_TAG);
+ }
+ });
+ }
+
+
protected void checkButtonEnabled() {
super.checkButtonEnabled(editAction, previewTableDataAction, removeAction, op, dataTree);
}
@@ -243,6 +286,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
if (selectedNO == null) {
return;
}
+ DesignTableDataManager.removeSelectedColumnNames(selectedNO.getName());
dgEdit(((AbstractTableDataWrapper) selectedNO.getObject()).creatTableDataPane(), selectedNO.getName(), false);
}
}
@@ -263,7 +307,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
return;
}
- int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + ":" + selectedNO.getName() + "?",
+ int returnVal = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + ":" + selectedNO.getName() + "?",
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.OK_OPTION) {
// richer:这个地方为什么要在DataSourceTree里面去remove呢?多此一举吧
@@ -274,6 +318,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
dataTree.setSelectionRow(dataTree.getRowCount() - 1);
fireDSChanged();
checkButtonEnabled();
+ DesignTableDataManager.removeSelectedColumnNames(selectedNO.getName());
}
}
}
diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
index a14944d5e6..1e3f96a986 100644
--- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
+++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
@@ -4,6 +4,7 @@ import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.design.ExtraDesignClassManager;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.ConnectionProvider;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
@@ -43,7 +44,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
String tempName = getEditingName();
if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing();
- JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name"));
+ FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name"));
setIllegalIndex(editingIndex);
isNamePermitted = false;
return;
@@ -53,7 +54,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
isNamePermitted = false;
nameableList.stopEditing();
String message = Toolkit.i18nText("Fine-Design_Basic_Connection_Duplicate_Name", tempName);
- JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message);
+ FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message);
setIllegalIndex(editingIndex);
}
if (isNamePermitted && !ComparatorUtils.equals(tempName, selectedName)) {
diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
index f6f258285d..4b4d668666 100644
--- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
+++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
@@ -98,7 +98,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
}
protected void addKeyMonitor() {
-
+ //do nothing
}
protected JPanel createCheckBoxgroupPane() {
@@ -137,7 +137,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
/**
* 给 itemComboBox 加上 itemListener
- *
+ *
* @param itemListener
*/
public void addItemListener(ItemListener itemListener) {
@@ -214,7 +214,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
public static interface DoubleClickSelectedNodeOnTreeListener {
/**
* 处理双击事件
- *
+ *
* @param target
*/
public void actionPerformed(TableProcedure target);
diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java
index 6be5657bbd..575ba43f5b 100644
--- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java
+++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java
@@ -140,8 +140,6 @@ public class PreviewTableModel extends AbstractTableModel {
* 就是由于预览的JTable在不停的getRowCount来显示数据.
*/
private static class ErrorResultSet extends AbstractDataModel {
- public ErrorResultSet() {
- }
public int getRowCount() {
return 0;
@@ -160,6 +158,7 @@ public class PreviewTableModel extends AbstractTableModel {
}
public void release() throws Exception {
+ // Do nothing
}
}
diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
index 01d7c9a6ff..2cd16b4940 100644
--- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
+++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
@@ -14,6 +14,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
+import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel;
@@ -303,7 +304,7 @@ public class PreviewTablePane extends BasicPane {
return;
}
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
- JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), columnErrMessage, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
+ FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), columnErrMessage, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
}
private void populate(TableData tableData) throws Exception {
@@ -394,8 +395,8 @@ public class PreviewTablePane extends BasicPane {
} catch (Exception e) {
if (!(e instanceof CancellationException)) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
- JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(),
- null, 0, UIManager.getIcon("OptionPane.errorIcon"));
+ FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(),
+ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
}
dialog.setVisible(false);
} finally {
diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java
index a3248ba1d8..3336596591 100644
--- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java
+++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java
@@ -38,6 +38,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
this.setDefaultEditor(ParameterTableModel.ParameterEditor.class, new ParameterTableModel().new ParameterEditor());
this.setDefaultRenderer(StoreProcedureParameterValueEditor.class, new ProcedureParameterValueRenderer());
}
+ @Override
public boolean isCellEditable(int row, int col) {
if (ComparatorUtils.equals(getValueAt(row, col -1), "OUT")) {
return false;
@@ -48,6 +49,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
return false;
}
+ @Override
public boolean shouldResponseDoubleClickAction () {
return false;
}
@@ -60,7 +62,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
editor = ValueEditorPaneFactory.createStoreProcedValueEditorPane();
editor.getMenu().addPopupMenuListener(new PopupMenuListener() {
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
-
+ // Do nothing
}
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
@@ -77,15 +79,16 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
}, 100);
}
+ @Override
public void popupMenuCanceled(PopupMenuEvent e) {
-
+ //do nothing
}
});
this.addCellEditorListener(new CellEditorListener() {
@Override
public void editingCanceled(ChangeEvent e) {
-
+ //do nothing
}
@Override
@@ -147,6 +150,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
editor = ValueEditorPaneFactory.createStoreProcedValueEditorPane();
}
+ @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
editor.setCurrentEditor(0);
editor.populate(value);
diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
index 7cd8dec3e8..b454ddd89f 100644
--- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
+++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
@@ -57,8 +57,10 @@ public class ClassTableDataPane extends AbstractTableDataPane {
(Dialog) SwingUtilities.getWindowAncestor(ClassTableDataPane.this),
new DialogActionAdapter() {
public void doOk() {
- classNameTextField.setText(bPane.getClassPath());
- }
+ String classPath = bPane.getClassPath();
+ ClassTableData tableData = new ClassTableData(classPath);
+ populateBean(tableData);
+ }
});
dlg.setVisible(true);
}
@@ -124,6 +126,7 @@ public class ClassTableDataPane extends AbstractTableDataPane {
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
}
+ @Override
public void actionPerformed(ActionEvent e) {
java.util.List oldParas = editorPane.update();
oldParas.add(new Parameter());
@@ -132,6 +135,7 @@ public class ClassTableDataPane extends AbstractTableDataPane {
@Override
public void checkEnabled() {
+ //do nothing
}
}
private class RemoveParaAction extends UITableEditAction {
@@ -149,6 +153,7 @@ public class ClassTableDataPane extends AbstractTableDataPane {
@Override
public void checkEnabled() {
+ //do nothing
}
}
diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/CustomDictModel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/CustomDictModel.java
index fdf44df23e..3d9fbad2ad 100644
--- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/CustomDictModel.java
+++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/CustomDictModel.java
@@ -1,22 +1,21 @@
package com.fr.design.data.tabledata.tabledatapane;
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.ArrayList;
-import java.util.List;
+import com.fr.design.gui.itableeditorpane.ActionStyle;
+import com.fr.design.gui.itableeditorpane.UIArrayTableModel;
+import com.fr.design.gui.itableeditorpane.UITableEditAction;
+import com.fr.design.gui.itableeditorpane.UITableModelAdapter;
+import com.fr.design.gui.itextfield.UITextField;
import javax.swing.AbstractCellEditor;
import javax.swing.JTable;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.table.TableCellEditor;
-
-import com.fr.design.gui.itableeditorpane.ActionStyle;
-import com.fr.design.gui.itableeditorpane.UIArrayTableModel;
-import com.fr.design.gui.itableeditorpane.UITableEditAction;
-import com.fr.design.gui.itableeditorpane.UITableModelAdapter;
-import com.fr.design.gui.itextfield.UITextField;
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
public class CustomDictModel extends UITableModelAdapter