Browse Source

Merge pull request #1481 in BA/design from ~MOMEAK/design9.0:release/9.0 to release/9.0

* commit 'bee302560185dbef05914b0704506ef454ff3cc6':
  REPORT-5661 mac设计器打开最近的模板,提示模板不存在
  REPORT-5661 区分mac和windows
  REPORT-5661 mac设计器打开最近的模板,提示模板不存在
master
superman 7 years ago
parent
commit
dd7e6039d5
  1. 2
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  2. 7
      designer_base/src/com/fr/design/mainframe/JTemplate.java

2
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -918,7 +918,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
if (tplFile instanceof FileFILE) { if (tplFile instanceof FileFILE) {
fullName = tplFile.getPath(); fullName = tplFile.getPath();
} }
fullName = fullName.replaceAll("/", "\\\\"); fullName = OperatingSystem.isWindows() ? fullName.replaceAll("/", "\\\\") : fullName.replaceAll("\\\\", "/");
int index = HistoryTemplateListPane.getInstance().contains(fullName); int index = HistoryTemplateListPane.getInstance().contains(fullName);
if (index != -1) { if (index != -1) {
this.activateJTemplate(HistoryTemplateListPane.getInstance().getHistoryList().get(index)); this.activateJTemplate(HistoryTemplateListPane.getInstance().getHistoryList().get(index));

7
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -45,6 +45,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.core.UUID; import com.fr.stable.core.UUID;
@ -196,7 +197,11 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
if (editingFileName.startsWith(ProjectConstants.REPORTLETS_NAME)) { if (editingFileName.startsWith(ProjectConstants.REPORTLETS_NAME)) {
editingFileName = ((FileNodeFILE) getEditingFILE()).getEnvPath() + File.separator + editingFileName; editingFileName = ((FileNodeFILE) getEditingFILE()).getEnvPath() + File.separator + editingFileName;
} }
return editingFileName.replaceAll("/", "\\\\"); if (OperatingSystem.isWindows()) {
return editingFileName.replaceAll("/", "\\\\");
} else {
return editingFileName.replaceAll("\\\\", "/");
}
} }
protected abstract JComponent createCenterPane(); protected abstract JComponent createCenterPane();

Loading…
Cancel
Save