Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » IMemento vs. IDialogSettings
IMemento vs. IDialogSettings [message #296466] Thu, 22 December 2005 10:29 Go to next message
Eclipse UserFriend
Hi all,
I am currently implementing a view which needs to store some state (Sorter
settings, column width and such stuff).
I found two mechanisms which I could use - the IMemento interface and
IDialogSettings.
Both seem basicly do the same and I can't decide which one to use.

Any hints?

Thanks,
Lars Ködderitzsch
Re: IMemento vs. IDialogSettings [message #296472 is a reply to message #296466] Thu, 22 December 2005 11:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwpeck.mersoft.com

I used IMemento and it seems to do what I expected it to do. From what I
could tell it is the proper one ot use for a View.

Keep in mind that init(iViewSite, IMemento) can send you a NULL memento.
saveState() will not do that. Be sure to check for null though, it will
not be null if you have ever saved the layout but the first time you run
after a clean out of the application it can be null.



Lars Ködderitzsch wrote:
> Hi all,
> I am currently implementing a view which needs to store some state
> (Sorter settings, column width and such stuff).
> I found two mechanisms which I could use - the IMemento interface and
> IDialogSettings.
> Both seem basicly do the same and I can't decide which one to use.
>
> Any hints?
>
> Thanks,
> Lars Ködderitzsch
>
Re: IMemento vs. IDialogSettings [message #296476 is a reply to message #296472] Thu, 22 December 2005 12:09 Go to previous messageGo to next message
Eclipse UserFriend
Kevin,
thank you very much for your answer and your hints!

I'll use IMemento but I don't quite understand why there are 2
"Frameworks" for storing GUI layout data. Must be an historical issue...

Regards,
Lars
Re: IMemento vs. IDialogSettings [message #296496 is a reply to message #296476] Thu, 22 December 2005 16:44 Go to previous message
Eclipse UserFriend
Originally posted by: nick_edgar._no.spam.please_.ca.ibm.com

Simple answer: for view state, use saveState/init; for dialogs, use
dialog settings.

Long answer:

There can be multiple instances of the same view, e.g. in multiple
windows. IViewPart.saveState/init lets you save state that's specific
to that instance. For example, the Navigator view uses this to store
whether linking to the editor is turned on.

The dialog settings mechanism is global, and was intended more to allow
persisting of settings associated with dialogs, like "don't show me this
again", or remembering selections.

Nick


Lars Ködderitzsch wrote:
> Kevin,
> thank you very much for your answer and your hints!
>
> I'll use IMemento but I don't quite understand why there are 2
> "Frameworks" for storing GUI layout data. Must be an historical issue...
>
> Regards,
> Lars
>
Previous Topic:maximize/minimze viewpart
Next Topic:Saving login information
Goto Forum:
  


Current Time: Mon Jul 21 20:04:18 EDT 2025

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

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

Back to the top