Browse Source

Merge pull request #1147 in DESIGN/design from ~VITO/c-design:feature/10.0 to feature/10.0

* commit 'f6f8e0f936a90de83a764aed970ba17d2e6380e6':
  REPORT-21295 远程集群报错
persist/11.0
vito 5 years ago
parent
commit
9cb243cf02
  1. 6
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 20
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  3. 20
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

6
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,6 +1,6 @@
package com.fr.design.actions.file;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.cluster.ClusterBridge;
import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager;
@ -307,7 +307,7 @@ public class PreferencePane extends BasicPane {
});
//集群下禁用
if (FineClusterConfig.getInstance().isCluster()) {
if (ClusterBridge.isClusterMode()) {
gcEnableCheckBox.setEnabled(false);
gcButton.setEnabled(false);
}
@ -1050,7 +1050,7 @@ public class PreferencePane extends BasicPane {
if (size > Math.pow(n, 2)) {
return df.format(size / Math.pow(n, 2)) + "MB";
}
return new StringBuilder().append(df.format(size / n)).append("KB").toString();
return df.format(size / n) + "KB";
}
/**

20
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -2,7 +2,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.cluster.ClusterBridge;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -242,6 +242,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
/**
* 响应数据集改变
*/
@Override
public void fireDSChanged() {
fireDSChanged(new HashMap<String, String>());
@ -252,6 +253,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
*
* @param map 改变名字的数据集
*/
@Override
public void fireDSChanged(Map<String, String> map) {
DesignTableDataManager.fireDSChanged(map);
@ -307,7 +309,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
return selectedOperation;
}
/*
/**
* 新建文件夹
*/
private class NewFolderAction extends UpdateAction {
@ -363,7 +365,9 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
* 版本管理可用状态的监控
*/
private void fireVcsActionChange() {
if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() || VcsHelper.getInstance().isUnSelectedTemplate() || FineClusterConfig.getInstance().isCluster()) {
if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
|| VcsHelper.getInstance().isUnSelectedTemplate()
|| ClusterBridge.isClusterMode()) {
setEnabled(false);
return;
}
@ -549,14 +553,17 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
nameField = new UITextField(oldName);
nameField.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void changedUpdate(DocumentEvent e) {
validInput();
}
@Override
public void insertUpdate(DocumentEvent e) {
validInput();
}
@Override
public void removeUpdate(DocumentEvent e) {
validInput();
}
@ -597,6 +604,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
confirmButton.setPreferredSize(new Dimension(60, 25));
confirmButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
confirmClose();
}
@ -608,6 +616,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dispose();
}
@ -764,14 +773,17 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
nameField = new UITextField();
nameField.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void changedUpdate(DocumentEvent e) {
validInput();
}
@Override
public void insertUpdate(DocumentEvent e) {
validInput();
}
@Override
public void removeUpdate(DocumentEvent e) {
validInput();
}
@ -812,6 +824,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
confirmButton.setPreferredSize(new Dimension(60, 25));
confirmButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
confirmClose();
}
@ -824,6 +837,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dispose();
}

20
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.vcs.common;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.cluster.ClusterBridge;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.TemplateTreePane;
@ -49,10 +50,10 @@ public class VcsHelper implements JTemplateActionListener {
public final static int OFFSET = 2;
private static final int MINUTE = 60 * 1000;
private final static String VCS_PLUGIN_ID = "com.fr.plugin.vcs.v10";
private static final VcsHelper instance = new VcsHelper();
private static final VcsHelper INSTANCE = new VcsHelper();
public static VcsHelper getInstance() {
return instance;
return INSTANCE;
}
private int containsFolderCounts() {
@ -111,7 +112,7 @@ public class VcsHelper implements JTemplateActionListener {
if (configManager.isSaveCommit() && StringUtils.isNotBlank(entity.getCommitMsg())) {
return false;
}
return new Date().getTime() - entity.getTime().getTime() < DesignerEnvManager.getEnvManager().getVcsConfigManager().getSaveInterval() * MINUTE;
return System.currentTimeMillis() - entity.getTime().getTime() < DesignerEnvManager.getEnvManager().getVcsConfigManager().getSaveInterval() * MINUTE;
}
public boolean needInit() {
@ -125,7 +126,8 @@ public class VcsHelper implements JTemplateActionListener {
* @param jt
*/
public void fireVcs(final JTemplate jt) {
new Thread(new Runnable() {
ExecutorService fireVcs = Executors.newSingleThreadExecutor(new NamedThreadFactory("fireVcs"));
fireVcs.execute(new Runnable() {
@Override
public void run() {
@ -152,8 +154,8 @@ public class VcsHelper implements JTemplateActionListener {
}
}
}).start();
});
fireVcs.shutdown();
}
@ -169,7 +171,9 @@ public class VcsHelper implements JTemplateActionListener {
*/
@Override
public void templateSaved(JTemplate<?, ?> jt) {
if (needInit() && DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() && !FineClusterConfig.getInstance().isCluster()) {
if (needInit()
&& DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
&& !ClusterBridge.isClusterMode()) {
fireVcs(jt);
}
}

Loading…
Cancel
Save