Skip to content

Commit cc03fad

Browse files
committed
Improve wording and icons in the DiscoveryDialog
Currently the DiscoveryDialog shows missing messages with a big red x and a text that says "resolve later", this gives an expression something is generally broken / error. Actually m2e now executes all mojos by default, and even before it shows non executed mojos as warnings. This replaces the error icon with a light-bulb/info icon so the user knows there is something one can take an action on but it is probably not that important to be concerned about (right now), and adjust the text to reflect that if nothing is choose it will just do whatever is choose in the workspace settings.
1 parent 75e4941 commit cc03fad

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed
579 Bytes
Loading
1.44 KB
Loading

org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/MavenImages.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public class MavenImages {
8787

8888
public static final Image IMG_PASSED = createImage("passed.png"); //$NON-NLS-1$
8989

90+
public static final Image IMG_INFO_AUTO = createImage("quick_fix_info_obj.png"); //$NON-NLS-1$
91+
9092
public static final Image IMG_POM = POM.createImage();
9193

9294
public static final Image IMG_ERROR = createImage("error_st_obj.png"); //$NON-NLS-1$

org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public class Messages extends NLS {
129129

130130
public static String LifecycleMappingPage_numErrors;
131131

132-
public static String LifecycleMappingPage_resolveLaterDescription;
132+
public static String LifecycleMappingPage_useDefaultMapping;
133133

134134
public static String LifecycleMappingPage_title;
135135

org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ LifecycleMappingPage_licenseLabel=License
7676
LifecycleMappingPage_mavenBuildColumnTitle=Maven Build
7777
LifecycleMappingPage_noMarketplaceEntryDescription=No marketplace entries found to handle {0} in Eclipse. Please see Help for more information.
7878
LifecycleMappingPage_numErrors={0} errors
79-
LifecycleMappingPage_resolveLaterDescription=Resolve Later
79+
LifecycleMappingPage_useDefaultMapping=Use Workspace Default
8080
LifecycleMappingPage_title=Setup Maven plugin connectors
8181
LifecycleMappingPreferencePage_Browse=Browse...
8282
LifecycleMappingPreferencePage_ChangeLocation=Change mapping file location\:

org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/LifecycleMappingPage.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ protected CellEditor getCellEditor(Object element) {
241241
for(IMavenDiscoveryProposal prop : all) {
242242
values.add(NLS.bind(Messages.LifecycleMappingPage_installDescription, prop.toString()));
243243
}
244-
values.add(Messages.LifecycleMappingPage_resolveLaterDescription);
244+
values.add(Messages.LifecycleMappingPage_useDefaultMapping);
245245

246246
addIgnoreProposals(values, prov);
247247
ComboBoxCellEditor edit = new ComboBoxCellEditor(treeViewer.getTree(),
@@ -390,12 +390,7 @@ public void addListener(ILabelProviderListener listener) {
390390
public String getColumnText(Object element, int columnIndex) {
391391
if(element instanceof ILifecycleMappingLabelProvider prov) {
392392
if(columnIndex == MAVEN_INFO_IDX) {
393-
String text = prov.getMavenText();
394-
if(prov instanceof AggregateMappingLabelProvider aggProv && !isHandled(prov)) {
395-
text = NLS.bind(Messages.LifecycleMappingPage_errorMavenBuild,
396-
new String[] {text, String.valueOf(aggProv.getChildren().length)});
397-
}
398-
return text;
393+
return prov.getMavenText();
399394
} else if(columnIndex == ACTION_INFO_IDX && element instanceof AggregateMappingLabelProvider) {
400395
IMavenDiscoveryProposal proposal = mappingConfiguration.getSelectedProposal(prov.getKey());
401396
if(ignore.contains(element)) {
@@ -409,7 +404,7 @@ public String getColumnText(Object element, int columnIndex) {
409404
} else if(loading || !prov.isError(mappingConfiguration)) {
410405
return EMPTY_STRING;
411406
} else {
412-
return Messages.LifecycleMappingPage_resolveLaterDescription;
407+
return Messages.LifecycleMappingPage_useDefaultMapping;
413408
}
414409
}
415410
}
@@ -423,7 +418,10 @@ public Image getColumnImage(Object element, int columnIndex) {
423418
}
424419
if(element instanceof AggregateMappingLabelProvider prov) {
425420
if(prov.isError(mappingConfiguration) && !isHandled(prov)) {
426-
return MavenImages.IMG_ERROR;
421+
//historically missing mappings where shows as ERROR (therefore the name isError)
422+
//but now m2e execute missing mappings according on user request so this is more an info that
423+
//it is handled automatic and the user can choose to change this
424+
return MavenImages.IMG_INFO_AUTO;
427425
}
428426
return MavenImages.IMG_PASSED;
429427
}

0 commit comments

Comments
 (0)