Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Re: Save reference of input of a Part
Re: Save reference of input of a Part [message #896810] Thu, 19 July 2012 21:45 Go to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5468
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!
>
Re: Save reference of input of a Part [message #896854 is a reply to message #896810] Fri, 20 July 2012 07:16 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
Hi Tom,
where is the e4 newsgroup? The link in Eclipsepedia just points back to the forum.
Re: Save reference of input of a Part [message #896860 is a reply to message #896854] Fri, 20 July 2012 07:41 Go to previous messageGo to next message
Valerio Santinelli is currently offline Valerio SantinelliFriend
Messages: 34
Registered: January 2012
Member
There it is:
news://news.eclipse.org/eclipse.e4
Re: Save reference of input of a Part [message #896861 is a reply to message #896854] Fri, 20 July 2012 07:45 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5468
Registered: July 2009
Senior Member
You are already here - this was just a copy over from rcp newsgroup ;-)

Tom

Am 20.07.12 09:16, schrieb Christoph Keimel:
> Hi Tom,
> where is the e4 newsgroup? The link in Eclipsepedia just points back to
> the forum.
Previous Topic:E4 how to layout parts in a perspective
Next Topic:Using ESelectionService.setSelection(null) for DI?
Goto Forum:
  


Current Time: Wed Nov 26 21:51:41 GMT 2014

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

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