Browse Source

Merge branch 'release/10.0' of https://cloud.finedevelop.com/scm/~hades/design into release/10.0

bugfix/10.0
Hades 6 years ago
parent
commit
a6c51d368c
  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. 3
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  4. 12
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsCacheFileNodeFile.java
  5. 1
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionRowPanel.java
  6. 4
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/FileVersionsPanel.java
  7. 11
      designer-realize/src/main/java/com/fr/start/Designer.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(); JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
selectedIndex = HistoryTemplateListCache.getInstance().contains(template); selectedIndex = HistoryTemplateListCache.getInstance().contains(template);
} }
//如果是已后台关闭的模板,则重新打开文件 if (selectedIndex < openedTemplate.size()) {
openedTemplate.get(selectedIndex).activeOldJTemplate(); //如果是已后台关闭的模板,则重新打开文件
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) { private boolean isCurrentEditing(String path) {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
String editing = jt.getEditingFILE().getPath(); String editing = jt.getEditingFILE().getPath();

3
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -687,7 +687,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
this.saved = true; this.saved = true;
this.authoritySaved = true; this.authoritySaved = true;
DesignerContext.getDesignerFrame().setTitle(); DesignerContext.getDesignerFrame().setTitle();
if (DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()) {
VcsHelper.dealWithVcs(this);
}
this.fireJTemplateSaved(); this.fireJTemplateSaved();
return true; return true;
} }

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

1
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) { 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"), 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) { JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
vcsEntity.setUsername(VcsHelper.getCurrentUsername());
WorkContext.getCurrent().get(VcsOperator.class).rollbackTo(vcsEntity); WorkContext.getCurrent().get(VcsOperator.class).rollbackTo(vcsEntity);
FileVersionsPanel.getInstance().exitVcs(vcsEntity.getFilename()); FileVersionsPanel.getInstance().exitVcs(vcsEntity.getFilename());
} }

4
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.design.menu.ToolBarDef;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -101,7 +100,8 @@ public class FileVersionsPanel extends BasicPane {
} }
private void showFilterPane() { 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); versionDialog.setVisible(true);
} }

11
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.UserInfoLabel;
import com.fr.design.mainframe.bbs.UserInfoPane; import com.fr.design.mainframe.bbs.UserInfoPane;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; 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.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
@ -221,9 +220,6 @@ public class Designer extends BaseDesigner {
jt.stopEditing(); jt.stopEditing();
jt.saveTemplate(); jt.saveTemplate();
jt.requestFocus(); jt.requestFocus();
if (DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()) {
VcsHelper.dealWithVcs(jt);
}
} }
}); });
return saveButton; return saveButton;
@ -277,19 +273,16 @@ public class Designer extends BaseDesigner {
) { ) {
@Override @Override
protected void upButtonClickEvent() { protected void upButtonClickEvent() {
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) { if (jt == null) {
return; return;
} }
WebPreviewUtils.preview(jt); WebPreviewUtils.preview(jt);
if (DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()) {
VcsHelper.dealWithVcs(jt);
}
} }
@Override @Override
protected void downButtonClickEvent() { protected void downButtonClickEvent() {
final JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); final JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) { if (jt == null) {
return; return;
} }

Loading…
Cancel
Save