Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to restore all editors after restart?
How to restore all editors after restart? [message #462687] Wed, 31 January 2007 16:08 Go to next message
Eclipse UserFriend
Originally posted by: Henry.Grippa.googlemail.com

I have provided my own editor (which is extended AbstractTextEditor) but
it doesn't restore after application restart.
Could anyone please tell me how to do this?

Regards,
Henry
Re: How to restore all editors after restart? [message #462690 is a reply to message #462687] Wed, 31 January 2007 19:25 Go to previous messageGo to next message
Snjezana Peco is currently offline Snjezana PecoFriend
Messages: 789
Registered: July 2009
Senior Member
Your editor input has to implement IPersistableElement.
FileEditorInput can serve as an example.

Snjeza

Henry Grippa wrote:
> I have provided my own editor (which is extended AbstractTextEditor) but
> it doesn't restore after application restart.
> Could anyone please tell me how to do this?
>
> Regards,
> Henry
Re: How to restore all editors after restart? [message #462751 is a reply to message #462690] Wed, 31 January 2007 19:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Henry.Grippa.googlemail.com

You mean that if I will implement IPersistableElement the editors will
restore automatically?

Snjezana Peco wrote:
> Your editor input has to implement IPersistableElement.
> FileEditorInput can serve as an example.
>
> Snjeza
>
> Henry Grippa wrote:
>> I have provided my own editor (which is extended AbstractTextEditor)
>> but it doesn't restore after application restart.
>> Could anyone please tell me how to do this?
>>
>> Regards,
>> Henry
Re: How to restore all editors after restart? [message #462754 is a reply to message #462751] Wed, 31 January 2007 20:20 Go to previous messageGo to next message
Snjezana Peco is currently offline Snjezana PecoFriend
Messages: 789
Registered: July 2009
Senior Member
Yes, if you implement IPersistableElement correctly.
You should pay attention to the following:
FileEditorInput.getFactoryId()
FileEditorInput.saveState()
FileEditorInputFactory.createElement()

Look at EditorReference.getEditorInput() in order to see how Eclipse
restores the editor input.

Snjeza

Henry Grippa wrote:
> You mean that if I will implement IPersistableElement the editors will
> restore automatically?
>
> Snjezana Peco wrote:
>> Your editor input has to implement IPersistableElement.
>> FileEditorInput can serve as an example.
>>
>> Snjeza
>>
>> Henry Grippa wrote:
>>> I have provided my own editor (which is extended AbstractTextEditor)
>>> but it doesn't restore after application restart.
>>> Could anyone please tell me how to do this?
>>>
>>> Regards,
>>> Henry
Re: How to restore all editors after restart? [message #462756 is a reply to message #462754] Wed, 31 January 2007 20:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Henry.Grippa.googlemail.com

I have done all of these. I have also registered my factory with
"org.eclipse.ui.elementFactories" extension point.
But it doesn't work

Snjezana Peco wrote:
> Yes, if you implement IPersistableElement correctly.
> You should pay attention to the following:
> FileEditorInput.getFactoryId()
> FileEditorInput.saveState()
> FileEditorInputFactory.createElement()
>
> Look at EditorReference.getEditorInput() in order to see how Eclipse
> restores the editor input.
>
> Snjeza
>
> Henry Grippa wrote:
>> You mean that if I will implement IPersistableElement the editors
>> will restore automatically?
>>
>> Snjezana Peco wrote:
>>> Your editor input has to implement IPersistableElement.
>>> FileEditorInput can serve as an example.
>>>
>>> Snjeza
>>>
>>> Henry Grippa wrote:
>>>> I have provided my own editor (which is extended
>>>> AbstractTextEditor) but it doesn't restore after application restart.
>>>> Could anyone please tell me how to do this?
>>>>
>>>> Regards,
>>>> Henry
Re: How to restore all editors after restart? [message #462760 is a reply to message #462754] Wed, 31 January 2007 21:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Henry.Grippa.googlemail.com

Thank you very much.
It works.
I have found my bug - I didn't implement getPersistable() correctly.


Snjezana Peco wrote:
> Yes, if you implement IPersistableElement correctly.
> You should pay attention to the following:
> FileEditorInput.getFactoryId()
> FileEditorInput.saveState()
> FileEditorInputFactory.createElement()
>
> Look at EditorReference.getEditorInput() in order to see how Eclipse
> restores the editor input.
>
> Snjeza
>
> Henry Grippa wrote:
>> You mean that if I will implement IPersistableElement the editors
>> will restore automatically?
>>
>> Snjezana Peco wrote:
>>> Your editor input has to implement IPersistableElement.
>>> FileEditorInput can serve as an example.
>>>
>>> Snjeza
>>>
>>> Henry Grippa wrote:
>>>> I have provided my own editor (which is extended
>>>> AbstractTextEditor) but it doesn't restore after application restart.
>>>> Could anyone please tell me how to do this?
>>>>
>>>> Regards,
>>>> Henry
Re: How to restore all editors after restart? [message #462762 is a reply to message #462756] Wed, 31 January 2007 21:36 Go to previous messageGo to next message
Snjezana Peco is currently offline Snjezana PecoFriend
Messages: 789
Registered: July 2009
Senior Member
This is a standard way to restore the editor state in Eclipse.
You have to save all data that are necessary to restore your editor
input in YourEditorInput.saveState()
FileEditorInput.getFactoryId() has to return ID of your factory.
The YourEditorInputFactory.createElement() method should return your
restored editor input.

Snjeza

Henry Grippa wrote:
> I have done all of these. I have also registered my factory with
> "org.eclipse.ui.elementFactories" extension point.
> But it doesn't work
>
> Snjezana Peco wrote:
>> Yes, if you implement IPersistableElement correctly.
>> You should pay attention to the following:
>> FileEditorInput.getFactoryId()
>> FileEditorInput.saveState()
>> FileEditorInputFactory.createElement()
>>
>> Look at EditorReference.getEditorInput() in order to see how Eclipse
>> restores the editor input.
>>
>> Snjeza
>>
>> Henry Grippa wrote:
>>> You mean that if I will implement IPersistableElement the editors
>>> will restore automatically?
>>>
>>> Snjezana Peco wrote:
>>>> Your editor input has to implement IPersistableElement.
>>>> FileEditorInput can serve as an example.
>>>>
>>>> Snjeza
>>>>
>>>> Henry Grippa wrote:
>>>>> I have provided my own editor (which is extended
>>>>> AbstractTextEditor) but it doesn't restore after application restart.
>>>>> Could anyone please tell me how to do this?
>>>>>
>>>>> Regards,
>>>>> Henry
Re: How to restore all editors after restart? [message #462770 is a reply to message #462687] Thu, 01 February 2007 00:08 Go to previous message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
Glad you got it worked out; for future reference, this thread might be useful:

[HowTo] write an RCP editor whose EditorHistory will be saved

Paul
Previous Topic:RCP treeviewer
Next Topic:Plugin dependency
Goto Forum:
  


Current Time: Sat Sep 14 10:53:32 GMT 2024

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

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

Back to the top