0

Is there a way to create conditions (similar to if/else blocks) in the Eclipse plugin.xml's files.

I'm creating a Eclipse plugins in which I need to set a different value depending on the project facet, I'm getting the project facet using:

<with variable="projectFacet">
    <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="projectFacet" forcePluginActivation="true"/>
</with>

And then I have this code:

<item
    label="test"
    visible="false"
    id="test.test1"
    category="category1"
    description="test description">
</item>

At this momment I'm hardcoding "category1", what I need is to select the correct category depending on the variable I got before, for example:

  • facet1 should be on the category1
  • facet2 should be on the category2

Someone knows how to do that? Thanks.

CIOC
  • 1,385
  • 3
  • 19
  • 48
  • Short answer is no. It is not clear which extension point `item` is for, but you may be able to have multiple items and use something like `visibleWhen` to control which ones show. – greg-449 Oct 30 '14 at 18:16
  • I see, then I will need to duplicate that block of code and surround each block with visibleWhen, I never used visibleWhen before so I will need to investigate about it, thanks. – CIOC Oct 30 '14 at 18:31
  • Only certain extension points have visibleWhen, when they do it is a child element not surrounding. – greg-449 Oct 30 '14 at 18:49
  • Is there a way to verify that a given extension point have that property? I will need to verify it in several extension points – CIOC Oct 30 '14 at 20:13
  • You read the documentation on the extension point. All elements are listed there. – greg-449 Oct 30 '14 at 20:14
  • The problem is that this are not extension points provided by Eclipse, and unfortunately there's no documentation about them :/ – CIOC Oct 30 '14 at 20:19

0 Answers0