Share

MyDoggy - My Java Docking Framework

Tracker: Bugs

5 setHideRepresentativeButtonOnVisible causes NPE - ID: 2874798
Last Update: Comment added ( adecaro )

Bug occured on the latest trunk. There is a regression with
setHideRepresentativeButtonOnVisible feature: if set as true causes null
pointer exceptions.

Reproducing: In MyDoggySet add
dockedTypeDescriptor.setHideRepresentativeButtonOnVisible(true); for the
first tool (near line 270)

After starting demo set, if you click on tool1 you will see stacktrace:
Exception in thread "AWT-EventQueue-0"
java.lang.NullPointerException
at
org.noos.xing.mydoggy.plaf.ui.look.ToolWindowRepresentativeAnchorUI$ToolWin
dowRepresentativeAnchorMouseAdapter.mouseClicked(ToolWindowRepresentativeAn
chorUI.java:448)
at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:252)
at java.awt.Component.processMouseEvent(Component.java:6266)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.jav
a:269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:1
84)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav
a:174)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "AWT-EventQueue-0"
java.lang.NullPointerException
at
org.noos.xing.mydoggy.plaf.ui.look.ToolWindowRepresentativeAnchorUI$ToolWin
dowRepresentativeAnchorMouseAdapter$1.run(ToolWindowRepresentativeAnchorUI.
java:435)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.jav
a:269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:1
84)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav
a:174)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

The reason of it is calling uninstallUI() which dropping references to
components before all pending actions are finished.


Vyacheslav Rusakov ( xvik ) - 2009-10-08 15:38

5

Open

None

Angelo De Caro

None

None

Public


Comments ( 6 )




Date: 2009-12-12 09:53
Sender: adecaroProject Admin

Fixed. Thanks for the useful feedback. :)

./angelo


Date: 2009-12-11 20:13
Sender: xvik

Hello Angelo,

With little modifications in my code everything works fine. Thank you.

But, just for your information.. it is possible to make an error. Here is
an example (sorry, don't know how to attach file here):
I took TutorialSet3.java and modify it a little:

86: ToolWindow debugTool = toolWindowManager.getToolWindow("Debug");
87: debugTool.setVisible(true); // added line

111: dockedTypeDescriptor.setAnimating(true);
112: dockedTypeDescriptor.setHideRepresentativeButtonOnVisible(true); //
added line

Try to launch modified demo and you will see ether unstable work or at
least non hidden left bar.


Date: 2009-12-08 18:48
Sender: adecaroProject Admin

Hi xvik,
I think to have fixed the bug. Please checkout the latest head and execute
your test-case.

Best,
./angelo



Date: 2009-12-08 13:33
Sender: xvik

Hello Angelo,

You closed ticked, but what about behavior change described in comment
before?


Date: 2009-11-01 21:50
Sender: xvik

Hello Angelo,

Thank you for fix!

Auto hiding is working now, but with a little note:
code dockedTypeDescriptor.setHideRepresentativeButtonOnVisible(true);
must be called BEFORE toolWindow.setVisible true
(the use case is to set tool window active by default)

if dockedTypeDescriptor.setHideRepresentativeButtonOnVisible(true); is
called AFTER tool activation, tool's tab area is never hided

I can ensure you that on earlier mydoggy versions sequence
(toolWindow.setVisible true;
dockedTypeDescriptor.setHideRepresentativeButtonOnVisible(true);) was
working normally (can't tell you exact working revision, but it's near the
change that cause original bug)

I consider its a bug too.


Date: 2009-10-22 18:37
Sender: adecaroProject Admin

Hi Vyacheslav,
I apologize for the tardiness of this answer. Anyway, I think I have
resolved the problem.

Thanks for the feedback,
--angelo


Log in to comment.




Attached File

No Files Currently Attached

Changes ( 7 )

Field Old Value Date By
status_id Closed 2009-12-11 20:14 xvik
close_date 2009-12-06 18:06 2009-12-08 18:48 adecaro
status_id Open 2009-12-08 18:48 adecaro
status_id Closed 2009-12-08 13:33 xvik
close_date - 2009-12-06 18:06 adecaro
status_id Open 2009-12-06 18:06 adecaro
assigned_to nobody 2009-10-22 18:37 adecaro