|
|
@ -239,11 +239,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { |
|
|
|
String reportPath = reportletsTree.getSelectedTemplatePath(); |
|
|
|
String reportPath = reportletsTree.getSelectedTemplatePath(); |
|
|
|
final String selectedFilePath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, reportPath); |
|
|
|
final String selectedFilePath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, reportPath); |
|
|
|
String lock = node.getLock(); |
|
|
|
String lock = node.getLock(); |
|
|
|
boolean showLockInfo = LockInfoUtils.isCompatibleOperator() |
|
|
|
boolean showLockInfo = needShowLockInfo(lock, selectedFilePath, node); |
|
|
|
|| LockInfoUtils.unableGetLockInfo() |
|
|
|
|
|
|
|
|| WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(selectedFilePath) |
|
|
|
|
|
|
|
? (lock != null && !lock.equals(node.getUserID())) |
|
|
|
|
|
|
|
: 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); |
|
|
|
node.setLock(UUID.randomUUID().toString()); |
|
|
|
node.setLock(UUID.randomUUID().toString()); |
|
|
@ -257,6 +253,17 @@ public class TemplateTreePane extends JPanel implements FileOperations { |
|
|
|
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(selectedFilePath, false))); |
|
|
|
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(selectedFilePath, false))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 是否需要展示锁定信息 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static boolean needShowLockInfo(String lock, String selectedFilePath, FileNode node) { |
|
|
|
|
|
|
|
return LockInfoUtils.isCompatibleOperator() |
|
|
|
|
|
|
|
|| LockInfoUtils.unableGetLockInfo() |
|
|
|
|
|
|
|
|| WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(selectedFilePath) |
|
|
|
|
|
|
|
? (lock != null && !lock.equals(node.getUserID())) |
|
|
|
|
|
|
|
: WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkDevelopForBiddenTemplate(String selectedFilePath) { |
|
|
|
private void checkDevelopForBiddenTemplate(String selectedFilePath) { |
|
|
|
JTemplate<?, ?> template = getOpenedTemplate(selectedFilePath); |
|
|
|
JTemplate<?, ?> template = getOpenedTemplate(selectedFilePath); |
|
|
|
if (template != null && template.isForbidden()) { |
|
|
|
if (template != null && template.isForbidden()) { |
|
|
|