Skip to main content


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: 24
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
Eclipse UserFriend
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: 24
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
Eclipse UserFriend
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:Acces items created in XML in widget using RemoteViews
Goto Forum:
  


Current Time: Thu Apr 25 19:08:28 GMT 2024

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

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

Back to the top