Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Drag a part to a part stack in another monitor
Drag a part to a part stack in another monitor [message #1841111] Tue, 04 May 2021 08:41 Go to next message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
We have one Display and several monitors. We have managed to drag parts to new part stacks on another monitor but as far as I see, dragging a part to an existing part stack in another monitor is not supported by the framework (SplitDrogAgent2, ModelServiceImpl), the part will always be wrapped into a stack.

Is there a reason for this limitation or is there another way I don't see to do it without forking the code and implementing it myself?

Thanks,
Günther
Re: Drag a part to a part stack in another monitor [message #1841113 is a reply to message #1841111] Tue, 04 May 2021 09:41 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
When the part is dropped on the tabs space in top of the stack, the part should become part of the same stack. This behavior should be the same as dragging parts in the main window.

When you want to improvement on this behavior, please open a (enhancement) bug on Eclipse Platform UI. Then you could provide a change which is integrated into Eclipse, so that you don't need to fork.
Re: Drag a part to a part stack in another monitor [message #1841156 is a reply to message #1841113] Wed, 05 May 2021 08:04 Go to previous messageGo to next message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
The behaviour you describe is not what I see. A comment in org.eclipse.e4.ui.workbench.addons.dndaddon.SplitDropAgent2.drop() even explicitly says:
// wrap it in a stack if it's a part
and that is what actually happens.
I will try to make my solution waterproof and then provide the change as you propose.
Re: Drag a part to a part stack in another monitor [message #1841157 is a reply to message #1841156] Wed, 05 May 2021 09:23 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
The SplitDropAgent2 will ensure to create a wrapping stack, that is needed for making the split in the IDE to display the part tabs in the tabfolder.

However, when dragging to a tab area of the tabfolder, the org.eclipse.e4.ui.workbench.addons.dndaddon.StackDropAgent will be used. That will add the part to the existing partstack.
The two parts must have the a shared toplevel window though.
Re: Drag a part to a part stack in another monitor [message #1841269 is a reply to message #1841157] Mon, 10 May 2021 14:24 Go to previous messageGo to next message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
Yes, and there's the problem as I found out myself in the meantime. It was obviously originally planned to allow moving a part from one window to an existing part stack in another one, but because of bug 445305 it was disabled. By commenting out

if (!(dragElement instanceof MPart)) {
EModelService ms = dndManager.getModelService();
MWindow dragElementWin = ms.getTopLevelWindowFor(dragElement);
MWindow dropWin = ms.getTopLevelWindowFor(stack);
if (dragElementWin != dropWin)
{
return false;
}
}

I was finally able to reach my goal and it works perfectly without any problems.

Bug 445305 was already fixed in 2015 so I don't think there's still a reason for this and it should be enabled again.
Re: Drag a part to a part stack in another monitor [message #1841270 is a reply to message #1841269] Mon, 10 May 2021 14:42 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
Bug 445305 was a regression from Bug 346009, the latter is about the feature you are requesting. So Bug 445305 was fixed by (partially) reverting the changes for Bug 346009. See Bug 346009 for all features get broken when just uncommenting the code. I expect that still some issues exist.

Also note that there is a difference in moving parts from between 2 main windows, and moving parts to sub-windows, i.e. MApplication.getChildren() vs. MWindow.getWindows()
Re: Drag a part to a part stack in another monitor [message #1841300 is a reply to message #1841270] Tue, 11 May 2021 14:18 Go to previous messageGo to next message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
Thank you for your answer! I had a rough look at Bug 346009 just now and it seems to me that the issues mentioned there are mostly related to editors and the compatibility layer. Is that true? As we have a pure E4-application, does this really concern us? As said, so far I have not recognized any problems.
Re: Drag a part to a part stack in another monitor [message #1841344 is a reply to message #1841300] Wed, 12 May 2021 16:30 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
I can imagine that most issues are related to the compatibility layer. Never tried it on a pure E4-application, so if you don't experience issues you are good to go.
Re: Drag a part to a part stack in another monitor [message #1841345 is a reply to message #1841344] Wed, 12 May 2021 16:33 Go to previous message
Guenther Mahr is currently offline Guenther MahrFriend
Messages: 36
Registered: September 2011
Member
Thank you! I will post it here if we face any problems.
Previous Topic:Database programming, Third party components re-usability
Next Topic:Influence Focus as it was possible with setFocusTraversalPolicy and DefaultKeyboardFocusManager
Goto Forum:
  


Current Time: Thu Apr 25 23:48:39 GMT 2024

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

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

Back to the top