Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » set a menu visible after job
set a menu visible after job [message #630399] Fri, 01 October 2010 20:51 Go to next message
Luiz E. is currently offline Luiz E.Friend
Messages: 97
Registered: September 2010
Member
hi all!
i have a property in my view, saying if the job done sucessfuly or not.
then, i want to set a menu visible when this property became true.

i'm doing some like this
<visibleWhen
                  checkEnabled="false">
               <with
                     variable="activePart">
                  <instanceof
                        value="br.com.athus.views.ViewMain">
                  </instanceof>
                  <test
                        property="br.com.athus.views.ViewMain.export"
                        value="true">
                  </test>
               </with>
            </visibleWhen>

but it isn't workitng.
any ideas?
Re: set a menu visible after job [message #630549 is a reply to message #630399] Mon, 04 October 2010 05:07 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 02/10/10 2:21 AM, zorba@live.com wrote:
> hi all!
> i have a property in my view, saying if the job done sucessfuly or not.
> then, i want to set a menu visible when this property became true.
>
> i'm doing some like this
>
> <visibleWhen
> checkEnabled="false">
> <with
> variable="activePart">
> <instanceof
> value="br.com.athus.views.ViewMain">
> </instanceof>
> <test
> property="br.com.athus.views.ViewMain.export"
> value="true">
> </test>
> </with>
> </visibleWhen>
> but it isn't workitng.
> any ideas?

Try calling IEvaluationService.requestEvaluation(propName);


--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: set a menu visible after job [message #630603 is a reply to message #630549] Mon, 04 October 2010 11:10 Go to previous messageGo to next message
Luiz E. is currently offline Luiz E.Friend
Messages: 97
Registered: September 2010
Member
this error:
Discouraged access: The method requestEvaluation(String) from the type EvaluationService is not accessible due to restriction on required library C:\Java\eclipse-rcp\eclipse\plugins\org.eclipse.ui.workbench_3.6.0.I20100603-1100.jar


i'm doing new EvaluationService().requestEvaluation("export");
Re: set a menu visible after job [message #630622 is a reply to message #630603] Mon, 04 October 2010 12:08 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 04.10.2010 13:10, zorba@live.com wrote:
> this error:
>
> Discouraged access: The method requestEvaluation(String) from the type
> EvaluationService is not accessible due to restriction on required
> library
> C:\Java\eclipse-rcp\eclipse\plugins\org.eclipse.ui.workbench _3.6.0.I20100603-1100.jar
>
>
> i'm doing new EvaluationService().requestEvaluation("export");

... which is not what Prakash recommended. All services should
be required by a corresponding service locator. One way
of realizing this is to use HandlerUtil to retrieve from the
command execution event the active workbench window and use
it as a service locator for IEvaluationService.

HTH & Greetings from Bremen,

Daniel Krügler
Re: set a menu visible after job [message #630626 is a reply to message #630622] Mon, 04 October 2010 12:40 Go to previous message
Luiz E. is currently offline Luiz E.Friend
Messages: 97
Registered: September 2010
Member
oh sorry
it's working now
i've made a properytester:
<extension
         point="org.eclipse.core.expressions.propertyTesters">
      <propertyTester
            class="br.com.athus.tester.ExportTester"
            id="testerMenu"
            namespace="exportSucesso"
            properties="export"
            type="java.lang.Object">
      </propertyTester>
   </extension>

and if a single property is true, the menu appears, as i expected Very Happy
i've found the help here: http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/m sg35998.html
Previous Topic:How to block a line for editing in my Editor
Next Topic:How to reinforce singleton pattern in extension point
Goto Forum:
  


Current Time: Sun Dec 21 18:44:34 GMT 2014

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

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