Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 87211 - [PresentationAPI] standalone + movable stacks should remain standalone when dragged
Summary: [PresentationAPI] standalone + movable stacks should remain standalone when d...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-05 13:36 EST by Chris Gross CLA
Modified: 2005-10-05 11:54 EDT (History)
4 users (show)

See Also:


Attachments
patch to fix both issues here (2.32 KB, patch)
2005-05-26 04:09 EDT, Rob Hughes CLA
no flags Details | Diff
Test that drags a standalone view onto a standalone view (6.54 KB, patch)
2005-09-06 11:16 EDT, Paul Webster CLA
no flags Details | Diff
Slightly updated patch for submission to 3.1.1 (2.25 KB, patch)
2005-09-06 11:17 EDT, Paul Webster CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Gross CLA 2005-03-05 13:36:02 EST
The dragOver() method for a custom presentation is not called when an entire 
stack (i.e. ViewStack) is being dragged.  Thus, you cannot prevent a ViewStack 
from being dropped onto another ViewStack.

The offending code seems to be in PartStack.getDropTarget().  

I'm trying to code my presentation such that views can be dragged around and 
repositioned, but views cannot be combined with other views.
Comment 1 Stefan Xenos CLA 2005-03-07 15:40:11 EST
IMHO, decisions like this should not be made by the presentation. Whether or not
views can be stacked or dragged should be a property of the perspective. If each
presentation were to make assumptions about the behavior of its containing
perspective, then different presentations would not be interchangable.

You can prevent a view from being stacked by flagging it as standalone in the
perspective. It should be possible to make all your views both standalone and
moveable, which gives you the behavior you desire. If not, please reopen.
Comment 2 Chris Gross CLA 2005-03-14 21:27:07 EST
If I create a view as standalone, then move it, its recreated in a normal (non-
standalone) view stack.  Then any other view can be dropped onto that view.  
It doesn't seem that I can accomplish a presentation or perspective or 
anything that will prevent users from combining views.  

Regarding who's responbility it is, it seems like these are responsibilities 
are mixed already.  A presentation is responsible for implementing (or 
choosing not to implement) whatever was set by the perspective 
(standalone,moveable,closeable).  Because of this, it would seem to me that 
what a perspective sets should be interpreted as hints for the presentation.  
If the presentation can or wants to support the given attribute it may.  It 
would feel more fitting if the standalone view support was implemented fully 
by the presentation and not by workbench internals.  Meaning that the 
presentation prevents the dropping on standalone views by an appropriate 
callback (i.e. dragOver) rather workbench internals preventing the drop. 

Reopening because I don't have a solution to my root issue: preventing views 
from combining in the same site, while still being moveable. 
Comment 3 Stefan Xenos CLA 2005-03-15 14:56:01 EST
Okay... IMHO, the first issue is a bug: if you flagged a view as
standalone+movable, then moving it shouldn't cause the standalone flag to be lost.

RCP apps may choose to implement a subset of the presentation features, but this
would be an intentional decision to be incompatible with other Eclipse
presentations.

The author of the Java perspective would not want a presentation to prevent
stacking or moving of views. Similarly, you probably would not want users to be
able to stack stuff together in your perspective if it was rendered with a
different presentation.

StackPresentation is only supposed to control stuff that goes on within a single
stack. Decisions about what goes into each stack, where the stacks are located,
etc. are the domain of the perspective. If there has been some blurring of
responsibility, we should not blur it further.

Renaming and reclassifying bug.
Comment 4 Rob Hughes CLA 2005-05-26 04:04:06 EDT
Along the same lines a standalone + moveable stack should not be allowed to be
dragged into any other stack.
Comment 5 Rob Hughes CLA 2005-05-26 04:09:49 EDT
Created attachment 21798 [details]
patch to fix both issues here

PartSashContainer now creates the new stack as standalone if the dropped object
came from a standalone stack.

It also prevents standalone stacks/views from standalone stacks from being
dragged into other stacks.
Comment 6 Stefan Xenos CLA 2005-05-26 12:26:42 EDT
Will inspect patch for 3.2.
Comment 7 Rob Hughes CLA 2005-05-26 14:51:02 EDT
I realize that 3.1 is targeted for a next month release, however this bug
prevents RCP developers from usgin standalone views in their apps.  I currently
have a view that needs to be visible at all times, if a user is allowed to
redock it or move it into another stack it defeats the purpose of the standalone
stack.

This impacts my entire application design, as we are targeting 3.1 this is
really a blocker for us.

The patch is relatively minor (I added 5 lines of code and modified 2 others)
and should be added for 3.1 or at least looked at.
Comment 8 Paul Webster CLA 2005-09-01 14:54:23 EDT
I've looked at the patch, and it looks pretty low risk for 3.1.1 (with one minor
change).  I'll try to write a test for it on Tuesday, then it can be submitted.

PW
Comment 9 Paul Webster CLA 2005-09-06 11:16:43 EDT
Created attachment 26852 [details]
Test that drags a standalone view onto a standalone view

Test that standalone views cannot be combined after dragging them around.

PW
Comment 10 Paul Webster CLA 2005-09-06 11:17:29 EDT
Created attachment 26853 [details]
Slightly updated patch for submission to 3.1.1

Slightly updated patch, it's ready to go for 3.1.1 and 3.2

PW
Comment 11 Michael Van Meekeren CLA 2005-09-12 16:50:17 EDT
patches applied to 3.1.1
Comment 12 Michael Van Meekeren CLA 2005-09-12 17:05:21 EDT
still need to apply something for 3.2 
Comment 13 Michael Van Meekeren CLA 2005-09-13 14:55:54 EDT
fixed in HEAD, had to move some of the code around, Paul please double check
Comment 14 Paul Webster CLA 2005-09-20 11:26:51 EDT
verified on 3.2
Comment 15 Boris Bokowski CLA 2005-09-26 15:21:53 EDT
Standalone views can still lose this property when they are detached. See Bug
110634 [DetachedViews] Standalone views lose their standalone property when detached
Comment 16 Boris Bokowski CLA 2005-09-26 15:22:53 EDT
(my previous comment applies to 3.1.1 RC2, I haven't tested this with a recent
3.2 build.)
Comment 17 Nick Edgar CLA 2005-10-05 11:54:05 EDT
Also filed bug 111634 -- a stack containing a non-moveable view can still be moved.