Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Moving a newly created Instance of a ViewPart
Moving a newly created Instance of a ViewPart [message #482743] Thu, 27 August 2009 14:21 Go to next message
drew frantz is currently offline drew frantz
Messages: 340
Registered: July 2009
Senior Member
I have a method that creates mutiple instances of a custom ViewPart. After I
create a new ViewPart I want it to reside stacked in a certain part of the
perspective. What is the trick to moving the ViewPart to a different
location after it is created?
Re: Moving a newly created Instance of a ViewPart [message #482884 is a reply to message #482743] Fri, 28 August 2009 08:54 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There's no API to do that (and the hackery I've seen is black magic).

You can create a placeholder for multi-instance views in the perspective. Just use ':' ... i.e. "my.view.id:*"

PW


Re: Moving a newly created Instance of a ViewPart [message #482978 is a reply to message #482884] Fri, 28 August 2009 15:22 Go to previous messageGo to next message
drew frantz is currently offline drew frantz
Messages: 340
Registered: July 2009
Senior Member
Thanks works great. Didn't understand how to deal with the wildcards in the
perspective, now I do.

"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:h78k2e$tv7$1@build.eclipse.org...
> There's no API to do that (and the hackery I've seen is black magic).
>
> You can create a placeholder for multi-instance views in the perspective.
> Just use ':' ... i.e. "my.view.id:*"
>
> PW
>
Re: Moving a newly created Instance of a ViewPart [message #483209 is a reply to message #482884] Mon, 31 August 2009 11:13 Go to previous message
Remo Loetscher is currently offline Remo Loetscher
Messages: 18
Registered: July 2009
Junior Member
Hi Paul,

I had problems with placeholder in perspectives using multi-instance views.

[...]
IPlaceholderFolderLayout createPlaceholderFolder =
layout.createPlaceholderFolder("org.placeholder.folder.test.id ",
IPageLayout.BOTTOM, 0.5f, IPageLayout.ID_EDITOR_AREA);

//this will NOT work for multi instance views
createPlaceholderFolder.addPlaceholder("*placeholder.folder.test* ");
//this will work for multi instance views
createPlaceholderFolder.addPlaceholder("*placeholder.folder.test*:* ");
[...]

I found the bug report
https://bugs.eclipse.org/bugs/show_bug.cgi?id=118693 and assumed that
there is no way to do that (still open).

But your hint with the ":" did the trick!

Thanks!

Remo

Paul Webster wrote:
> There's no API to do that (and the hackery I've seen is black magic).
>
> You can create a placeholder for multi-instance views in the
> perspective. Just use ':' ... i.e. "my.view.id:*"
>
> PW
>
Previous Topic:[commands] Help with handler enabledWhen
Next Topic:How to set the default location in New Wizard for GMF plug-in
Goto Forum:
  


Current Time: Fri Aug 22 06:07:27 EDT 2014

Powered by FUDForum. Page generated in 0.64151 seconds