You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/08/09 18:07:01 UTC

[GitHub] [netbeans] lkishalmi commented on a diff in pull request #4490: Exception reporter improvments

lkishalmi commented on code in PR #4490:
URL: https://github.com/apache/netbeans/pull/4490#discussion_r941652209


##########
platform/o.n.core/src/org/netbeans/core/NotifyExcPanel.java:
##########
@@ -484,32 +490,41 @@ public void run() {
                 }
             } else {
                 ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
+                String message;
                 if (current.getSeverity() == Level.WARNING) {
                     // less scary message for warning level
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionWarning"),
-                            new Object[] {
-                                current.getClassName ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionWarning"),
+                        new Object[] { current.getClassName() }
                     );
                     title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
                 } else {
-                    // emphasize user-non-friendly exceptions
-                    //      if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
-                    descriptor.setMessage (
-                        java.text.MessageFormat.format(
-                            curBundle.getString("NTF_ExceptionalException"),
-                            new Object[] {
-                                current.getClassName (),
-                                CLIOptions.getLogDir ()
-                            }
-                        )
+                    message = MessageFormat.format(
+                        curBundle.getString("NTF_ExceptionalException"),
+                        new Object[] { current.getClassName(), CLIOptions.getLogDir() }
                     );
-
                     title = curBundle.getString("NTF_ExceptionalExceptionTitle"); // NOI18N
                 }
+                JTextPane pane = new JTextPane();
+                pane.setContentType("text/html"); // NOI18N
+                pane.setText(message);
+                pane.setBackground(UIManager.getColor("Label.background")); // NOI18N
+                pane.setBorder(BorderFactory.createEmptyBorder());
+                pane.setEditable(false);
+                pane.setFocusable(true);
+                pane.addHyperlinkListener((e) -> {
+                    if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
+                        try {
+                            Desktop.getDesktop().browse(e.getURL().toURI());

Review Comment:
   Wouldn't this one open a browser either on "report this" or "this folder"?
   Could we use ```Desktop.getDesktop().open()``` for the later one?



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists