| Re: Save reference of input of a Part [message #896810] |
Thu, 19 July 2012 17:45  |
Thomas Schindl Messages: 4462 Registered: July 2009 |
Senior Member |
|
|
All context informations are temporary and not saved (most of them could
be saved at all).
You store informations directly in the MPart associated with your part
by creating something like this in your class
class MyPart {
@Inject
public MyPart(MPart p) {
....
}
@PersistState
void persist(MPart part) {
part.getPersistedState()
}
}
So when you create you part using the handler before showing it I'd also
set the informations instead of using the IEclipseContext.
The other option you have is to create an MInputPart which has a url field.
You better ask e4 questions on the e4 newsgroup.
Tom
Am 19.07.12 18:26, schrieb Valerio Santinelli:
> Hello,
>
> I'm slowly trying to port an existing RCP application to the 4.2
> framework and I can't understand one important thing.
>
> I have a handler that is being called to open a new part. Before showing
> the part, I inject the input needed by that part in the application
> context and then i show the part and it works fine.
>
> I then close the application and reopen it. When the application reopens
> the part that whose state was saved by the workbench, I get an error
> saying that it can't inject the input property because it can't be found
> in the context. How am I supposed to persist it?
> Thanks in advance!
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05186 seconds