Discussion:
Save current window layout without closing the NetBeans
johnyghk
2011-01-20 01:35:36 UTC
Permalink
Dear All,

Does Anyone has an idea to save current window layout without closing the NetBeans ,please?

Thanks!!
Geertjan Wielenga
2011-01-21 02:57:43 UTC
Permalink
Post by johnyghk
Dear All,
Does Anyone has an idea to save current window layout without closing the NetBeans ,please?
Thanks!!
When is the save meant to happen?

Gj
Tom Wheeler
2011-01-21 16:27:43 UTC
Permalink
It is possible to do this -- and I know because I wrote the code to do
it once. Since it was for a client, I don't own the code and cannot
provide it.

I can't tell you much, except that it was a challenge (and I had 10+
years of Java experience and several years' experience with NetBeans
Platform at that point). I started here:

http://wiki.netbeans.org/DevFaqWindowsInternals

and wound up reading lots of source code in the NB Window System API
and implementation modules.

Good luck. If you do figure it out, I am sure others would appreciate
you sharing your code or at least updating the FAQ.
Post by johnyghk
Dear All,
Does Anyone has an idea to save current window layout without closing the NetBeans ,please?
Thanks!!
--
Tom Wheeler
http://www.tomwheeler.com/
Christian G.
2011-01-21 12:39:47 UTC
Permalink
that would be interesting. Especially if you have a multi user application. So you could restore a window layout of a certain user upon login and save it upon logoff.
Charles Bedon
2011-01-22 16:10:30 UTC
Permalink
Hello

Actually that's what you get when you make the TopComponents to have a
persistence type ALWAYS/ONLY_OPENED. The question is how to do it on demand.

It's kinda curious that it turns out to be that difficult as Tom points out.
I thought it was something like a loop among the currently opened components
asking them to save the position/window mode properties.
Post by Christian G.
that would be interesting. Especially if you have a multi user application.
So you could restore a window layout of a certain user upon login and save
it upon logoff.
--
Charles Edward Bedón Cortázar
ITIL Foundation Certified
Open Source Network Inventory for the masses!
http://kuwaiba.sourceforge.net | Follow Kuwaiba on
Twitter<http://twitter.com/kuwaiba>
Linux Registered User #386666
johnyghk
2011-01-27 02:20:38 UTC
Permalink
Thanks a lot! I will try to read the material provided by Tom.
One more question, I already study the code "PersistenceManager.java" in NetBeans,this is the code that NetBeans store the window layout in xml files. How can I use this code to save to different directory, Please?
Loading...