Skip to content

Commit

Permalink
Display error message when JavaFX cluster cannot be enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dukescript committed Jun 21, 2020
1 parent 700af67 commit cf2174f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import static java.util.Objects.nonNull;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.GroupLayout;
Expand Down Expand Up @@ -363,18 +364,21 @@ public void run() {
try {
ConfigurationPanel.this.add(callable.call(), BorderLayout.CENTER);
} catch (Exception ex) {
// TODO: add warning panel
Exceptions.attachSeverity(ex, Level.INFO);
Exceptions.printStackTrace(ex);
}
ConfigurationPanel.this.invalidate();
ConfigurationPanel.this.revalidate();
ConfigurationPanel.this.repaint();
if (featureInfo != null && featureInfo.isPresent()) {
msg = NbBundle.getMessage(ConfigurationPanel.class, "MSG_EnableFailed");
} else {
msg = NbBundle.getMessage(ConfigurationPanel.class, "MSG_DownloadFailed");
if (featureInfo != null && !featureInfo.isEnabled()) {
if (featureInfo.isPresent()) {
msg = NbBundle.getMessage(ConfigurationPanel.class, "MSG_EnableFailed");
} else {
msg = NbBundle.getMessage(ConfigurationPanel.class, "MSG_DownloadFailed");
}
progressMonitor.onError(msg);
return;
}
setError(msg);
activateButton.setEnabled(true);
progressPanel.removeAll();
progressPanel.revalidate();
Expand Down Expand Up @@ -435,7 +439,6 @@ public void onError(final String message) {
SwingUtilities.invokeLater(new Runnable() {

public void run() {
// TODO: mark as html
setError("<html>" + message + "</html>"); // NOI18N
progressPanel.removeAll();
progressPanel.add(errorLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ static enum Reason {
IllegalModuleException(Reason reason, Set<Module> bogus) {
this.reason = reason;
this.bogus = bogus;
if (reason == Reason.ENABLE_MISSING) {
throw new AssertionError(this);
}
}

@Override
Expand Down

0 comments on commit cf2174f

Please sign in to comment.