Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Same view size across multiple perspectives
Same view size across multiple perspectives [message #449630] Wed, 17 May 2006 03:56 Go to next message
Eclipse UserFriend
Hi,

I'm using a navigation view in my RCP application. It is located on the left side and it works as an perspective selector, i.e. each navigation entry leads to a different perspective which is representing a different business process.
The navigation view is part of each perspective (through an abstract perspective factory base class). But there is a problem with this solution: The navigation view size is memorized per perspective and that leads to a 'flickering' view size when switching through the perspectives after the user has resized the view.
Is there a way to resize a view through all perspectives it is part of? Or do you know a better way to introduce a view that is part of each perspective and has always the same size on each of these (without forbidding the user to resize it;-))?

- Torsten
Re: Same view size across multiple perspectives [message #449637 is a reply to message #449630] Wed, 17 May 2006 08:00 Go to previous messageGo to next message
Eclipse UserFriend
Make it a sticky view might work ... then it can be automatically placed
on the left in every perspective.

Later,
PW
Re: Same view size across multiple perspectives [message #449638 is a reply to message #449637] Wed, 17 May 2006 08:13 Go to previous messageGo to next message
Eclipse UserFriend
Hi Paul,

Thanks for your quick reply.

> Make it a sticky view might work ... then it can be
> automatically placed
> on the left in every perspective.

Sorry, I forgot to mention that I have already tried it. Unfortunately it shows the same behaviour.

Can I maybe register a 'resize' listener which will memorize the view size and a 'open perspective' listener which will set the current view size whenever the perspective is switched?

- Torsten
Re: Same view size across multiple perspectives [message #449640 is a reply to message #449638] Wed, 17 May 2006 08:43 Go to previous messageGo to next message
Eclipse UserFriend
Torsten Beuck wrote:
> Can I maybe register a 'resize' listener which will memorize the view size and a 'open perspective' listener which will set the current view size whenever the perspective is switched?


Unfortunately I don't think that would work.

The view size is controlled 100% by the sash container (the draggable
bar) and hence by the user.

There's no programmatic way to resize a view. You could make your
layout fixed, but then you wouldn't be able to resize any views or editors.

Later,
PW
Re: Same view size across multiple perspectives [message #449642 is a reply to message #449640] Wed, 17 May 2006 09:08 Go to previous messageGo to next message
Eclipse UserFriend
> Unfortunately I don't think that would work.
>
> The view size is controlled 100% by the sash
> container (the draggable
> bar) and hence by the user.
>
> There's no programmatic way to resize a view. ...

Ups :-O. I wonder, if my problem is such an extraordenary one, that nobody ever before stumbled over it. When reading this forum I often had the feeling that there are lots of developers that are working on such applications (navigation on the left side + varying content through different perspectives).
Maybe the 'view-solution' for switching the perspectives is a bad one. A kind of toolbar shouldn't have the same problem or am I wrong? Do you have any advise for me?

> ...You could make your layout fixed, but then
> you wouldn't be able to resize
> any views or editors.

Okay, that's definitely not the solution the users will be happy with. I fear they would stone me ;-)

- Torsten
Re: Same view size across multiple perspectives [message #449649 is a reply to message #449642] Wed, 17 May 2006 11:07 Go to previous messageGo to next message
Eclipse UserFriend
I am kind of curious why switch perspectives.

Maybe with a little re-jigging you could live in one perspective.

i.e.

+---+-------+---+
| 1 | 2 | 3 |
| | +---+
| | | 4 |
+---+-------+---+

view1 is your navigation view, view2 is some kind of main view.

In view1-selection1, your show a view in view3 (but nothing in view4),
so view3 takes up both view3+view4 space.

In view1-selection2, you show a different view in view3 and a view in
view4. You might be able to do this using
IPageLayout#addPlaceholder(*), so that the view4 space is empty when
view4 isn't showing.

Later,
PW
Re: Same view size across multiple perspectives [message #449658 is a reply to message #449649] Wed, 17 May 2006 11:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi Paul,

> I am kind of curious why switch perspectives.

The reason for choosing perspective switching is the following:
The RCP application I'm developing should be container application for many different plugins, where each plugin will represent a different business process inside my company (mail order business). More precisely this will all be merchandising processes like order placement, merchandise planning, item management, ...
Each plugin or modul will be developed by a different team (1 to 5 developer) as a migration from an old 2-tier architecture grown over the last decades.
So my part is to build a stable basis on which the different teams could develop as indepent as possible. So the perspective concept seemed really appealing: Just let all developers design their own perspectives for their individual business process needs, link (and authorize) them using a navigation view and voila: the user has a single application for all his needs instead of many different looking PowerBuilder applications.

Your idea with the re-jigging sounds interesting, but I fear it's not so well suited for the application we like to create. Because in a few months it will surely have about 10 to 20 views and in a few years it will span hundreds. That would be a lot of placeholders.

But thanks a lot for your interest. Do you think it could be worthwile to dig deeper into the eclipse sources to find a clue?

- Torsten
Re: Same view size across multiple perspectives [message #449663 is a reply to message #449658] Wed, 17 May 2006 12:33 Go to previous messageGo to next message
Eclipse UserFriend
What about having a coolbar perform the perspective switching instead of a view?

Also, you're assuming that there's only one window at a time. On a dual-screen setup, you can (and often do) have two windows (Window -> New Window) that are concurrently showing two perspectives. I'd personally be surprised if one view sizing caused any of the other views to change, especially if I'd laid them out as such.

Alex.
Re: Same view size across multiple perspectives [message #449732 is a reply to message #449663] Thu, 18 May 2006 10:46 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,

sorry for answering late, but I had a day full of meetings :-O.

> What about having a coolbar perform the perspective
> switching instead of a view?

Surely this would be the best solution, but I don't know, if a coolbar offers all I need. The business demand is a 2 level navigation. The main level for the coarse grained business processes and the second level for their finer grained subprocesses. At the moment it is implemented by using the SWTPlus custom widget 'PGroup'.
I haven't tried it, so I don't know if it's possible to use it inside a coolbar.

> Also, you're assuming that there's only one window at
> a time. On a dual-screen setup, you can (and often
> do) have two windows (Window -> New Window) that are
> concurrently showing two perspectives. I'd personally
> be surprised if one view sizing caused any of the
> other views to change, especially if I'd laid them
> out as such.

Fortunately we convinced the business people that they don't need the multiple window functionality. It's sufficient to offer multiple instances of some of the views.

- Torsten
Re: Same view size across multiple perspectives [message #449733 is a reply to message #449663] Thu, 18 May 2006 11:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi again,

what I forgot to ask: How do I integrate a second coolbar, that resides on the left side of the window, into my RCP app?

- Torsten
Re: Same view size across multiple perspectives [message #449735 is a reply to message #449732] Thu, 18 May 2006 11:26 Go to previous messageGo to next message
Eclipse UserFriend
Don't know. You might be able to get away with a coolbarmanager with a single coolbaritem, that contains a control which is the PGroup (on the assumption that it is a control; if not, you might need to nest something).

Otherwise, if you want to get down and dirty with Eclipse's internals, you might like to look at the org.eclipse.ui.internal.FastViewBar and IWindowTrim. That way, you could implement something similar to the fast view bar but that provided your two-level navigation, and it could be in the same place regardless of perspective.

Alex.
Re: Same view size across multiple perspectives [message #449736 is a reply to message #449735] Thu, 18 May 2006 11:37 Go to previous messageGo to next message
Eclipse UserFriend
> Don't know. You might be able to get away with a
> coolbarmanager with a single coolbaritem, that
> contains a control which is the PGroup (on the
> assumption that it is a control; if not, you might
> need to nest something).

Okay, I'll give it a try as soon as I have found out how to add a second Coolbar to the workbench window.

> Otherwise, if you want to get down and dirty with
> Eclipse's internals, you might like to look at the
> org.eclipse.ui.internal.FastViewBar and IWindowTrim.
> That way, you could implement something similar to
> the fast view bar but that provided your two-level
> navigation, and it could be in the same place
> regardless of perspective.

Thanks for the hint. Digging into eclipse's internals will surely be challenging and instructive. I hope I'll get enought time for this. Could I contact you directly for questions regarding the implementation details?

- Torsten
Re: Same view size across multiple perspectives [message #449740 is a reply to message #449736] Thu, 18 May 2006 12:02 Go to previous message
Eclipse UserFriend
Don't ask me, I don't know what I'm talking about :-)

Seriously, I found it by having a quick look for something called *fast*view* in the Open Type (with the JFace plugin loaded and referenced from my project) which found it and the interface IWindowTrim. There's a bunch of JavaDoc in there which you might be able to dig through, but I've never seen it before answering your question today ...

That said, I'm happy to help out if I can. But it would probably be a benefit to reply on the forum/newsgroup so that any questions (and answers) get recorded for posterity/others to see.

(Otherwise, drop me a line on the EclipseZone message box)

Alex.
Previous Topic:How load a resource file from a jar in different plugins?
Next Topic:RCP 3.2 Target - S.O.S
Goto Forum:
  


Current Time: Sun Aug 31 01:12:53 EDT 2025

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

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

Back to the top