Browse Source

Merge pull request #858 in DESIGN/design from ~XIAOXIA/design:release/10.0 to release/10.0

* commit '6d9cf9dd062e9e35e4bc863d40dbaf8fcad3d22e':
  REPORT-16520 @xiaoxia 设计器内打开多模版,进入模版版本管理会“卡住”
  REPORT-16568 @xiaoxia 多人远程设计时,第一个用户未打开模板,直接进入版本控制,模版不会上锁且能正常进入版本管理
bugfix/10.0
xiaoxia 6 years ago
parent
commit
89c28c1011
  1. 7
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  2. 7
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  3. 12
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java

7
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -751,8 +751,11 @@ public class MutilTempalteTabPane extends JComponent {
JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
selectedIndex = HistoryTemplateListCache.getInstance().contains(template);
}
//如果是已后台关闭的模板,则重新打开文件
openedTemplate.get(selectedIndex).activeOldJTemplate();
if (selectedIndex < openedTemplate.size()) {
//如果是已后台关闭的模板,则重新打开文件
openedTemplate.get(selectedIndex).activeOldJTemplate();
}
}
}

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

@ -321,13 +321,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}
private void saveCurrentEditingTemplate() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
jt.stopEditing();
jt.saveTemplate();
jt.requestFocus();
}
private boolean isCurrentEditing(String path) {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
String editing = jt.getEditingFILE().getPath();

12
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java

@ -6,9 +6,10 @@ import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.resource.WorkResource;
import com.fr.workspace.resource.WorkResourceOutputStream;
import com.fr.workspace.server.lock.TplOperator;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.OutputStream;
@ -29,7 +30,7 @@ public class VcsCacheFileNodeFile extends FileNodeFILE {
* @throws Exception
*/
@Override
public InputStream asInputStream() {
public InputStream asInputStream() throws Exception {
if (node == null) {
return null;
}
@ -40,8 +41,11 @@ public class VcsCacheFileNodeFile extends FileNodeFILE {
return null;
}
InputStream in = WorkContext.getCurrent().get(WorkResource.class)
.openStream(StableUtils.pathJoin(VcsHelper.VCS_CACHE_DIR, envPath.substring(VcsHelper.VCS_CACHE_DIR.length() + 1)));
InputStream in = new ByteArrayInputStream(
WorkContext.getCurrent().get(TplOperator.class).readAndLockFile(
StableUtils.pathJoin(VcsHelper.VCS_CACHE_DIR, envPath.substring(VcsHelper.VCS_CACHE_DIR.length() + 1))
)
);
return envPath.endsWith(".cpt") || envPath.endsWith(".frm")
? XMLEncryptUtils.decodeInputStream(in) : in;

Loading…
Cancel
Save