tmysik commented on a change in pull request #2246:
URL: https://github.com/apache/netbeans/pull/2246#discussion_r452861139
##########
File path:
php/php.code.analysis/src/org/netbeans/modules/php/analysis/ui/analyzer/CodingStandardsFixerCustomizerPanel.java
##########
@@ -169,10 +194,35 @@ private void setOptions() {
}
private void setVersion1ComponentsVisible(boolean isVisible) {
- levelLabel.setVisible(isVisible);
- levelComboBox.setVisible(isVisible);
- configLabel.setVisible(isVisible);
- configComboBox.setVisible(isVisible);
+ for (Component component : getVersion1Components()) {
+ component.setVisible(isVisible);
+ }
+ }
+
+ private List<Component> getVersion1Components() {
+ return Arrays.asList(
+ levelLabel,
+ levelComboBox,
+ configLabel,
+ configComboBox
+ );
+ }
+
+ private boolean validateData() {
+ ValidatorCodingStandardsFixerParameter param =
ValidatorCodingStandardsFixerParameter.create(this);
+ ValidationResult result = new AnalysisOptionsValidator()
+ .validateCodingStandardsFixer(param)
+ .getResult();
+ if (result.hasErrors()) {
+ context.setError(result.getErrors().get(0).getMessage());
Review comment:
One day, we could add a method `getFirstError()` (and
`getFirstWarning()`).
----------------------------------------------------------------
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