Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Add MPart in all MPerspective in eclipse Juno(Add MPart in all MPerspective in eclipse Juno)
Add MPart in all MPerspective in eclipse Juno [message #1011716] Wed, 20 February 2013 05:42
Sumit Singh is currently offline Sumit SinghFriend
Messages: 141
Registered: October 2012
Location: Bangalore
Senior Member

I'm creating one RCP in Eclipse 4.2. In my RCP I have 3 perspective.
I'm creating one part at run-time and adding it in perspective like following.
@Inject
EPartService partService;
@Inject
MApplication application;

...
Mpart part = .... ;

...

List<MPartStack> stacks = modelService.findElements(application, null, MPartStack.class, null);
stacks.get(0).getChildren().add(part);
partService.showPart(part, PartState.ACTIVATE);
		


But the problem is its added view in current opened perspective so if you switch perspective to other this view will not be shown there which is correct because i'm just add it to 1st stack.
But My requirement is it should be added in every perspective so if i switch to other perspective it should be there.

I'm getting List of MPerspective like following:
MWindow l = application.getChildren().get(0);
MPerspectiveStack stack = (MPerspectiveStack) l.getChildren().get(0);
List<MPerspective> perspectiveList = stack.getChildren();
		


But don't know how to add it.

So how to add Part in each perspective.?
And is there is better way to find Perspective list apart from what i'm doing.

Thanks,
Sumit
Previous Topic:Adding new Content Types at runtime or modifying extensions of existing ContentTypes
Next Topic:Why I export the product , but the exe can not run?
Goto Forum:
  


Current Time: Sun Aug 20 08:18:55 GMT 2017

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

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