Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Iterate expression with two or more equals
Iterate expression with two or more equals [message #515945] Mon, 22 February 2010 05:15 Go to next message
Eclipse User
Originally posted by: 6lackbird.dev.gmail.com

How to write the condition for checking two or more expressions to iterate?


Option when inside iterate registered only one equals everything works
<enablement>
<with variable="accessRights">
<iterate ifEmpty="false" operator="or">
<equals value="viewer"/>
</iterate>
</with>
</enablement>

but worth only add one more condition, the test fails
<enablement>
<with variable="accessRights">
<iterate ifEmpty="false" operator="or">
<equals value="viewer"/>
<equals value="editor"/>
</iterate>
</with>
</enablement>
Re: Iterate expression with two or more equals [message #516012 is a reply to message #515945] Mon, 22 February 2010 08:34 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

operator="or" applies to how the values of each iteration are combined.
The iterate children are combined using "and", so you would need to
add <or> around your 2 equals.

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: Iterate expression with two or more equals [message #516053 is a reply to message #516012] Mon, 22 February 2010 10:41 Go to previous messageGo to next message
Eclipse User
Originally posted by: 6lackbird.dev.gmail.com

Paul Webster пишет:
> operator="or" applies to how the values of each iteration are combined.
> The iterate children are combined using "and", so you would need to add
> <or> around your 2 equals.
>
> PW
>

so this is not working

<with variable="accessRights">
<iterate ifEmpty="false" operator="or">
<or>
<equals value="viewer"/>
</or>

<or>
<equals value="editor"/>
</or>

</iterate>
</with>

Could you show your variant?
Re: Iterate expression with two or more equals [message #516139 is a reply to message #516053] Mon, 22 February 2010 10:12 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Vologodsky Evgeny wrote:
> so this is not working
>
> <with variable="accessRights">
> <iterate ifEmpty="false" operator="or">
> <or>
> <equals value="viewer"/>
> </or>
>
> <or>
> <equals value="editor"/>
> </or>
>
> </iterate>
> </with>
>

That's ANDing 2 ORs. you want to OR 2 EQUALS:


<with variable="accessRights">
<iterate ifEmpty="false" operator="or">
<or>
<equals value="viewer"/>
<equals value="editor"/>
</or>
</iterate>
</with>

This expression says if ANY item in the collection is either a viewer or
editor.

Remove the operator="or" if you want: if ALL items in the collection are
either a viewer or editor.

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: Iterate expression with two or more equals [message #516311 is a reply to message #516139] Tue, 23 February 2010 10:03 Go to previous message
Eclipse User
Originally posted by: 6lackbird.dev.gmail.com

thanks
Previous Topic:How to add my problem entries to problemview
Next Topic:FormText with tooltip?
Goto Forum:
  


Current Time: Thu Jul 31 01:34:52 EDT 2014

Powered by FUDForum. Page generated in 0.02804 seconds