Browse Source

REPORT-64581 本地目录下内置服务器未启动时 双击打不开目录树中的模板

feature/x
hades 3 years ago
parent
commit
ab1247612d
  1. 3
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  2. 5
      designer-base/src/main/java/com/fr/design/lock/LockInfoUtils.java

3
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -231,7 +231,8 @@ public class TemplateTreePane extends JPanel implements FileOperations {
return; return;
} }
String lock = node.getLock(); String lock = node.getLock();
boolean showLockInfo = LockInfoUtils.isCompatibleOperator() ? (lock != null && !lock.equals(node.getUserID())) boolean showLockInfo = LockInfoUtils.isCompatibleOperator() || LockInfoUtils.unableGetLockInfo()
? (lock != null && !lock.equals(node.getUserID()))
: WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath); : WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath);
if (showLockInfo) { if (showLockInfo) {
UserInfo userInfo = WorkContext.getCurrent().get(LockInfoOperator.class).getUserInfo(selectedFilePath); UserInfo userInfo = WorkContext.getCurrent().get(LockInfoOperator.class).getUserInfo(selectedFilePath);

5
designer-base/src/main/java/com/fr/design/lock/LockInfoUtils.java

@ -2,6 +2,7 @@ package com.fr.design.lock;
import com.fr.report.lock.DefaultLockInfoOperator; import com.fr.report.lock.DefaultLockInfoOperator;
import com.fr.report.lock.LockInfoOperator; import com.fr.report.lock.LockInfoOperator;
import com.fr.start.server.FineEmbedServer;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
/** /**
@ -15,4 +16,8 @@ public class LockInfoUtils {
LockInfoOperator lockInfoOperator = WorkContext.getCurrent().get(LockInfoOperator.class); LockInfoOperator lockInfoOperator = WorkContext.getCurrent().get(LockInfoOperator.class);
return lockInfoOperator instanceof DefaultLockInfoOperator; return lockInfoOperator instanceof DefaultLockInfoOperator;
} }
public static boolean unableGetLockInfo() {
return WorkContext.getCurrent().isLocal() && !FineEmbedServer.isRunning();
}
} }

Loading…
Cancel
Save