Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Set the input on a part at runtime
Set the input on a part at runtime [message #1710414] Tue, 06 October 2015 13:34 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 30
Registered: January 2015
Member
Hi there,

I try to fine the right way to dynamically open parts with input.
following this snippet
http://wiki.eclipse.org/E4/Snippets#Set_the_input_on_a_part_at_runtime

looks rather easy; However, the snippet seems explicitly outdated as it
states itself

"Update: Declaration of variable in Application.e4xmi not neccessary,
anymore (see
http://www.eclipse.org/forums/index.php?t=msg&&th=161887&goto=511703)."
and
"Note: we don't use this facility anymore"

The mentioned forum post is not really clear to me. What facility is not
used anymore? How to work with the variable if it is not declared anywhere?

Can anyone post an updated example?

Cheers,
Hauke
Re: Set the input on a part at runtime [message #1710416 is a reply to message #1710414] Tue, 06 October 2015 13:48 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6566
Registered: July 2009
Senior Member
IMHO the snippet is missleading (looks like I have not looked at it when
Jens posted it).

Let's start from a different angle. What are you trying to solve? You
want to point your MPart towards an input which most likely can be
expressed as an URL?

When setting input you always need to keep the save/restore use case in
mind - if you happen to be at EclipseCon Europe 2015 I'll show how one
can write editors (in fact full blown IDEs) on pure e4 technologies but
in essence what you really need is:

* some have your content store on the MPart (most likely an entry in
the persitedState map eg with an URL)

* your Part-Pojo needs

@PostConstruct
public void init(Composite parent, MyContentObject o) {
// ....
}

* a IContextFunction who works for MyContentObject, reads the
information from MPart#persistedState and creates your content object
from it

Once more if you are at EclipseCon Europe where I'll introduce a set of
APIs you can consume to write editors this might get your started faster
but I don't really know what you want to achieve so maybe this useless
for you.

Tom


On 06.10.15 15:34, Hauke Fuhrmann wrote:
> Hi there,
>
> I try to fine the right way to dynamically open parts with input.
> following this snippet
> http://wiki.eclipse.org/E4/Snippets#Set_the_input_on_a_part_at_runtime
>
> looks rather easy; However, the snippet seems explicitly outdated as it
> states itself
>
> "Update: Declaration of variable in Application.e4xmi not neccessary,
> anymore (see
> http://www.eclipse.org/forums/index.php?t=msg&&th=161887&goto=511703)."
> and
> "Note: we don't use this facility anymore"
>
> The mentioned forum post is not really clear to me. What facility is not
> used anymore? How to work with the variable if it is not declared anywhere?
>
> Can anyone post an updated example?
>
> Cheers,
> Hauke
Previous Topic:Custom CSS parsing
Next Topic:inject ComponentFactory
Goto Forum:
  


Current Time: Mon Sep 28 07:08:30 GMT 2020

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

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

Back to the top