diff --git a/modules/spin-tools/src/com/maccasoft/propeller/EditorTab.java b/modules/spin-tools/src/com/maccasoft/propeller/EditorTab.java index 01b41ecb..03723fdf 100644 --- a/modules/spin-tools/src/com/maccasoft/propeller/EditorTab.java +++ b/modules/spin-tools/src/com/maccasoft/propeller/EditorTab.java @@ -609,6 +609,9 @@ private EditorTab(CTabFolder folder, File file, String name, SourcePool sourcePo tabItem = new CTabItem(folder, SWT.NONE); tabItem.setShowClose(true); tabItem.setText(tabItemText); + if (file != null) { + tabItem.setToolTipText(file.getAbsolutePath()); + } tabItem.setData(this); FontData[] fontData = tabItem.getFont().getFontData(); @@ -753,6 +756,9 @@ public void setFile(File file) { File localFile = this.file != null ? this.file : new File(tabItemText).getAbsoluteFile(); sourcePool.removeParsedSource(localFile); + if (file != null) { + tabItem.setToolTipText(file.getAbsolutePath()); + } this.file = file; if (tabItemText.toLowerCase().endsWith(".spin")) { diff --git a/modules/spin-tools/src/com/maccasoft/propeller/SpinTools.java b/modules/spin-tools/src/com/maccasoft/propeller/SpinTools.java index ca1aef79..773b97b6 100644 --- a/modules/spin-tools/src/com/maccasoft/propeller/SpinTools.java +++ b/modules/spin-tools/src/com/maccasoft/propeller/SpinTools.java @@ -60,6 +60,8 @@ import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.FocusAdapter; +import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.MenuEvent; import org.eclipse.swt.events.MenuListener; import org.eclipse.swt.events.MouseAdapter; @@ -458,6 +460,17 @@ public void selectionChanged(SelectionChangedEvent event) { }); fileBrowser.addOpenListener(openListener); + tabFolder.addFocusListener(new FocusAdapter() { + + @Override + public void focusGained(FocusEvent event) { + CTabItem tabItem = tabFolder.getSelection(); + if (tabItem != null) { + EditorTab editorTab = (EditorTab) tabItem.getData(); + editorTab.setFocus(); + } + } + }); tabFolder.addTraverseListener(new TraverseListener() { @Override