| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Copyright 2004, 2005 The Apache Software Foundation |
| |
| Licensed 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. |
| --> |
| |
| <!DOCTYPE component-specification PUBLIC |
| "-//Apache Software Foundation//Tapestry Specification 4.0//EN" |
| "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd"> |
| |
| <component-specification class="org.apache.tapestry.workbench.table.LocaleSelection" |
| allow-body="no" allow-informal-parameters="yes"> |
| |
| <component id="condTable" type="If"> |
| <binding name="condition" value="localeSet.size gt 0"/> |
| </component> |
| |
| <!-- Define the Table component that will be used. |
| This example demonstrates various techniques for configuring the component. --> |
| <component id="table" type="contrib:Table"> |
| |
| <!-- The source of the data for the table will be the localeSet property |
| defined further down in this file --> |
| <binding name="source" value="localeSet"/> |
| |
| <!-- The columns of the table --> |
| <binding name="columns"> |
| literal: |
| |
| <!-- The first column is the representation of the locale returned when invoking toString() on it. |
| Its name will be displayed according to the translation value |
| of this component with key 'locale' (see LocaleSelection.properties) --> |
| locale:toString(), |
| |
| <!-- The next two columns are returned by the Java code as ITableColumn objects --> |
| =currencyColumn, |
| =dateFormatColumn, |
| |
| <!-- The next column is named 'verbosity' and thus will use the |
| verbosityValueRenderer block in this component to render the row values. |
| If no translation key 'verbosity' is found, the column will be displayed as 'Verbosity' --> |
| verbosity:Verbosity:@org.apache.tapestry.workbench.table.VerbosityRating@calculateVerbosity(#this), |
| |
| <!-- The last column is named 'delete' and is not sortable. Please see the |
| deleteValueRenderer block for the definition of how it should look --> |
| !delete |
| </binding> |
| |
| <!-- The row object (locale) that is currently being rendered |
| will be stored in the currentLocale property (defined further down) --> |
| <binding name="row" value="currentLocale"/> |
| |
| <!-- Each rendered row will be given the CSS class of 'tableRowsClass' --> |
| <binding name="rowsClass" value="literal:tableRowsClass"/> |
| |
| </component> |
| |
| <component id="directDelete" type="DirectLink"> |
| <binding name="listener" value="listener:deleteLocale"/> |
| <binding name="parameters" value="deleteLocaleContext"/> |
| </component> |
| |
| <component id="verbosity" type="Any"> |
| <binding name="element" value="literal:td"/> |
| <binding name="style">ognl: |
| "background-color:#A2E283;border:1px solid #88BD6D; width:" |
| + (currentLocaleVerbosity / 2) + "px" |
| </binding> |
| </component> |
| |
| <property name="localeSet" persist="session" initial-value="new java.util.HashSet()"/> |
| |
| <property name="currentLocale"/> |
| |
| </component-specification> |