sdedic commented on a change in pull request #2070:
URL: https://github.com/apache/netbeans/pull/2070#discussion_r417562733
##########
File path:
ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/ConfigurationPanel.java
##########
@@ -190,6 +180,40 @@ public void setInfo(FeatureInfo info, String displayName,
Collection<UpdateEleme
org.openide.awt.Mnemonics.setLocalizedText(downloadButton,
btnDownloadMsg);
}
}
+
+ /**
+ * Collect extra modules texts
+ */
+ protected List<String>
collectExtraModulesTextsFromFeatures(Collection<FeatureInfo> features, boolean
required) {
+ List<String> descriptionsList = new ArrayList<>();
+ for (FeatureInfo fi : features) {
+ String s = required ? fi.getExtraModulesRequiredText():
fi.getExtraModulesRecommendedText();
+ if (!descriptionsList.contains(s)) {
Review comment:
The original code contained a null check here, is it unnecessary ?
##########
File path:
ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/ConfigurationPanel.java
##########
@@ -190,6 +180,40 @@ public void setInfo(FeatureInfo info, String displayName,
Collection<UpdateEleme
org.openide.awt.Mnemonics.setLocalizedText(downloadButton,
btnDownloadMsg);
}
}
+
+ /**
+ * Collect extra modules texts
+ */
+ protected List<String>
collectExtraModulesTextsFromFeatures(Collection<FeatureInfo> features, boolean
required) {
+ List<String> descriptionsList = new ArrayList<>();
+ for (FeatureInfo fi : features) {
+ String s = required ? fi.getExtraModulesRequiredText():
fi.getExtraModulesRecommendedText();
+ if (!descriptionsList.contains(s)) {
+ descriptionsList.add(s);
+ }
+ }
+ return descriptionsList;
+ }
+
+ /**
+ * Generate download message from extra modules texts
+ * @param extraModulesTexts
+ * @return String Text to set in download label
+ */
+ protected String generateDownloadMessageFromExtraModulesTexts(List<String>
extraModulesTexts) {
+ StringBuilder sbDownload = new StringBuilder();
Review comment:
A suggestion: these two functions
(`collectExtraModulesTextsFromFeatures` and
`generateDownloadMessageFromExtraModulesTexts`) are called in a sequence: you
could merge it, producing the String for the label - and you could eventually
print the *required* texts in Bold into the string ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists