@@ -99,24 +99,28 @@ public DataSourceCaption(X dataSource) {
99
99
}
100
100
101
101
102
- public void propertyChange (PropertyChangeEvent evt ) {
103
- String propertyName = evt .getPropertyName ();
104
- if (Stateful .PROPERTY_STATE .equals (propertyName )) {
105
- int state = (Integer )evt .getNewValue ();
106
- isAvailable = state == Stateful .STATE_AVAILABLE ;
107
- if (tracksChanges && !isDirty && isAvailable && (Integer )evt .getOldValue () == Stateful .STATE_UNAVAILABLE ) isDirty = true ;
108
- updateAvailable ();
109
- updateCaption ();
110
- } else if (DataSourceDescriptor .PROPERTY_NAME .equals (propertyName )) {
111
- name = (String )evt .getNewValue ();
112
- updateCaption ();
113
- } else if (DataSourceDescriptor .PROPERTY_DESCRIPTION .equals (propertyName )) {
114
- description = (String )evt .getNewValue ();
115
- updateDescription ();
116
- } else if (DataSourceDescriptor .PROPERTY_ICON .equals (propertyName )) {
117
- // Could display datasource icon instead of progress icon
118
- // setIcon(new ImageIcon((Image)evt.getNewValue()));
119
- }
102
+ public void propertyChange (final PropertyChangeEvent evt ) {
103
+ SwingUtilities .invokeLater (new Runnable () {
104
+ public void run () {
105
+ String propertyName = evt .getPropertyName ();
106
+ if (Stateful .PROPERTY_STATE .equals (propertyName )) {
107
+ int state = (Integer )evt .getNewValue ();
108
+ isAvailable = state == Stateful .STATE_AVAILABLE ;
109
+ if (tracksChanges && !isDirty && isAvailable && (Integer )evt .getOldValue () == Stateful .STATE_UNAVAILABLE ) isDirty = true ;
110
+ updateAvailable ();
111
+ updateCaption ();
112
+ } else if (DataSourceDescriptor .PROPERTY_NAME .equals (propertyName )) {
113
+ name = (String )evt .getNewValue ();
114
+ updateCaption ();
115
+ } else if (DataSourceDescriptor .PROPERTY_DESCRIPTION .equals (propertyName )) {
116
+ description = (String )evt .getNewValue ();
117
+ updateDescription ();
118
+ } else if (DataSourceDescriptor .PROPERTY_ICON .equals (propertyName )) {
119
+ // Could display datasource icon instead of progress icon
120
+ // setIcon(new ImageIcon((Image)evt.getNewValue()));
121
+ }
122
+ }
123
+ });
120
124
}
121
125
122
126
@@ -153,8 +157,6 @@ private void updateAvailable() {
153
157
presenter1 .setIcon (new ImageIcon (getClass ().getResource ("/org/graalvm/visualvm/core/ui/resources/idle-icon.png" ))); // NOI18N
154
158
}
155
159
156
- if (!SwingUtilities .isEventDispatchThread ()) Thread .dumpStack ();
157
-
158
160
if (isDirty && !isOpaque ()) {
159
161
JLabel l = new JLabel (NbBundle .getMessage (DataSourceCaption .class , "DataSourceCaption_LBL_Reload" )) { // NOI18N
160
162
public Dimension getMinimumSize () {
0 commit comments