IMemento vs. IDialogSettings [message #296466] |
Thu, 22 December 2005 10:29  |
Eclipse User |
|
|
|
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 #296496 is a reply to message #296476] |
Thu, 22 December 2005 16:44  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.04175 seconds