Community
Participate
Working Groups
Build Identifier: I20110620-1631 I have an Eclipse 3.6 based RCP app that is being uplifted to E4. This app used the IWorkbenchPreferenceConstants.ENABLE_DETACHED_VIEWS preference to disable detached views, but this preference doesn't appear to be read in Eclipse 4.1. I asked a question about this in the forums but got no response. See http://www.eclipse.org/forums/index.php/t/234263/ I think this would be an easy to fix with a simple patch to the DnDAddon to read a property that could be configured in the application e4xmi. That doesn't directly address the problem of the old ENABLE_DETACHED_VIEWS preference not being honored but it provides a workaround that would be suitable at least for my own needs. I assume it may be suitable for others as well. I will attach an example patch shortly. If there is a better way to do it I am happy to hear that as well. Reproducible: Always
I'm wondering would it be possible for you to just not include the addon in your RCP application?
Created attachment 203094 [details] patch with an example of how this issue might be fixed
I don't want to disallow drag and drop altogether. I just don't want dropping things off into detached windows.
I suggest adding a new tag for MPart, following the example of "NoMove", and calling it "NoDetach" for example. Perhaps it will be enough to change the method org.eclipse.e4.ui.workbench.addons.dndaddon.DetaghedDropAgent.canDrop (): @override public boolean canDrop (MUIElement dragElement, DnDInfo info) { if (info.curElement! = null) { return false; } if (dragElement instanceof MPart || dragElement instanceof MPlaceholder || dragElement instanceof MPartStack) { <b>return! dragElement.getTags (). contains ("NoDetach");</b> } return false; }
(In reply to Alex Say from comment #4) > I suggest adding a new tag for MPart, following the example of "NoMove", and > calling it "NoDetach" for example. Perhaps it will be enough to change the Please push a good patch to Gerrit.
Created attachment 271901 [details] fix bug through adding tag
(In reply to Alex Say from comment #6) > Created attachment 271901 [details] > fix bug through adding tag Please use Gerrit for patches, see https://wiki.eclipse.org/Platform_UI/How_to_Contribute
New Gerrit change created: https://git.eclipse.org/r/113462
Gerrit change https://git.eclipse.org/r/113462 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d5d9eddcf470b6c5ef30dfb7d5694bcb4b9e5e7c
Good patch merged. Thank you very much for your contribution Alex!
New Gerrit change created: https://git.eclipse.org/r/116766
Gerrit change https://git.eclipse.org/r/116766 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=545fdb70afdc5660d658c92c2f7692852f6c99e0
(In reply to Eclipse Genie from comment #12) > Gerrit change https://git.eclipse.org/r/116766 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=545fdb70afdc5660d658c92c2f7692852f6c99e0 Fixed the API tools error due to missing @since tag.
Does this just address *dragging* a part out of the workbench? Or does it also address the "Detach" context menu item on parts?
it seems that the context menu would not be fixed by that for me