|
1 | 1 | /*******************************************************************************
|
2 |
| - * Copyright (c) 2007, 2019 IBM Corporation and others. |
| 2 | + * Copyright (c) 2007, 2023 IBM Corporation and others. |
3 | 3 | *
|
4 | 4 | * This program and the accompanying materials
|
5 | 5 | * are made available under the terms of the Eclipse Public License 2.0
|
@@ -166,6 +166,15 @@ public class ExtendedMarkersView extends ViewPart {
|
166 | 166 |
|
167 | 167 | private Action filterAction;
|
168 | 168 |
|
| 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; |
169 | 178 |
|
170 | 179 | /**
|
171 | 180 | * Tells whether the tree has been painted.
|
@@ -1044,7 +1053,7 @@ public void init(IViewSite site, IMemento m) throws PartInitException {
|
1044 | 1053 | if (m == null || m.getString(TAG_PART_NAME) == null) {
|
1045 | 1054 | return;
|
1046 | 1055 | }
|
1047 |
| - setPartName(m.getString(TAG_PART_NAME)); |
| 1056 | + initializeTitle(m.getString(TAG_PART_NAME)); |
1048 | 1057 | }
|
1049 | 1058 |
|
1050 | 1059 | /**
|
@@ -1084,6 +1093,7 @@ String getViewsSecondaryId() {
|
1084 | 1093 | * @param name
|
1085 | 1094 | */
|
1086 | 1095 | void initializeTitle(String name) {
|
| 1096 | + customPartName = name; |
1087 | 1097 | setPartName(name);
|
1088 | 1098 | }
|
1089 | 1099 |
|
@@ -1234,7 +1244,9 @@ void removeExpandedCategory(MarkerCategory category) {
|
1234 | 1244 | @Override
|
1235 | 1245 | public void saveState(IMemento m) {
|
1236 | 1246 | super.saveState(m);
|
1237 |
| - m.putString(TAG_PART_NAME, getPartName()); |
| 1247 | + if (customPartName != null) { |
| 1248 | + m.putString(TAG_PART_NAME, customPartName); |
| 1249 | + } |
1238 | 1250 | if (generator != null) {
|
1239 | 1251 | m.putString(TAG_GENERATOR, builder.getGenerator().getId());
|
1240 | 1252 | }
|
|
0 commit comments