Skip to content

Commit c9184a6

Browse files
committed
Always show Installable Unit (IU) ID in target editor
Modified StyledBundleLabelProvider to always display the technical ID of Installable Units in the Target Platform Editor's Definition and Content tabs. If a descriptive name exists and differs from the ID, both are shown (Name [ID]), otherwise just the ID is displayed. Fixes #1432
1 parent bc2c838 commit c9184a6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/StyledBundleLabelProvider.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,14 @@ private StyledString getInternalStyledString(Object element) {
193193
} else if (element instanceof IInstallableUnit iu) {
194194
@SuppressWarnings("restriction")
195195
String name = fTranslations.getIUProperty(iu, IInstallableUnit.PROP_NAME);
196-
if (name == null) {
197-
name = iu.getId();
196+
if (name != null && !name.equals(iu.getId())) {
197+
styledString.append(name);
198+
styledString.append(" [", StyledString.DECORATIONS_STYLER); //$NON-NLS-1$
199+
styledString.append(iu.getId(), StyledString.DECORATIONS_STYLER);
200+
styledString.append("]", StyledString.DECORATIONS_STYLER); //$NON-NLS-1$
201+
} else {
202+
styledString.append(iu.getId());
198203
}
199-
styledString.append(name);
200204
styledString.append(' ');
201205
styledString.append(iu.getVersion().toString(), StyledString.QUALIFIER_STYLER);
202206
} else {

0 commit comments

Comments
 (0)