MCPcopy
hub / github.com/arduino/Arduino / updateTitle

Method updateTitle

app/src/processing/app/Editor.java:1842–1867  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 /**

Callers 3

selectTabMethod · 0.95
handleSaveAsMethod · 0.95
saveAsMethod · 0.80

Calls 12

getCurrentTabMethod · 0.95
getMethod · 0.95
getFileNameMethod · 0.95
replaceFromMappingMethod · 0.95
isPrimaryMethod · 0.95
formatMethod · 0.95
getSketchFileMethod · 0.80
putMethod · 0.80
trMethod · 0.80
getFolderMethod · 0.65
getNameMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected