Browse Source

Merge pull request #1302 in DESIGN/design from ~RINOUX/design:release/10.0 to release/10.0

* commit 'bc561230078d7f398ac75103029b66bb30f19314':
  REPORT-22877 远程环境判断是否集群
feature/big-screen
rinoux 5 years ago
parent
commit
01a5d7fca0
  1. 38
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 6
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java
  3. 4
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  4. 5
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

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

@ -1,7 +1,5 @@
package com.fr.design.actions.file;
import com.fr.cluster.ClusterBridge;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager;
@ -47,10 +45,36 @@ import com.fr.workspace.WorkContext;
import com.fr.workspace.server.vcs.VcsOperator;
import com.fr.workspace.server.vcs.git.config.GcConfig;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.Timer;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.text.DecimalFormat;
import java.util.Locale;
@ -663,7 +687,7 @@ public class PreferencePane extends BasicPane {
defaultStringToFormulaBox.setSelected(false);
}
VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager();
if (FineClusterConfig.getInstance().isCluster()) {
if (WorkContext.getCurrent().isCluster()) {
vcsEnableCheckBox.setEnabled(false);
gcEnableCheckBox.setEnabled(false);
}

6
designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java vendored

@ -1,5 +1,6 @@
package com.fr.design.env;
import com.fr.cluster.engine.remote.ClusterOperator;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.AssistUtils;
import com.fr.workspace.WorkContext;
@ -67,6 +68,11 @@ public class RemoteWorkspace implements Workspace {
return isRoot;
}
@Override
public boolean isCluster() {
return WorkContext.getCurrent().get(ClusterOperator.class).isCluster();
}
@Override
public WorkspaceConnection getConnection() {

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

@ -3,8 +3,6 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.extension.FileExtension;
import com.fr.base.vcs.DesignerMode;
import com.fr.cluster.ClusterBridge;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -369,7 +367,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
private void fireVcsActionChange() {
if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
|| VcsHelper.getInstance().isUnSelectedTemplate()
|| FineClusterConfig.getInstance().isCluster()) {
|| WorkContext.getCurrent().isCluster()) {
setEnabled(false);
return;
}

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

@ -1,7 +1,5 @@
package com.fr.design.mainframe.vcs.common;
import com.fr.cluster.ClusterBridge;
import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.file.HistoryTemplateListCache;
@ -27,7 +25,6 @@ import com.fr.workspace.server.vcs.git.config.GcConfig;
import javax.swing.Icon;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@ -174,7 +171,7 @@ public class VcsHelper implements JTemplateActionListener {
public void templateSaved(JTemplate<?, ?> jt) {
if (needInit()
&& DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
&& !FineClusterConfig.getInstance().isCluster()) {
&& !WorkContext.getCurrent().isCluster()) {
fireVcs(jt);
}
}

Loading…
Cancel
Save