|
48 | 48 | import org.eclipse.e4.ui.internal.workbench.renderers.swt.SWTRenderersMessages; |
49 | 49 | import org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer; |
50 | 50 | import org.eclipse.e4.ui.internal.workbench.swt.CSSConstants; |
51 | | -import org.eclipse.e4.ui.model.application.ui.MDirtyable; |
52 | 51 | import org.eclipse.e4.ui.model.application.ui.MElementContainer; |
53 | 52 | import org.eclipse.e4.ui.model.application.ui.MUIElement; |
54 | | -import org.eclipse.e4.ui.model.application.ui.MUILabel; |
55 | 53 | import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective; |
56 | 54 | import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder; |
57 | 55 | import org.eclipse.e4.ui.model.application.ui.basic.MCompositePart; |
@@ -643,10 +641,11 @@ protected void updateTab(CTabItem cti, MPart part, String attName, Object newVal |
643 | 641 | case UIEvents.UILabel.LABEL: |
644 | 642 | case UIEvents.UILabel.LOCALIZED_LABEL: |
645 | 643 | String newName = (String) newValue; |
646 | | - cti.setText(getLabel(part, newName)); |
| 644 | + cti.setText(getLabel(newName)); |
647 | 645 | break; |
648 | 646 | case UIEvents.Dirtyable.DIRTY: |
649 | | - cti.setText(getLabel(part, part.getLocalizedLabel())); |
| 647 | + cti.setText(getLabel(part.getLocalizedLabel())); |
| 648 | + cti.setShowDirty(part.isDirty()); |
650 | 649 | break; |
651 | 650 | case UIEvents.UILabel.ICONURI: |
652 | 651 | changePartTabImage(part, cti); |
@@ -676,16 +675,12 @@ public void contextDisposed() { |
676 | 675 | super.contextDisposed(eventBroker); |
677 | 676 | } |
678 | 677 |
|
679 | | - private String getLabel(MUILabel itemPart, String newName) { |
| 678 | + private String getLabel(String newName) { |
680 | 679 | if (newName == null) { |
681 | 680 | newName = ""; //$NON-NLS-1$ |
682 | 681 | } else { |
683 | 682 | newName = LegacyActionTools.escapeMnemonics(newName); |
684 | 683 | } |
685 | | - |
686 | | - if (itemPart instanceof MDirtyable && ((MDirtyable) itemPart).isDirty()) { |
687 | | - newName = '*' + newName; |
688 | | - } |
689 | 684 | return newName; |
690 | 685 | } |
691 | 686 |
|
@@ -976,7 +971,7 @@ else if (element instanceof MPlaceholder) { |
976 | 971 | tabItem = new CTabItem(tabFolder, createFlags, index); |
977 | 972 |
|
978 | 973 | tabItem.setData(OWNING_ME, element); |
979 | | - tabItem.setText(getLabel(part, part.getLocalizedLabel())); |
| 974 | + tabItem.setText(getLabel(part.getLocalizedLabel())); |
980 | 975 | tabItem.setImage(getImage(part)); |
981 | 976 |
|
982 | 977 | String toolTip = getToolTip(part); |
|
0 commit comments