Bug 99155 - [RCP] [Perspectives] Perspective extension with standalone=true and visible=false doesn't work
Summary: [RCP] [Perspectives] Perspective extension with standalone=true and visible=f...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-06-09 10:19 EDT by Chris Gross CLA
Modified: 2006-02-16 12:44 EST (History)
0 users

See Also:


Attachments
Patch (6.16 KB, patch)
2005-07-05 15:08 EDT, Chris Gross CLA
no flags Details | Diff
New patch (6.47 KB, patch)
2005-07-05 16:55 EDT, Chris Gross 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-06-09 10:19:56 EDT
If you create a perspective extension, define the standalone=true and 
visible=false, when the view is opened, the view is not created as a 
standalone view although all other parameters are respected.  

More generally, I'm trying to offer my users the ability to open a view 
through an action.  That view needs to be a standalone view.  There seems to 
be no way to open a standalone view outside of the initial perspective 
creation.

Another option is to offer an API to open a view as standalone, perhaps as 
another overloaded showView method.
Comment 1 Nick Edgar CLA 2005-06-09 11:02:45 EDT
Chris, does it work if you add the standalone placeholder directly in the
perspective factory?  This may be a dup of bug 98536, or related to it. 
Basically the visible="false" means: define a placeholder, and it's not keeping
the correct attributes.
Comment 2 Chris Gross CLA 2005-06-09 11:29:25 EDT
No it doesn't work if you add the placeholder in the perspective factory.  

Regarding bug 98536, it is very closely related but I think a little bit 
different.  I believe 98536 just asks that the place holder's closeable and 
moveable parameters be respected.  I think the root of my problem is that 
there seems to be no way to create a place holder with the standalone 
parameter.  So when creating a place holder in the perspective factory, or 
using the perspective extension (which essentially does the same as you said), 
theres no way to mark the place holder to open the view as a standalone.

IViewLayout has an isStandalone but not a setStandalone.  

I think LWP and my app are trying to accomplish a very similar thing.  We both 
want to open 'fixed' (in LWP's case thats an unmoveable & uncloseable, in my 
case thats standalone & unmoveable) view after the perspective has been 
created.

Actually, I tried duplicating LWP's problem and I cannot.  If I create a place 
holder and set moveable/closeable = false those values are respected so I'm 
not sure whats up with that.
Comment 3 Nick Edgar CLA 2005-06-09 15:45:12 EDT
I agree it's slightly different API-wise, but under the covers it's very similar.

"If I create a place holder and set moveable/closeable = false those values are
respected"
Was this a top-level placeholder, or in a folder?  I checked that the latter
isn't working, but maybe the former is.
Comment 4 Chris Gross CLA 2005-06-09 15:58:30 EDT
You're right.  If I tried with a place holder within a folder, I reproduced 
their issue.

Back to my issue, it is important for me that the standalone property be 
honored specifically, because it allows me to prevent users from combining 
views together.  
Comment 5 Nick Edgar CLA 2005-06-09 16:48:40 EDT
There are several known issues with standalone views.  There are still a bunch
of holes where movement is not locked down as tightly as it should be.  Do a
bugzilla query against Platform UI with "standalone".  And we're quickly running
out of runway for 3.1.

Another option would be to consider using a custom presentation.  While
non-trivial, this would give you complete control over how layout is done, and
whether rearrangement is allowed.  There is an example in
org.eclipse.ui.examples.presentation.  See also the discussion about
presentations towards the end of bug 68684.

I'd like to see several good quality presentation implementations become
available as building blocks for RCP apps, but these would have to come from the
 community.
Comment 6 Nick Edgar CLA 2005-06-09 16:49:36 EDT
If you'd like to help out here, take a look at how PageLayout,
PlaceholderFolderLayout, FolderLayout, and PerspectiveExtensionReader are
implemented.
Comment 7 Chris Gross CLA 2005-06-09 17:14:08 EDT
I am actually using a custom presentation.  And I'm also planning on building 
a few custom presentations to make available commercially.  So I'm definitely 
with you on that.  I've started www.swtplus.com towards that end.

About creating custom presentations, I did not have any easy time when I 
started out.  It seems the presentations API was not intended to be 
responsible for layout/dragging decisions.  At least thats what Stefan 
mentioned in my bug 87211.  Its counter-intuitive to what I was expecting.  I 
was expecting/assuming that a perspective is less responsible, providing only 
hints (i.e. moveable being a hint) that can be honored by the presentation or 
not.  So I've had to still make all my views standalone so I can satisfy my 
main useability request, to not combine views together.

I may actually be able to get in there and take a look at this problem.  I'm 
sure I won't be able to do that for 3.1.  I really didn't assume this bug 
would be fixed for 3.1 when I submitted it anyway.
Comment 8 Chris Gross CLA 2005-06-09 17:17:33 EDT
One last thing.  I am rather proud of the custom presentation I wrote and I 
would love to have it on the RCP examples page or on Ian Skerrett's blog, but 
unfortunately the CEO here is afraid of showing screenshots of our app.  I 
guess our competitors would then realize our secret sauce :(
Comment 9 Nick Edgar CLA 2005-06-09 18:03:34 EDT
The swtplus widgets look cool!  Nice to see.

The workbench needs to control DnD rearrangement since only it knows where the
other parts are, however the presentation gets to control whether DnD is
initiated at all, and whether the system actions (including move etc) are included.

See IStackPresentationSite.dragStart(...) and addSystemActions(IMenuManager).
Comment 10 Chris Gross CLA 2005-07-05 15:08:01 EDT
Created attachment 24360 [details]
Patch

Here ya go...  This patch encompasses two real changes.  First and foremost, it
alters PageLayout to add a new addStandaloneViewPlaceholder method.  This is
also an API addition to IPageLayout.  Second, the PerspectiveExtensionReader
has been modified to use this method to create standalone placeholders when
necessary.  

I'm really hoping this could be in one of the first 3.2 builds or milestones.
Comment 11 Nick Edgar CLA 2005-07-05 16:26:21 EDT
Should check the placeholder id using checkValidPlaceholderId.  See how
PageLayout.addPlaceholder does it.

Should also update the placeholder's ViewLayout to return appropriate values for
isStandalone() and getShowTitle().  See PageLayout.addStandaloneView.
Comment 12 Chris Gross CLA 2005-07-05 16:55:46 EDT
Created attachment 24367 [details]
New patch

Fixed.	Attached new patch.
Comment 13 Nick Edgar CLA 2005-07-07 11:03:08 EDT
Thanks Chris, will review.
Comment 14 Michael Van Meekeren CLA 2006-01-13 11:33:02 EST
paul could you look at this patch?
Comment 15 Paul Webster CLA 2006-02-08 10:00:27 EST
Released into HEAD >20060208

PW
Comment 16 Paul Webster CLA 2006-02-16 12:44:28 EST
verified in I20060216-0010