All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.maven-faces-plugin.components.trinidad.Switcher.xml Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
<?xml version="1.0" encoding="utf-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:tr="http://myfaces.apache.org/trinidad"
              xmlns:xi="http://www.w3.org/2001/XInclude"
              xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
              xmlns:fmd="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata">
  <component>
    <description><![CDATA[The switcher component dynamically decides which facet component
should be rendered.]]></description>
    <icon>
      <small-icon>/org/apache/myfaces/trinidadinternal/metadata/icons/switcher.gif</small-icon>
    </icon>
    <component-type>org.apache.myfaces.trinidad.Switcher</component-type>
    <component-class>org.apache.myfaces.trinidad.component.UIXSwitcher</component-class>
    <property>
      <description><![CDATA[the name of the facet to render and process.]]></description>
      <property-name>facetName</property-name>
      <property-class>java.lang.String</property-class>
      <property-extension>
        <mfp:property-metadata/>
        <fmd:property-metadata>
          <fmd:preferred>true</fmd:preferred>
        </fmd:property-metadata>
      </property-extension>
    </property>
    <property>
      <description><![CDATA[the name of the facet to render and process if "facetName"
              is null or otherwise does not refer to an existing facet.]]>
      </description>
      <property-name>defaultFacet</property-name>
      <property-class>java.lang.String</property-class>
    </property>
    <component-extension>
      <mfp:component-family>org.apache.myfaces.trinidad.Switcher</mfp:component-family>
      <mfp:component-supertype>org.apache.myfaces.trinidad.ComponentBase</mfp:component-supertype>
      <mfp:tag-name>tr:switcher</mfp:tag-name>
      <mfp:tag-class>org.apache.myfaces.trinidadinternal.taglib.UIXSwitcherTag</mfp:tag-class>
      <mfp:long-description><![CDATA[The switcher component dynamically decides which facet component
should be rendered.  It has two properties.  The switcher will render
the facet matching &quot;facetName&quot;;  however, if no such facet exists
(or &quot;facetName&quot; is null), and &quot;defaultFacet&quot; has been set, then
that facet will be used instead.   (It's possible to achieve this
same functionality by using a panelGroup and binding the
&quot;rendered&quot; property of each child, but this component can be
simpler.  Ordinary children of the switcher component are not rendered at
all.)]]>
      </mfp:long-description>
      <mfp:example>
        <mfp:source-code>
          <![CDATA[
<tr:switcher facetName="#{userData.person}" defaultFacet="default">
  <f:facet name="default">
    <tr:outputText value="You have not picked anyone I know"/>
  </f:facet >
  <f:facet name="Roger">
    <tr:outputText value="You have picked Roger"/>
  </f:facet >
  <f:facet name="Peter">
    <tr:outputText value="You have picked Peter"/>
  </f:facet >
</tr:switcher>
          ]]>
        </mfp:source-code>
      </mfp:example>
      <mfp:author>Adam Winer</mfp:author>
      <mfp:component-metadata/>
      <fmd:component-metadata>
        <fmd:default-property>childName</fmd:default-property>
      </fmd:component-metadata>
    </component-extension>
  </component>
</faces-config>







© 2015 - 2024 Weber Informatics LLC | Privacy Policy