Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » using IPersistableElement
using IPersistableElement [message #462990] Fri, 02 February 2007 21:45 Go to next message
Eclipse UserFriend
Originally posted by: tcmsimoes.criticalsoftware.com

I am having some problems using the IPersistableElement interface.

I am using it for one of my classes which i would to save its state after
the workbench shutdowns. I just implemented the interface in that class and
created an IElementFactory for it (and the correspondent extension point).
However the saveState, getFactoryID, createElement methods are never called.

What ami i missing? does the IPersistableElement interface only work for
editors or special page inputs that the workbench knows or do i need to
register my object somewhere for the workbench know that it is persistable?

Thanks
Tiago
Re: using IPersistableElement [message #462996 is a reply to message #462990] Fri, 02 February 2007 22:59 Go to previous messageGo to next message
Snjezana Peco is currently offline Snjezana PecoFriend
Messages: 789
Registered: July 2009
Senior Member
You have to call saveState after the workbench stops running (you can
register the workbench listener, for instance) and restoreState when
restoring your object.

Snjeza

Tiago Simões wrote:
> I am having some problems using the IPersistableElement interface.
>
> I am using it for one of my classes which i would to save its state after
> the workbench shutdowns. I just implemented the interface in that class and
> created an IElementFactory for it (and the correspondent extension point).
> However the saveState, getFactoryID, createElement methods are never called.
>
> What ami i missing? does the IPersistableElement interface only work for
> editors or special page inputs that the workbench knows or do i need to
> register my object somewhere for the workbench know that it is persistable?
>
> Thanks
> Tiago
>
>
Re: using IPersistableElement [message #463014 is a reply to message #462996] Sat, 03 February 2007 23:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tcmsimoes.criticalsoftware.com

Thanks Snjeza.

I see your point, however how can i get the memento from the workbench to
use for the IPersistableElement interface methods?


"Snjezana Peco" <snjeza.peco@gmail.com> wrote in message
news:eq0fp3$g0u$1@utils.eclipse.org...
> You have to call saveState after the workbench stops running (you can
> register the workbench listener, for instance) and restoreState when
> restoring your object.
>
> Snjeza
>
> Tiago Sim
Re: using IPersistableElement [message #463016 is a reply to message #463014] Sat, 03 February 2007 23:29 Go to previous message
Snjezana Peco is currently offline Snjezana PecoFriend
Messages: 789
Registered: July 2009
Senior Member
There is the ready API for views and editors (the saveState and init
methods).
If you want to use the Memento pattern for your classes, you have to
implement the IMemento interface.
See org.eclipse.ui.XMLMemento for details.

Snjeza

Tiago Simões wrote:
> Thanks Snjeza.
>
> I see your point, however how can i get the memento from the workbench to
> use for the IPersistableElement interface methods?
>
>
> "Snjezana Peco" <snjeza.peco@gmail.com> wrote in message
> news:eq0fp3$g0u$1@utils.eclipse.org...
>> You have to call saveState after the workbench stops running (you can
>> register the workbench listener, for instance) and restoreState when
>> restoring your object.
>>
>> Snjeza
>>
>> Tiago Simões wrote:
>>> I am having some problems using the IPersistableElement interface.
>>>
>>> I am using it for one of my classes which i would to save its state after
>>> the workbench shutdowns. I just implemented the interface in that class
>>> and created an IElementFactory for it (and the correspondent extension
>>> point). However the saveState, getFactoryID, createElement methods are
>>> never called.
>>>
>>> What ami i missing? does the IPersistableElement interface only work for
>>> editors or special page inputs that the workbench knows or do i need to
>>> register my object somewhere for the workbench know that it is
>>> persistable?
>>>
>>> Thanks
>>> Tiago
>
>
Previous Topic:org.eclipse.ui.forms does not get exported
Next Topic:Changing the perspective bar look and location
Goto Forum:
  


Current Time: Sat Oct 05 16:12:20 GMT 2024

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

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

Back to the top