Fix Ctrl+F7 view switcher showing same name for multi-instance views#4134
Open
Philipp0205 wants to merge 1 commit into
Open
Fix Ctrl+F7 view switcher showing same name for multi-instance views#4134Philipp0205 wants to merge 1 commit into
Philipp0205 wants to merge 1 commit into
Conversation
Remove the getPartName() override in ViewReference that always returned the static descriptor label from plugin.xml. The parent class WorkbenchPartReference.getPartName() returns part.getLocalizedLabel() which reflects the dynamic name set by views via setPartName(). This is a generic fix for all multi-instance views (Terminal, Console, Search) that customize their part name. Fixes eclipse-platform/eclipse.platform#2774
7837dac to
b566f4b
Compare
Member
|
@Philipp0205 : I've rebased your branch on latest master state. Your state was very old. |
Author
|
@iloveeclipse thanks, I forgot to update my fork 🙃 |
Contributor
Member
|
This works for Terminal views but doesn't work for Console / Search views - they also show exact same names in the tabs. I guess the way how Terminal (coming originally from CDT) manages its name differs from "regular" multi-instance views which were developed in the Platform. Ideally we should investigate what is the difference and provide a fix that works consistently for all views. |
Author
|
okay, apparently I did not test this good enough. I also noticed that console and search views do not add numbers to their tab names if opened multiple times. Let me have another look at the other views. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change made: Removed the
getPartName()override fromViewReference.java.Views like Terminal call
setPartName("Terminal " + secondaryId)which triggersCompatibilityPartto update the E4 model viapart.setLabel(computeLabel()). The parent classWorkbenchPartReference.getPartName()returnspart.getLocalizedLabel()which reflects this dynamic name (e.g. Terminal 1, Terminal 2 instead of Terminal Terminal).The removed override was bypassing this by always returning the static plugin.xml descriptor label. Generic fix: Works for all multi-instance views (Terminal, Console, Search).
Fixes eclipse-platform/eclipse.platform#2774