How to correctly toggle visibility of a Placeholder? [message #1413276] |
Thu, 28 August 2014 03:31  |
Eclipse User |
|
|
|
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 02:25  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02623 seconds