Browse Source

REPORT-14835 版本管理代码调整 屏蔽集群

bugfix/10.0
XiaXiang 6 years ago
parent
commit
62c3d84b4d
  1. 2
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  2. 58
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  3. 1
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

2
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -925,7 +925,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
jt.addJTemplateActionListener(this); jt.addJTemplateActionListener(this);
jt.addTargetModifiedListener(this); jt.addTargetModifiedListener(this);
jt.addJTemplateActionListener(new VcsHelper()); jt.addJTemplateActionListener(VcsHelper.getInstance());
centerTemplateCardPane.showJTemplate(jt); centerTemplateCardPane.showJTemplate(jt);
setTitle(); setTitle();
layeredPane.repaint(); layeredPane.repaint();

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

@ -304,6 +304,37 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
closeOpenedTemplate(path, isCurrentEditing); closeOpenedTemplate(path, isCurrentEditing);
FileVersionsPanel fileVersionTablePanel = FileVersionsPanel.getInstance(); FileVersionsPanel fileVersionTablePanel = FileVersionsPanel.getInstance();
fileVersionTablePanel.showFileVersionsPane(); fileVersionTablePanel.showFileVersionsPane();
stateChange();
}
/**
* 版本管理可用状态的监控
*/
private void fireVcsActionChange() {
if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() || VcsHelper.getInstance().isUnSelectedTemplate() || FineClusterConfig.getInstance().isCluster()) {
vcsAction.setEnabled(false);
return;
}
if (WorkContext.getCurrent() != null) {
if (!WorkContext.getCurrent().isLocal()) {
//当前环境为远程环境时
FileNode node = TemplateTreePane.getInstance().getTemplateFileTree().getSelectedFileNode();
if (selectedOperation.getFilePath() != null) {
if (node.getLock() != null && !ComparatorUtils.equals(node.getUserID(), node.getLock())) {
vcsAction.setEnabled(false);
} else {
vcsAction.setEnabled(true);
}
} else {
vcsAction.setEnabled(false);
}
} else {
//当前环境为本地环境时
vcsAction.setEnabled(selectedOperation.getFilePath() != null);
}
}
} }
private void closeOpenedTemplate(String path, boolean isCurrentEditing) { private void closeOpenedTemplate(String path, boolean isCurrentEditing) {
@ -447,37 +478,14 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
delFileAction.setEnabled(selected); delFileAction.setEnabled(selected);
// 刷新操作始终可用 // 刷新操作始终可用
refreshTreeAction.setEnabled(true); refreshTreeAction.setEnabled(true);
handleVcsAction(); //触发vcsAction变化
vcsAction.fireVcsActionChange();
// 其他状态 // 其他状态
otherStateChange(); otherStateChange();
} }
private void handleVcsAction() {
if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() || VcsHelper.getInstance().isUnSelectedTemplate()) {
vcsAction.setEnabled(false);
return;
}
if (WorkContext.getCurrent() != null) {
if (!WorkContext.getCurrent().isLocal()) {
//当前环境为远程环境时
FileNode node = TemplateTreePane.getInstance().getTemplateFileTree().getSelectedFileNode();
if (selectedOperation.getFilePath() != null) {
if (node.getLock() != null && !ComparatorUtils.equals(node.getUserID(), node.getLock())) {
vcsAction.setEnabled(false);
} else {
vcsAction.setEnabled(true);
}
} else {
vcsAction.setEnabled(false);
}
} else {
//当前环境为本地环境时
vcsAction.setEnabled(selectedOperation.getFilePath() != null);
}
}
}

1
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -39,7 +39,6 @@ import com.fr.design.mainframe.template.info.TemplateProcessInfo;
import com.fr.design.mainframe.template.info.TimeConsumeTimer; import com.fr.design.mainframe.template.info.TimeConsumeTimer;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.mainframe.toolbar.VcsScene; import com.fr.design.mainframe.toolbar.VcsScene;
import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.NameSeparator; import com.fr.design.menu.NameSeparator;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;

Loading…
Cancel
Save