()
| 1840 | } |
| 1841 | |
| 1842 | public void updateTitle() { |
| 1843 | if (sketchController == null) { |
| 1844 | return; |
| 1845 | } |
| 1846 | SketchFile current = getCurrentTab().getSketchFile(); |
| 1847 | String customFormat = PreferencesData.get("editor.custom_title_format"); |
| 1848 | if (customFormat != null && !customFormat.trim().isEmpty()) { |
| 1849 | Map<String, String> titleMap = new HashMap<String, String>(); |
| 1850 | titleMap.put("file", current.getFileName()); |
| 1851 | String path = sketch.getFolder().getAbsolutePath(); |
| 1852 | titleMap.put("folder", path); |
| 1853 | titleMap.put("path", path); |
| 1854 | titleMap.put("project", sketch.getName()); |
| 1855 | titleMap.put("version", BaseNoGui.VERSION_NAME_LONG); |
| 1856 | |
| 1857 | setTitle(StringReplacer.replaceFromMapping(customFormat, titleMap)); |
| 1858 | } else { |
| 1859 | if (current.isPrimary()) { |
| 1860 | setTitle(I18n.format(tr("{0} | Arduino {1}"), sketch.getName(), |
| 1861 | BaseNoGui.VERSION_NAME_LONG)); |
| 1862 | } else { |
| 1863 | setTitle(I18n.format(tr("{0} - {1} | Arduino {2}"), sketch.getName(), |
| 1864 | current.getFileName(), BaseNoGui.VERSION_NAME_LONG)); |
| 1865 | } |
| 1866 | } |
| 1867 | } |
| 1868 | |
| 1869 | |
| 1870 | /** |
no test coverage detected