Skip to main content



      Home
Home » Eclipse Projects » GEF » NPE in DeferredUpdateManager when using SWT_AWT in a modal Dialog
NPE in DeferredUpdateManager when using SWT_AWT in a modal Dialog [message #167716] Thu, 10 February 2005 08:31 Go to next message
Eclipse UserFriend
I use a JFace TitleAreaDialog that contains an embedded AWT-Panel.
The dialog is opened on a specific GEF edit part.
The problem is that some JButton inside triggers a "state changed" event
in my model, which in turn results in a notification of my GEF model -
and this leads to a call to "EditPart#updateVisuals".
This update, however, fails with an NPE - maybe because the modal dialog
is still open ? (see stacktrace below)
Note that I'd got the same problem while using a plain Swing JDialog
instead of the embedded SWT_AWT bridge.

Thanks in advance for your help

greetings
Florian

==========
Here's my stacktrace:
==========
java.lang.NullPointerException
at
org.eclipse.draw2d.DeferredUpdateManager.queueWork(DeferredU pdateManager.java:174)
at
org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(De ferredUpdateManager.java:117)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1301)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1414)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.setLayou tConstraint(AbstractGraphicalEditPart.java:789)
at
de.unikn.hades.modeller.editor.parts.FlowNodeEditPart.refres hVisuals(FlowNodeEditPart.java:134)
at
de.unikn.hades.modeller.editor.parts.WorkflowEditPart.update NodeVisuals(WorkflowEditPart.java:157)
at
de.unikn.hades.modeller.editor.parts.FlowNodeEditPart.stateC hanged(FlowNodeEditPart.java:314)
at de.unikn.hades.node.Node.notifyStateListeners(Node.java:705)
at de.unikn.hades.node.Node.modelOutDataTableSpecChanged(Node.j ava:518)
at
de.unikn.hades.node.NodeModel.fireDataTableSpecChangedEvent( NodeModel.java:687)
at
de.unikn.hades.node.NodeModel.updateOutDataTableSpecs(NodeMo del.java:600)
at de.unikn.hades.node.NodeModel.resetModel(NodeModel.java:347)
at de.unikn.hades.node.NodeModel.loadSettingsFrom(NodeModel.jav a:198)
at de.unikn.hades.node.NodeDialog.onApply(NodeDialog.java:265)
at de.unikn.hades.node.NodeDialog.onOK(NodeDialog.java:244)
at de.unikn.hades.node.NodeDialog$1.actionPerformed(NodeDialog. java:118)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButto n.java:1786)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerform ed(AbstractButton.java:1839)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultBu ttonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel .java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Bas icButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container. java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.j ava:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java: 3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventD ispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis patchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:10 0)
Re: NPE in DeferredUpdateManager when using SWT_AWT in a modal Dialog [message #167757 is a reply to message #167716] Thu, 10 February 2005 11:26 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Draw2d is not thread-safe. All updates must be done on the Display's
thread.

"Florian Georg" <FGeorg@gmx.de> escreveu na mensagem
news:cufnns$cav$1@www.eclipse.org...
>I use a JFace TitleAreaDialog that contains an embedded AWT-Panel.
> The dialog is opened on a specific GEF edit part.
> The problem is that some JButton inside triggers a "state changed" event
> in my model, which in turn results in a notification of my GEF model - and
> this leads to a call to "EditPart#updateVisuals".
> This update, however, fails with an NPE - maybe because the modal dialog
> is still open ? (see stacktrace below)
> Note that I'd got the same problem while using a plain Swing JDialog
> instead of the embedded SWT_AWT bridge.
>
> Thanks in advance for your help
>
> greetings
> Florian
>
> ==========
> Here's my stacktrace:
> ==========
> java.lang.NullPointerException
> at
> org.eclipse.draw2d.DeferredUpdateManager.queueWork(DeferredU pdateManager.java:174)
> at
> org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(De ferredUpdateManager.java:117)
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1301)
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1303)
> at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1414)
> at
> org.eclipse.gef.editparts.AbstractGraphicalEditPart.setLayou tConstraint(AbstractGraphicalEditPart.java:789)
> at
> de.unikn.hades.modeller.editor.parts.FlowNodeEditPart.refres hVisuals(FlowNodeEditPart.java:134)
> at
> de.unikn.hades.modeller.editor.parts.WorkflowEditPart.update NodeVisuals(WorkflowEditPart.java:157)
> at
> de.unikn.hades.modeller.editor.parts.FlowNodeEditPart.stateC hanged(FlowNodeEditPart.java:314)
> at de.unikn.hades.node.Node.notifyStateListeners(Node.java:705)
> at de.unikn.hades.node.Node.modelOutDataTableSpecChanged(Node.j ava:518)
> at
> de.unikn.hades.node.NodeModel.fireDataTableSpecChangedEvent( NodeModel.java:687)
> at
> de.unikn.hades.node.NodeModel.updateOutDataTableSpecs(NodeMo del.java:600)
> at de.unikn.hades.node.NodeModel.resetModel(NodeModel.java:347)
> at de.unikn.hades.node.NodeModel.loadSettingsFrom(NodeModel.jav a:198)
> at de.unikn.hades.node.NodeDialog.onApply(NodeDialog.java:265)
> at de.unikn.hades.node.NodeDialog.onOK(NodeDialog.java:244)
> at de.unikn.hades.node.NodeDialog$1.actionPerformed(NodeDialog. java:118)
> at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButto n.java:1786)
> at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerform ed(AbstractButton.java:1839)
> at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultBu ttonModel.java:420)
> at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel .java:258)
> at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Bas icButtonListener.java:245)
> at java.awt.Component.processMouseEvent(Component.java:5100)
> at java.awt.Component.processEvent(Component.java:4897)
> at java.awt.Container.processEvent(Container.java:1569)
> at java.awt.Component.dispatchEventImpl(Component.java:3615)
> at java.awt.Container.dispatchEventImpl(Container.java:1627)
> at java.awt.Component.dispatchEvent(Component.java:3477)
> at java.awt.LightweightDispatcher.retargetMouseEvent(Container. java:3483)
> at java.awt.LightweightDispatcher.processMouseEvent(Container.j ava:3198)
> at java.awt.LightweightDispatcher.dispatchEvent(Container.java: 3128)
> at java.awt.Container.dispatchEventImpl(Container.java:1613)
> at java.awt.Component.dispatchEvent(Component.java:3477)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
> at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventD ispatchThread.java:201)
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis patchThread.java:151)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:145)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:137)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:10 0)
Previous Topic:Tables with draggable cell constraints
Next Topic:How to get the notification when the figure is moved?
Goto Forum:
  


Current Time: Tue Jun 24 07:11:01 EDT 2025

Powered by FUDForum. Page generated in 0.04325 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top