Browse Source

REPORT-100939 【版本管理三期】次管可见回收站

release/11.0
Destiny.Lin 1 year ago
parent
commit
508cdc9248
  1. 5
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 3
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  3. 13
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

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

@ -467,8 +467,9 @@ public class PreferencePane extends BasicPane {
vcsPane.add(intervalPanel);
vcsPane.add(saveCommitCheckBox);
vcsPane.add(autoCleanPane);
saveIntervalPane.setVisible(!VcsHelper.getInstance().isLegacyMode());
autoCleanPane.setVisible(!VcsHelper.getInstance().isLegacyMode());
boolean support = VcsHelper.getInstance().checkV2FunctionSupport();
saveIntervalPane.setVisible(support);
autoCleanPane.setVisible(support);
if (VcsHelper.getInstance().isLegacyMode()) {
// 老版本时才显示gc选项
vcsPane.add(gcControlPane);

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

@ -87,6 +87,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.regex.Pattern;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
@ -337,7 +338,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}
toolbarDef.addShortCut(vcsAction);
//11.0.19及其之后加入回收站逻辑
if (!VcsHelper.getInstance().isLegacyMode()) {
if (VcsHelper.getInstance().checkV2FunctionSupport()) {
recycleAction = new RecycleAction();
toolbarDef.addShortCut(recycleAction);
}

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

@ -15,6 +15,7 @@ import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.mainframe.vcs.ui.FileVersionTable;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.event.ListenerAdaptor;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
@ -24,6 +25,8 @@ import com.fr.report.entity.VcsEntity;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import com.fr.workspace.server.vcs.VcsOperator;
import com.fr.workspace.server.vcs.filesystem.VcsFileSystem;
import com.fr.workspace.server.vcs.git.config.GcConfig;
@ -66,6 +69,8 @@ public class VcsHelper implements JTemplateActionListener {
private volatile boolean legacyMode;
private volatile boolean root;
public static VcsHelper getInstance() {
return INSTANCE;
}
@ -89,6 +94,12 @@ public class VcsHelper implements JTemplateActionListener {
}
}
});
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() {
@Override
public void on(Event event, Workspace param) {
root = WorkContext.getCurrent().isRoot() || WorkContext.getCurrent().isLocal();
}
});
}
/**
@ -370,7 +381,7 @@ public class VcsHelper implements JTemplateActionListener {
* @return 支持返回true
*/
public boolean checkV2FunctionSupport() {
return !VcsHelper.getInstance().isLegacyMode() && (WorkContext.getCurrent().isLocal() || WorkContext.getCurrent().isRoot());
return !VcsHelper.getInstance().isLegacyMode() && root;
}
/**

Loading…
Cancel
Save