Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Visibility at toolbar-contribution
icon5.gif  Visibility at toolbar-contribution [message #548308] Wed, 21 July 2010 12:56 Go to next message
Rencana Tarigan is currently offline Rencana TariganFriend
Messages: 56
Registered: July 2009
Location: Bandung, Indonesia
Member

Hi all, i have some question about visibility at tollbar contribution,
How to configure the visibility of a toolbar-contribution to be in only one perspective and still be depending on the selection? I was able to do both, but not at the same time. Each of them works, but if I make both (<visibleWhen> at the toolbar-contribution, <activeWhen> at the handler), the inactive-icon is drawn very ugly and far too large.


Re: Visibility at toolbar-contribution [message #548346 is a reply to message #548308] Wed, 21 July 2010 14:16 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Please show us the visibleWhen and/or activeWhen that didn't work for you.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Visibility at toolbar-contribution [message #549269 is a reply to message #548346] Mon, 26 July 2010 10:38 Go to previous messageGo to next message
Rencana Tarigan is currently offline Rencana TariganFriend
Messages: 56
Registered: July 2009
Location: Bandung, Indonesia
Member

 <handler
class="org.cord.client.dms.mainapp.handlers.CopyHandler"
commandId="org.cord.client.dms.mainapp.commands.copyCommand">
<activeWhen>
<with variable="selection">
<test property="com.example.addressbook.isCompany" value="true" forcePluginActivation="true"/>
</with>
</activeWhen>
</handler>
 


<command
commandId="org.cord.client.dms.mainapp.commands.goBackCommand"
disabledIcon="icons/go-previous-inactive.png"
icon="icons/32x32/go-previous.png"
label="Go Back"
style="push"
tooltip="Go Back">
<visibleWhen>
<with variable="activeWorkbenchWindow.activePerspective">
<equals value="org.cord.client.dms.mainapp.perspective" />
</with>
</visibleWhen>
 </command> 


Re: Visibility at toolbar-contribution [message #549302 is a reply to message #549269] Mon, 26 July 2010 12:12 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

I don't see anything wrong with your expressions. Is the problem that
it's not working, or that when it is disabled the icon is ugly (not the
one that you supplied)?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Visibility at toolbar-contribution [message #549306 is a reply to message #549302] Mon, 26 July 2010 12:31 Go to previous messageGo to next message
Rencana Tarigan is currently offline Rencana TariganFriend
Messages: 56
Registered: July 2009
Location: Bandung, Indonesia
Member

as i said at my first post that the icon drawn too large when it's disabled..

Re: Visibility at toolbar-contribution [message #549373 is a reply to message #549306] Mon, 26 July 2010 14:00 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Rencana Tarigan wrote:
> as i said at my first post that the icon drawn too large when it's
> disabled..

and that's the problem (not related to it actually being the correct state)?

It might be a bug with how the CommandContributionItem is setting the
disabledIcon. What version of eclipse are you running?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Visibility at toolbar-contribution [message #549375 is a reply to message #549373] Mon, 26 July 2010 14:29 Go to previous message
Rencana Tarigan is currently offline Rencana TariganFriend
Messages: 56
Registered: July 2009
Location: Bandung, Indonesia
Member

I'm use Eclipse Galileo

Eclipse for RCP/Plug-in Developers
Build id: 20090920-1017


Previous Topic:Yet another topic on FormEditor
Next Topic:XML Editor
Goto Forum:
  


Current Time: Sun Dec 05 05:56:44 GMT 2021

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

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

Back to the top