Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to add a new view with a fragment
How to add a new view with a fragment [message #1005156] Thu, 24 January 2013 15:08 Go to next message
Eclipse UserFriend
I cannot find a tutorial on how to add a new view with a fragment. Is it
right to select org.eclipse.e4.legacy.ide.application as Element Id for
the fragment and children as feature name? What to do next? I get an
exception if I then just want to add a Part ass a child for this fragment.

best regards,
Gilbert
Re: How to add a new view with a fragment [message #1005195 is a reply to message #1005156] Thu, 24 January 2013 16:08 Go to previous messageGo to next message
Jan Weidauer is currently offline Jan WeidauerFriend
Messages: 49
Registered: July 2009
Member
Am 24.01.2013 16:08, schrieb Gilbert Mirenque:
> I cannot find a tutorial on how to add a new view with a fragment. Is it
> right to select org.eclipse.e4.legacy.ide.application as Element Id for
> the fragment and children as feature name? What to do next? I get an
> exception if I then just want to add a Part ass a child for this fragment.
>
> best regards,
> Gilbert
>
Re: How to add a new view with a fragment [message #1005218 is a reply to message #1005195] Thu, 24 January 2013 16:56 Go to previous messageGo to next message
Eclipse UserFriend
What do you want to say with that quote?
Re: How to add a new view with a fragment [message #1005371 is a reply to message #1005218] Fri, 25 January 2013 07:17 Go to previous messageGo to next message
Jan Weidauer is currently offline Jan WeidauerFriend
Messages: 49
Registered: July 2009
Member
Sorry, problems with my mailing program.

What I wanted to say was that in my RCP application I added a part stack
and took the id of this part stack as element id of the fragment in my
contribution fragment. There I defined a part and that worked well.
I think you have to define a container where to put parts in.

Greets,

Jan
Re: How to add a new view with a fragment [message #1005395 is a reply to message #1005371] Fri, 25 January 2013 08:57 Go to previous messageGo to next message
Eclipse UserFriend
Ok, it didn't work. I get the exception that a PartStack cannot be added
to a MWindow. In my fragment I used the feature "children" of the
application and added a PartStack and a Part into it. No success
Other ideas?

best regards,
Gilbert

Jan Weidauer wrote:
> Sorry, problems with my mailing program.
>
> What I wanted to say was that in my RCP application I added a part stack
> and took the id of this part stack as element id of the fragment in my
> contribution fragment. There I defined a part and that worked well.
> I think you have to define a container where to put parts in.
>
> Greets,
>
> Jan
>
Re: How to add a new view with a fragment [message #1005407 is a reply to message #1005395] Fri, 25 January 2013 09:51 Go to previous messageGo to next message
Jan Weidauer is currently offline Jan WeidauerFriend
Messages: 49
Registered: July 2009
Member
Try this in application.e4xmi:
- add Window (Trimmed Window)
- under Controls add PartSashContainer with any id (i.e.
de.test.partsashcontainer)
- in the fragment e4xmi of your contribution plugin add a model fragment
with element id of the partsashcontainer (i.e.
de.test.partsashcontainer) and the featurename 'children'
- there add a part

That's all. I set up an example and it worked.

Jan
Re: How to add a new view with a fragment [message #1005409 is a reply to message #1005407] Fri, 25 January 2013 10:06 Go to previous messageGo to next message
Eclipse UserFriend
Well, I don't have an application.e4xmi because I don't have an RCP
application but want to extend the normal application model from the
Eclipse IDE. Isn't this possible?
Re: How to add a new view with a fragment [message #1005439 is a reply to message #1005409] Fri, 25 January 2013 12:59 Go to previous message
Eclipse UserFriend
The "children" feature of a window is a structured graph (a tree) of items to be rendered. You can't just add an MPartStack and expect it to be rendered correctly. Install the Application Model Editor from the Eclipse Marketplace (oops, I never updated it for 4.2.1) and use the live editor to examine an existing window.

Extending the model within Eclipse RCP is not for the faint of heart primarily because adding a view or editor requires some special setup to be properly rendered by the compatibility layer.

Brian.
Previous Topic:In Eclipse 4.2, CTabFolder API not working same as Eclipse 3.7
Next Topic:application model changes via fragment at startup
Goto Forum:
  


Current Time: Thu Mar 28 23:25:05 GMT 2024

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

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

Back to the top