mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-147774 Hide folder name on editor tab
This commit is contained in:
+5
-3
@@ -125,9 +125,11 @@ public class UniqueVFilePathBuilderImpl extends UniqueVFilePathBuilder {
|
||||
setOfFilesWithTheSameName.add(openFile);
|
||||
}
|
||||
}
|
||||
for (VirtualFile recentlyEditedFile : EditorHistoryManager.getInstance(project).getFiles()) {
|
||||
if (recentlyEditedFile.getName().equals(fileName)) {
|
||||
setOfFilesWithTheSameName.add(recentlyEditedFile);
|
||||
if (!skipNonOpenedFiles) {
|
||||
for (VirtualFile recentlyEditedFile : EditorHistoryManager.getInstance(project).getFiles()) {
|
||||
if (recentlyEditedFile.getName().equals(fileName)) {
|
||||
setOfFilesWithTheSameName.add(recentlyEditedFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-5
@@ -339,7 +339,7 @@ public final class EditorTabbedContainer implements Disposable, CloseAction.Clos
|
||||
TabInfo tab = myTabs.findInfo(file);
|
||||
if (tab != null) return;
|
||||
|
||||
tab = new TabInfo(comp).setText(calcTabTitle(myProject, file, true)).setIcon(icon).setTooltipText(tooltip).setObject(file)
|
||||
tab = new TabInfo(comp).setText(calcTabTitle(myProject, file)).setIcon(icon).setTooltipText(tooltip).setObject(file)
|
||||
.setTabColor(calcTabColor(myProject, file)).setDragOutDelegate(myDragOutDelegate);
|
||||
tab.setTestableUi(new MyQueryable(tab));
|
||||
|
||||
@@ -383,10 +383,6 @@ public final class EditorTabbedContainer implements Disposable, CloseAction.Clos
|
||||
}
|
||||
|
||||
public static String calcTabTitle(final Project project, final VirtualFile file) {
|
||||
return calcTabTitle(project, file, true);
|
||||
}
|
||||
|
||||
public static String calcTabTitle(final Project project, final VirtualFile file, boolean skipNonOpenedFiles) {
|
||||
for (EditorTabTitleProvider provider : Extensions.getExtensions(EditorTabTitleProvider.EP_NAME)) {
|
||||
final String result = provider.getEditorTabTitle(project, file);
|
||||
if (result != null) {
|
||||
|
||||
+6
-2
@@ -408,10 +408,14 @@ public class EditorsSplitters extends IdePanePanel implements UISettingsListener
|
||||
}
|
||||
}
|
||||
|
||||
void updateFileName(final VirtualFile updatedFile) {
|
||||
void updateFileName(@Nullable final VirtualFile updatedFile) {
|
||||
final EditorWindow[] windows = getWindows();
|
||||
for (int i = 0; i != windows.length; ++ i) {
|
||||
windows [i].updateFileName(updatedFile);
|
||||
for (VirtualFile file : windows[i].getFiles()) {
|
||||
if (updatedFile == null || file.getName().equals(updatedFile.getName())) {
|
||||
windows[i].updateFileName(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Project project = myManager.getProject();
|
||||
|
||||
+2
-1
@@ -859,7 +859,6 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Persis
|
||||
if (newEditor) {
|
||||
clearWindowIfNeeded(window);
|
||||
|
||||
ourOpenFilesSetModificationCount.incrementAndGet();
|
||||
getProject().getMessageBus().syncPublisher(FileEditorManagerListener.Before.FILE_EDITOR_MANAGER).beforeFileOpened(FileEditorManagerImpl.this, file);
|
||||
|
||||
FileEditor[] newEditors = new FileEditor[newProviders.length];
|
||||
@@ -947,6 +946,7 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Persis
|
||||
.fileOpened(FileEditorManagerImpl.this, file);
|
||||
}
|
||||
});
|
||||
ourOpenFilesSetModificationCount.incrementAndGet();
|
||||
}
|
||||
|
||||
//[jeka] this is a hack to support back-forward navigation
|
||||
@@ -2007,6 +2007,7 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Persis
|
||||
|
||||
public void removeSelectionRecord(@NotNull VirtualFile file, @NotNull EditorWindow window) {
|
||||
mySelectionHistory.remove(Pair.create(file, window));
|
||||
updateFileName(file);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user