Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to correctly toggle visibility of a Placeholder?
How to correctly toggle visibility of a Placeholder? [message #1413276] Thu, 28 August 2014 07:31 Go to next message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Hey guys,

I'm trying to toggle the visibility of a Part that is included as a
Placeholder. The Part is defined as a Shared Element with
toBeRendered=true. It is then positioned in the Application Model via a
Placeholder in different Perspectives with a Placeholder that has
toBeRendered=false as I don't want it to be visible by default.

I added a Command, a Handler and a Keybinding for the toggle
functionality but I'm not sure for which attribute I should check for.

The following works with a "normal" Part that is added directly to a
PartStack.

MPart part = partService.findPart("my.part.id");
if(part.isToBeRendered())
partService.hidePart(part);
else{
partService.showPart(part, PartState.ACTIVATE);
}

But this didn't work for the Placeholder. It seems to me that the
toBeRendered flag of the real part (the Shared Element) is queried and
as this is true the if part is executed and hidePart() doesn't set the
toBeRendered to false because it is a Shared Element. Is this assumption
correct?

I tried adding part.setToBeRendered(false) in the if part. This works if
I only use my Keybinding for closing the part. If I close it by clicking
the X, then I need to press the key twice in order to show it again.

So what is the correct way to toggle the visibility of a Placeholder?

Thanks in advance
Marina Knieling
Re: How to correctly toggle visibility of a Placeholder? [message #1415122 is a reply to message #1413276] Tue, 02 September 2014 06:25 Go to previous message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
No one any ideas on this? Maybe just a hint where or what to look for in
the source?

On 28.08.2014 09:31, Marina Knieling wrote:
> Hey guys,
>
> I'm trying to toggle the visibility of a Part that is included as a
> Placeholder. The Part is defined as a Shared Element with
> toBeRendered=true. It is then positioned in the Application Model via a
> Placeholder in different Perspectives with a Placeholder that has
> toBeRendered=false as I don't want it to be visible by default.
>
> I added a Command, a Handler and a Keybinding for the toggle
> functionality but I'm not sure for which attribute I should check for.
>
> The following works with a "normal" Part that is added directly to a
> PartStack.
>
> MPart part = partService.findPart("my.part.id");
> if(part.isToBeRendered())
> partService.hidePart(part);
> else{
> partService.showPart(part, PartState.ACTIVATE);
> }
>
> But this didn't work for the Placeholder. It seems to me that the
> toBeRendered flag of the real part (the Shared Element) is queried and
> as this is true the if part is executed and hidePart() doesn't set the
> toBeRendered to false because it is a Shared Element. Is this assumption
> correct?
>
> I tried adding part.setToBeRendered(false) in the if part. This works if
> I only use my Keybinding for closing the part. If I close it by clicking
> the X, then I need to press the key twice in order to show it again.
>
> So what is the correct way to toggle the visibility of a Placeholder?
>
> Thanks in advance
> Marina Knieling
Previous Topic:Editor Area disappearing when resizing the window
Next Topic:Logging on Mac OS
Goto Forum:
  


Current Time: Mon Jan 25 02:12:49 GMT 2021

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

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

Back to the top