Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Drag&Drop into an empty MPartStack
Drag&Drop into an empty MPartStack [message #1225792] Mon, 30 December 2013 20:16 Go to next message
Andriy Fomenko is currently offline Andriy FomenkoFriend
Messages: 21
Registered: May 2013
Junior Member
My window layout is divided into a left ("resource") part and a MPartStack on the right, where I want to create a part dynamically in response to Drag&Drop from the tree in left part.

I have no problem placing a Part with an additional View into the MPartStack on the right side and enabling a DropTargetListener there.

The problem I'm trying to solve is to respond to a Drop event when my MPartStack on the right side is empty: in essense, I want to create individual viewers for the resources dragged from the left panel.

My idea was to create an add-on, which would find MPartStack by its ID and would attach a DropTargetListener there, but I can not find how to get a "Control" for the MPartStack I have.

Any suggestions on how to approach this problem a "proper way" ?

Thank you!

[Updated on: Mon, 30 December 2013 20:17]

Report message to a moderator

Re: Drag&Drop into an empty MPartStack [message #1226035 is a reply to message #1225792] Tue, 31 December 2013 13:32 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot CelaFriend
Messages: 597
Registered: December 2010
Senior Member

What does the getWidget method return? there should be a CTabFolder there or somewhere 'near'?
Re: Drag&Drop into an empty MPartStack [message #1226058 is a reply to message #1226035] Tue, 31 December 2013 14:54 Go to previous messageGo to next message
Andriy Fomenko is currently offline Andriy FomenkoFriend
Messages: 21
Registered: May 2013
Junior Member
getWidget() retruns null

this PartStack is empty (it is created in Application.e4xmi file) anf the intent was to populate it with tabs by Drag&Drop from the TreeViewer on the left side.

under debugger, I see that I find a correct MPartStack (it shows PartStackImpl as a instance' class) and I see that its ID is the one I was looking for

based on your reply it looks like I would have to put some kind of placeholder into this MPartStack, wouldn't I ?

Thank you,

Andriy F.
Re: Drag&Drop into an empty MPartStack [message #1226069 is a reply to message #1226058] Tue, 31 December 2013 15:43 Go to previous message
Sopot Cela is currently offline Sopot CelaFriend
Messages: 597
Registered: December 2010
Senior Member

Hm that's strange. Are you sure it is null? Are you checking at the right moment (after it is rendered, not before)?

Try this: create a sample app, with a window which has a part sash container which has an empty part stack. Then add a menu item to the window and in the handler of that menu element search for the MPartStack. By this moment the app window should be visible together with the empty part stack. After you find the part stack set a break point and look for a CTabFolder in the MPartStack fields. I'm almost sure it should be there. It doesn't matter if it's empty. It should be there anyhow.
Previous Topic:Plugin.xml reload
Next Topic:Perspective Bar in e4
Goto Forum:
  


Current Time: Sat Dec 20 13:44:09 GMT 2014

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

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