This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 33271
Collapse All | Expand All

(-)LoggerButton.java (-3 / +22 lines)
Lines 36-44 Link Here
36
import org.netbeans.modules.sim.bugsubmitter.ui.ExceptionHandler;
36
import org.netbeans.modules.sim.bugsubmitter.ui.ExceptionHandler;
37
import org.netbeans.modules.sim.bugsubmitter.resources.BugsubmitterWizardAction;
37
import org.netbeans.modules.sim.bugsubmitter.resources.BugsubmitterWizardAction;
38
38
39
import java.awt.EventQueue;
39
import java.awt.event.ActionEvent;
40
import java.awt.event.ActionEvent;
40
import java.util.ResourceBundle;
41
import java.util.ResourceBundle;
41
import javax.swing.JButton;
42
import javax.swing.JButton;
43
import javax.swing.SwingUtilities;
42
import java.beans.PropertyChangeListener;
44
import java.beans.PropertyChangeListener;
43
import java.beans.PropertyChangeEvent;
45
import java.beans.PropertyChangeEvent;
44
46
Lines 62-68 Link Here
62
     *  so that it can be turned on and off.
64
     *  so that it can be turned on and off.
63
     */
65
     */
64
    public static void ensureButtonRegistered() {
66
    public static void ensureButtonRegistered() {
65
	initialize();
67
68
    //if we are on the AWT EDT we don't want to block with invokeAndWait.
69
    if (EventQueue.isDispatchThread()) {
70
        initialize();
71
    } 
72
    else {  // use invokeAndWait to initialize JButton in case of BT 4833969.
73
        try{
74
            SwingUtilities.invokeAndWait(new Runnable() {
75
                public void run() {
76
                   initialize();
77
                }
78
            });
79
        } catch (java.lang.InterruptedException e) {
80
            //deliberately do nothing here
81
        } catch (java.lang.reflect.InvocationTargetException e) {
82
            //deliberately do nothing here
83
        }  
84
    } 
66
	bswa.registerButton(log);
85
	bswa.registerButton(log);
67
    }
86
    }
68
87
Lines 86-96 Link Here
86
    /** Add a "Log report" button to the exception reporting dialog.
105
    /** Add a "Log report" button to the exception reporting dialog.
87
     */
106
     */
88
    public static void addLogButton() {
107
    public static void addLogButton() {
89
        initialize();
90
108
91
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
109
        SwingUtilities.invokeLater(new Runnable() {
92
            public void run() {
110
            public void run() {
93
                try {
111
                try {
112
                    initialize();
94
		    if(log != null)
113
		    if(log != null)
95
			    log.setEnabled(bswa.isEnabled());
114
			    log.setEnabled(bswa.isEnabled());
96
115

Return to bug 33271