Skip to content

Commit a71582a

Browse files
ptzieglermickaelistria
authored andcommitted
Only persist then view part name when a custom name has been set
The user can set a custom name when opening a new view. This value has to be persisted when closing the Eclipse, otherwise the view would fall back to its default name. We must only persist the part name when a custom name has been set, in order to prevent saving a translated name.
1 parent f9e80ab commit a71582a

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

bundles/org.eclipse.ui.ide/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Plugin.name
44
Bundle-SymbolicName: org.eclipse.ui.ide; singleton:=true
5-
Bundle-Version: 3.21.100.qualifier
5+
Bundle-Version: 3.21.200.qualifier
66
Bundle-Activator: org.eclipse.ui.internal.ide.IDEWorkbenchPlugin
77
Bundle-ActivationPolicy: lazy
88
Bundle-Vendor: %Plugin.providerName

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2007, 2019 IBM Corporation and others.
2+
* Copyright (c) 2007, 2023 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -166,6 +166,15 @@ public class ExtendedMarkersView extends ViewPart {
166166

167167
private Action filterAction;
168168

169+
/**
170+
* The user can set a custom name when opening a new view. This value has to be
171+
* persisted when closing the Eclipse. Otherwise the view would fall back to its
172+
* default name. We must only persist the part name when a custom name has been
173+
* set in order to prevent saving a translated name.
174+
*
175+
* @see OpenMarkersViewHandler
176+
*/
177+
private String customPartName;
169178

170179
/**
171180
* Tells whether the tree has been painted.
@@ -1044,7 +1053,7 @@ public void init(IViewSite site, IMemento m) throws PartInitException {
10441053
if (m == null || m.getString(TAG_PART_NAME) == null) {
10451054
return;
10461055
}
1047-
setPartName(m.getString(TAG_PART_NAME));
1056+
initializeTitle(m.getString(TAG_PART_NAME));
10481057
}
10491058

10501059
/**
@@ -1084,6 +1093,7 @@ String getViewsSecondaryId() {
10841093
* @param name
10851094
*/
10861095
void initializeTitle(String name) {
1096+
customPartName = name;
10871097
setPartName(name);
10881098
}
10891099

@@ -1234,7 +1244,9 @@ void removeExpandedCategory(MarkerCategory category) {
12341244
@Override
12351245
public void saveState(IMemento m) {
12361246
super.saveState(m);
1237-
m.putString(TAG_PART_NAME, getPartName());
1247+
if (customPartName != null) {
1248+
m.putString(TAG_PART_NAME, customPartName);
1249+
}
12381250
if (generator != null) {
12391251
m.putString(TAG_GENERATOR, builder.getGenerator().getId());
12401252
}

0 commit comments

Comments
 (0)