Hi,
On Thu, Jul 2, 2009 at 6:48 PM, epdv<
peter.nabbefeld@...> wrote:
> Hello!
>
> I want to save the state info of my CloneableTopComponent, but it seems
> neither readExternal nor writeExternal are ever called. Do I have to
> register sth. in layer.xml?
>
> Kind regards
>
You can easily externalize TopComponent using public Object
writeReplace() and also make sure getPersistenceType return
PERSISTENCE_ALWAYS or PERSISTENCE_ONLY_OPENED or something else that
indicate persistence (if any)
For easy skeleton sample, just create new Window using the wizard and
it will create the skeleton for this, and just fill it with you own
custom state that you need to persist.
Based on the skeleton from the new window wizard, you only need to fill
- public Object writeReplace() which call ResolvableHelper below
- and ResolvableHelper.readResolve()
note: it is based on the Nb 6.5.1 new Window wizard
Cheers
Tonny Kohar
--
Sketsa SVG Editor
imagine, design, create ...
http://www.kiyut.com