|
|
|
@ -12,6 +12,9 @@ import com.fr.design.mainframe.JTemplate;
|
|
|
|
|
import com.fr.design.mainframe.JTemplateActionListener; |
|
|
|
|
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.general.IOUtils; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.plugin.context.PluginContext; |
|
|
|
@ -20,6 +23,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; |
|
|
|
@ -56,10 +61,22 @@ public class VcsHelper implements JTemplateActionListener {
|
|
|
|
|
private final static String SERVICE_NAME_MOVE = "moveVcs"; |
|
|
|
|
private static final VcsHelper INSTANCE = new VcsHelper(); |
|
|
|
|
|
|
|
|
|
private volatile boolean legacyMode; |
|
|
|
|
|
|
|
|
|
public static VcsHelper getInstance() { |
|
|
|
|
return INSTANCE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private VcsHelper() { |
|
|
|
|
legacyMode = WorkContext.getCurrent().get(VcsOperator.class).isLegacyMode(); |
|
|
|
|
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() { |
|
|
|
|
@Override |
|
|
|
|
public void on(Event event, Workspace param) { |
|
|
|
|
legacyMode = WorkContext.getCurrent().get(VcsOperator.class).isLegacyMode(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private int containsFolderCounts() { |
|
|
|
|
TemplateFileTree fileTree = TemplateTreePane.getInstance().getTemplateFileTree(); |
|
|
|
|
if (fileTree.getSelectionPaths() == null) { |
|
|
|
@ -187,6 +204,13 @@ public class VcsHelper implements JTemplateActionListener {
|
|
|
|
|
moveVcs.shutdown(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 判断是否为老模式 |
|
|
|
|
* @return 是否为老模式 |
|
|
|
|
*/ |
|
|
|
|
public boolean isLegacyMode() { |
|
|
|
|
return legacyMode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void templateOpened(JTemplate<?, ?> jt) { |
|
|
|
|