From cac5653a86b7efa41bceda980d17ae634c614bbe Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sun, 28 Apr 2019 12:55:30 +0800 Subject: [PATCH 1/6] =?UTF-8?q?REPORT-16568=20@xiaoxia=20=E5=A4=9A?= =?UTF-8?q?=E4=BA=BA=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E4=B8=AA=E7=94=A8=E6=88=B7=E6=9C=AA=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=A8=A1=E6=9D=BF=EF=BC=8C=E7=9B=B4=E6=8E=A5=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E7=89=88=E6=9C=AC=E6=8E=A7=E5=88=B6,=E6=A8=A1?= =?UTF-8?q?=E7=89=88=E4=B8=8D=E4=BC=9A=E4=B8=8A=E9=94=81=E4=B8=94=E8=83=BD?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E8=BF=9B=E5=85=A5=E7=89=88=E6=9C=AC=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/DesignerFrameFileDealerPane.java | 7 ------- .../mainframe/vcs/common/VcsCacheFileNodeFile.java | 12 ++++++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index bac6c15c3..264d14fc2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/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(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java index 9933fc0e7..40edc01f0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java +++ b/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; From 6d9cf9dd062e9e35e4bc863d40dbaf8fcad3d22e Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sun, 28 Apr 2019 14:23:03 +0800 Subject: [PATCH 2/6] =?UTF-8?q?REPORT-16520=20@xiaoxia=20=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=86=85=E6=89=93=E5=BC=80=E5=A4=9A=E6=A8=A1?= =?UTF-8?q?=E7=89=88=EF=BC=8C=E8=BF=9B=E5=85=A5=E6=A8=A1=E7=89=88=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E7=AE=A1=E7=90=86=E4=BC=9A=E2=80=9C=E5=8D=A1=E4=BD=8F?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/file/MutilTempalteTabPane.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 65989dfcc..968f72a59 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/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(); + } + } } From 8eb39091c67a7d7457425b077b7be9dc55ac2769 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sun, 28 Apr 2019 15:48:02 +0800 Subject: [PATCH 3/6] =?UTF-8?q?REPORT-16550=20=E6=A8=A1=E6=9D=BF=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java index 7f9fc56fe..4d9b6e35e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java @@ -19,7 +19,6 @@ import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.menu.ToolBarDef; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; -import com.fr.log.FineLoggerFactory; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; @@ -101,7 +100,8 @@ public class FileVersionsPanel extends BasicPane { } private void showFilterPane() { - versionDialog = new FileVersionDialog(DesignerContext.getDesignerFrame(), templatePath); + String savePath = templatePath.startsWith("/") ? templatePath.substring(1) : templatePath; + versionDialog = new FileVersionDialog(DesignerContext.getDesignerFrame(), savePath); versionDialog.setVisible(true); } From e6f7bc739fc0e624d055177c4bc6978bdfe16dc6 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sun, 28 Apr 2019 16:34:47 +0800 Subject: [PATCH 4/6] =?UTF-8?q?REPORT-16527=20@xiaoxia=20=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E7=9B=B4=E6=8E=A5=E9=A2=84=E8=A7=88=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E7=89=88=E4=BF=9D=E5=AD=98=EF=BC=8C=E8=AF=A5?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E4=B8=8D=E4=BC=9A=E4=BF=9D=E5=AD=98=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/main/java/com/fr/start/Designer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index 165ecfed7..142b1bdfa 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -277,19 +277,19 @@ public class Designer extends BaseDesigner { ) { @Override protected void upButtonClickEvent() { - JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jt == null) { return; } - WebPreviewUtils.preview(jt); - if (DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()) { + if (DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() && saveButton.isEnabled()) { VcsHelper.dealWithVcs(jt); } + WebPreviewUtils.preview(jt); } @Override protected void downButtonClickEvent() { - final JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + final JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jt == null) { return; } From 695d04fb9d0a9a52ddcca3c5205e2c1cf30d9702 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Mon, 29 Apr 2019 14:26:16 +0800 Subject: [PATCH 5/6] =?UTF-8?q?REPORT-16559=20@xiaoxia=20=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E8=AE=BE=E8=AE=A1=EF=BC=8C=E5=BC=80=E5=90=AF=E6=A8=A1?= =?UTF-8?q?=E7=89=88=E7=89=88=E6=9C=AC=E4=BF=9D=E5=AD=98=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=A8=A1=E7=89=88=E4=BF=9D=E5=AD=98=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E4=BA=A7=E7=94=9F=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java index e814a9b94..a37a5cea6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java @@ -63,6 +63,7 @@ public class FileVersionRowPanel extends JPanel { public void actionPerformed(ActionEvent evt) { if (JOptionPane.showConfirmDialog(null, Toolkit.i18nText("Fine-Design_Vcs_Version_Revert_Confirm"), Toolkit.i18nText("Fine-Design_Vcs_Version_Revert_Title"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { + vcsEntity.setUsername(VcsHelper.getCurrentUsername()); WorkContext.getCurrent().get(VcsOperator.class).rollbackTo(vcsEntity); FileVersionsPanel.getInstance().exitVcs(vcsEntity.getFilename()); } From 7186d89bb2c9f5eeb26c9057eb36787f8535d163 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Mon, 29 Apr 2019 17:38:27 +0800 Subject: [PATCH 6/6] =?UTF-8?q?REPORT-16527=20@xiaoxia=20=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E7=9B=B4=E6=8E=A5=E9=A2=84=E8=A7=88=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E7=89=88=E4=BF=9D=E5=AD=98=EF=BC=8C=E8=AF=A5?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E4=B8=8D=E4=BC=9A=E4=BF=9D=E5=AD=98=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 3 +++ designer-realize/src/main/java/com/fr/start/Designer.java | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index d256da8ae..a8ec61abc 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -687,7 +687,10 @@ public abstract class JTemplate> this.saved = true; this.authoritySaved = true; DesignerContext.getDesignerFrame().setTitle(); + if (DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()) { + VcsHelper.dealWithVcs(this); + } this.fireJTemplateSaved(); return true; } diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index 142b1bdfa..2c8e030e3 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -30,7 +30,6 @@ import com.fr.design.mainframe.alphafine.component.AlphaFinePane; import com.fr.design.mainframe.bbs.UserInfoLabel; import com.fr.design.mainframe.bbs.UserInfoPane; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; -import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; @@ -221,9 +220,6 @@ public class Designer extends BaseDesigner { jt.stopEditing(); jt.saveTemplate(); jt.requestFocus(); - if (DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()) { - VcsHelper.dealWithVcs(jt); - } } }); return saveButton; @@ -281,9 +277,6 @@ public class Designer extends BaseDesigner { if (jt == null) { return; } - if (DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() && saveButton.isEnabled()) { - VcsHelper.dealWithVcs(jt); - } WebPreviewUtils.preview(jt); }