Browse Source

rtREPORT-9747

【10.0二轮回归】修改以前的模板无法更改
master
XiaXiang 6 years ago
parent
commit
7caddf7ddd
  1. 8
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  2. 7
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

8
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -1009,13 +1009,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/
private void activeTemplate(FILE tplFile, JTemplate jt) {
// 如果该模板已经打开,则进行激活就可以了
String fullName = StableUtils.pathJoin(new String[]{ProjectConstants.REPORTLETS_NAME, tplFile.getName()});
// 如果是从文件夹打开的文件,不是从设计器文件树打开的文件,则直接取path就行
if (tplFile instanceof FileFILE) {
fullName = tplFile.getPath();
}
fullName = OperatingSystem.isWindows() ? fullName.replaceAll("/", "\\\\") : fullName.replaceAll("\\\\", "/");
int index = HistoryTemplateListPane.getInstance().contains(fullName);
int index = HistoryTemplateListPane.getInstance().contains(tplFile.getPath());
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList();
if (index != -1) {
historyList.get(index).activeJTemplate(index, jt);

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

@ -200,12 +200,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
public String getPath() {
String editingFileName = getEditingFILE().getPath();
if (OperatingSystem.isWindows()) {
return editingFileName.replaceAll("/", "\\\\");
} else {
return editingFileName.replaceAll("\\\\", "/");
}
return getEditingFILE().getPath();
}
protected abstract JComponent createCenterPane();

Loading…
Cancel
Save