myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject cvs commit: incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/common CarConfigurator.java
Date Wed, 20 Oct 2004 07:46:39 GMT
matzew      2004/10/20 00:46:39

  Added:       webapps/examples/src/org/apache/myfaces/examples/example1
                        UCaseForm.java UCaseActionListener.java
                        CalcForm.java ValidationController.java
                        CalcActionListener.java
               webapps/examples/src/org/apache/myfaces/examples/validate
                        ValidateForm.java
               webapps/examples/src/org/apache/myfaces/examples/util
                        ExampleMessagesResourceBundle.java GuiUtil.java
                        LocalizedSelectItem.java
               webapps/examples/src/org/apache/myfaces/examples/resource
                        example_messages_fr.properties
                        example_messages_ja.properties
                        example_messages_en.properties
                        example_messages_de.properties
                        example_messages.properties
               webapps/examples/src/org/apache/myfaces/examples/listexample
                        SimpleCar.java SimpleCountry.java
                        DataScrollerList.java SimpleSortableCarList.java
                        SimpleCountryForm.java SimpleCountryList.java
                        SortableList.java
               webapps/examples/src/org/apache/myfaces/examples/misc
                        OptionsController.java NavigationMenu.java
                        TabbedPaneBean.java OptionsForm.java
                        GlobalOptions.java FileUploadForm.java
               webapps/examples/src/org/apache/myfaces/examples/example2
                        QuotationForm.java QuotationController.java
               webapps/examples/src/org/apache/myfaces/examples/calendarexample
                        DateHolder.java
               webapps/examples/src/org/apache/myfaces/examples/common
                        CarConfigurator.java
  Removed:     webapps/examples/src/net/sourceforge/myfaces/examples/example1
                        CalcForm.java UCaseActionListener.java
                        ValidationController.java UCaseForm.java
                        CalcActionListener.java
               webapps/examples/src/net/sourceforge/myfaces/examples/listexample
                        SimpleCountry.java SimpleCar.java
                        SimpleCountryForm.java SortableList.java
                        SimpleSortableCarList.java DataScrollerList.java
                        SimpleCountryList.java
               webapps/examples/src/net/sourceforge/myfaces/examples/misc
                        NavigationMenu.java OptionsController.java
                        TabbedPaneBean.java FileUploadForm.java
                        OptionsForm.java GlobalOptions.java
               webapps/examples/src/net/sourceforge/myfaces/examples/resource
                        example_messages.properties
                        example_messages_fr.properties
                        example_messages_de.properties
                        example_messages_ja.properties
                        example_messages_en.properties
               webapps/examples/src/net/sourceforge/myfaces/examples/calendarexample
                        DateHolder.java
               webapps/examples/src/net/sourceforge/myfaces/examples/example2
                        QuotationForm.java QuotationController.java
               webapps/examples/src/net/sourceforge/myfaces/examples/util
                        GuiUtil.java ExampleMessagesResourceBundle.java
                        LocalizedSelectItem.java
               webapps/examples/src/net/sourceforge/myfaces/examples/common
                        CarConfigurator.java
               webapps/examples/src/net/sourceforge/myfaces/examples/validate
                        ValidateForm.java
  Log:
  renamed missing packages
  
  Revision  Changes    Path
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/example1/UCaseForm.java
  
  Index: UCaseForm.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.example1;
  
  import java.io.Serializable;
  
  /**
   * DOCUMENT ME!
   * @author Manfred Geiler
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:38 $
   */
  public class UCaseForm
          implements Serializable
  {
      private String text = "";
  
      public void uppercase()
      {
          text = text.toUpperCase();
      }
  
      public void lowercase()
      {
          text = text.toLowerCase();
      }
  
      public String getText()
      {
          return text;
      }
  
      public void setText(String text)
      {
          this.text = text;
      }
  
      /**
       * Test method for method binding.
       */
      public String jumpHome()
      {
          System.out.println("JumpHome Action was called.");
          return "jump_home";
      }
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/example1/UCaseActionListener.java
  
  Index: UCaseActionListener.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.example1;
  
  import javax.faces.component.UIComponent;
  import javax.faces.context.FacesContext;
  import javax.faces.el.VariableResolver;
  import javax.faces.event.AbortProcessingException;
  import javax.faces.event.ActionEvent;
  import javax.faces.event.ActionListener;
  
  /**
   * DOCUMENT ME!
   * @author Manfred Geiler
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:38 $
   */
  public class UCaseActionListener
      implements ActionListener
  {
      public void processAction(ActionEvent event) throws AbortProcessingException
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          UIComponent component = event.getComponent();
  
          VariableResolver vr = facesContext.getApplication().getVariableResolver();
          UCaseForm form = (UCaseForm)vr.resolveVariable(facesContext, "ucaseForm");
          if (component.getId().equals("ucaseButton"))
          {
              form.uppercase();
          }
          else
          {
              form.lowercase();
          }
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/example1/CalcForm.java
  
  Index: CalcForm.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.example1;
  
  import java.io.Serializable;
  import java.math.BigDecimal;
  
  /**
   * DOCUMENT ME!
   * @author Manfred Geiler
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:38 $
   */
  public class CalcForm
      implements Serializable
  {
      private BigDecimal number1 = new BigDecimal(0);
      private BigDecimal number2 = new BigDecimal(0);
      private BigDecimal result = new BigDecimal(0);
  
      public void add()
      {
          result = number1.add(number2);
      }
  
      public void subtract()
      {
          result = number1.subtract(number2);
      }
  
      public BigDecimal getNumber1()
      {
          return number1;
      }
  
      public void setNumber1(BigDecimal number1)
      {
          this.number1 = number1;
      }
  
      public BigDecimal getNumber2()
      {
          return number2;
      }
  
      public void setNumber2(BigDecimal number2)
      {
          this.number2 = number2;
      }
  
      public BigDecimal getResult()
      {
          return result;
      }
  
      public void setResult(BigDecimal result)
      {
          this.result = result;
      }
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/example1/ValidationController.java
  
  Index: ValidationController.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.example1;
  
  import javax.faces.component.UIInput;
  import javax.faces.context.FacesContext;
  import javax.faces.validator.LengthValidator;
  import javax.faces.validator.LongRangeValidator;
  import javax.faces.validator.Validator;
  
  /**
   * DOCUMENT ME!
   * @author Manfred Geiler
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:38 $
   */
  public class ValidationController
  {
      public String enableValidation()
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
  
          UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
          Validator[] validators = number1.getValidators();
          if (validators == null || validators.length == 0)
          {
              number1.addValidator(new LongRangeValidator(10, 1));
          }
  
          UIInput number2 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
          validators = number2.getValidators();
          if (validators == null || validators.length == 0)
          {
              number2.addValidator(new LongRangeValidator(50, 20));
          }
  
          UIInput text = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
          validators = text.getValidators();
          if (validators == null || validators.length == 0)
          {
              text.addValidator(new LengthValidator(7, 3));
          }
  
          return "ok";
      }
  
      public String disableValidation()
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
  
          UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
          Validator[] validators = number1.getValidators();
          if (validators != null)
          {
              for (int i = 0; i < validators.length; i++)
              {
                  Validator validator = validators[i];
                  number1.removeValidator(validator);
              }
          }
  
          UIInput number2 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
          validators = number2.getValidators();
          if (validators != null)
          {
              for (int i = 0; i < validators.length; i++)
              {
                  Validator validator = validators[i];
                  number2.removeValidator(validator);
              }
          }
  
          UIInput text = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
          validators = text.getValidators();
          if (validators != null)
          {
              for (int i = 0; i < validators.length; i++)
              {
                  Validator validator = validators[i];
                  text.removeValidator(validator);
              }
          }
  
          return "ok";
      }
  
  
  
      public String getNumber1ValidationLabel()
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
          Validator[] validators = number1.getValidators();
          if (validators != null && validators.length > 0)
          {
              long min = ((LongRangeValidator)validators[0]).getMinimum();
              long max = ((LongRangeValidator)validators[0]).getMaximum();
              return " (" + min + "-" + max + ")";
          }
          else
          {
              return "";
          }
      }
  
      public String getNumber2ValidationLabel()
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
          Validator[] validators = number1.getValidators();
          if (validators != null && validators.length > 0)
          {
              long min = ((LongRangeValidator)validators[0]).getMinimum();
              long max = ((LongRangeValidator)validators[0]).getMaximum();
              return " (" + min + "-" + max + ")";
          }
          else
          {
              return "";
          }
      }
  
      public String getTextValidationLabel()
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
          Validator[] validators = number1.getValidators();
          if (validators != null && validators.length > 0)
          {
              long min = ((LengthValidator)validators[0]).getMinimum();
              long max = ((LengthValidator)validators[0]).getMaximum();
              return " (" + min + "-" + max + " chars)";
          }
          else
          {
              return "";
          }
      }
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/example1/CalcActionListener.java
  
  Index: CalcActionListener.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.example1;
  
  import javax.faces.component.UIComponent;
  import javax.faces.context.FacesContext;
  import javax.faces.el.VariableResolver;
  import javax.faces.event.AbortProcessingException;
  import javax.faces.event.ActionEvent;
  import javax.faces.event.ActionListener;
  
  /**
   * DOCUMENT ME!
   * @author Manfred Geiler
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:38 $
   */
  public class CalcActionListener
      implements ActionListener
  {
      public void processAction(ActionEvent event) throws AbortProcessingException
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          UIComponent component = event.getComponent();
  
          VariableResolver vr = facesContext.getApplication().getVariableResolver();
          CalcForm form = (CalcForm)vr.resolveVariable(facesContext, "calcForm");
          if (component.getId().equals("addButton") ||
              component.getId().equals("href1"))
          {
              form.add();
          }
          else
          {
              form.subtract();
          }
      }
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/validate/ValidateForm.java
  
  Index: ValidateForm.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.validate;
  
  /**
   * @author mwessendorf
   */
  public class ValidateForm {
  
  	private String email = null;
  	private String email2 = null;
  	private String creditCardNumber = null;
  	private String regExpr = null;
  	
  	private String equal = null;
  	private String equal2 = null;
  	
  	
  
  	public String getEmail() {
  		return email;
  	}
  
  	public void setEmail(String string) {
  		email = string;
  	}
  	
  	public String submit(){
  		System.out.println("Action was called.");
  		return ("valid");
  	}
  
  	public String getCreditCardNumber() {
  		return creditCardNumber;
  	}
  
  	public void setCreditCardNumber(String string) {
  		creditCardNumber = string;
  	}
  
  	public String getEmail2() {
  		return email2;
  	}
  
  	public void setEmail2(String string) {
  		email2 = string;
  	}
  
  	/**
  	 * @return
  	 */
  	public String getRegExpr() {
  		return regExpr;
  	}
  
  	/**
  	 * @param string
  	 */
  	public void setRegExpr(String string) {
  		regExpr = string;
  	}
  
  	/**
  	 * @return
  	 */
  	public String getEqual2() {
  		return equal2;
  	}
  
  	/**
  	 * @param string
  	 */
  	public void setEqual2(String string) {
  		equal2 = string;
  	}
  
  	/**
  	 * @return
  	 */
  	public String getEqual() {
  		return equal;
  	}
  
  	/**
  	 * @param string
  	 */
  	public void setEqual(String string) {
  		equal = string;
  	}
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/util/ExampleMessagesResourceBundle.java
  
  Index: ExampleMessagesResourceBundle.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.util;
  
  import javax.faces.context.FacesContext;
  import java.util.Enumeration;
  import java.util.ResourceBundle;
  
  /**
   * DOCUMENT ME!
   * @author Manfred Geiler (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:38 $
   */
  public class ExampleMessagesResourceBundle
      extends ResourceBundle
  {
      private static String BUNDLE_NAME = "org.apache.myfaces.examples.resource.example_messages";
  
      protected ResourceBundle getMyBundle()
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          return ResourceBundle.getBundle(BUNDLE_NAME, facesContext.getViewRoot().getLocale());
      }
  
      protected Object handleGetObject(String key)
      {
          return getMyBundle().getObject(key);
      }
  
      public Enumeration getKeys()
      {
          return getMyBundle().getKeys();
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/util/GuiUtil.java
  
  Index: GuiUtil.java
  ===================================================================
  package org.apache.myfaces.examples.util;
  
  import javax.faces.context.FacesContext;
  import java.util.ResourceBundle;
  import java.util.MissingResourceException;
  import java.text.MessageFormat;
  
  /**
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:38 $
   */
  public class GuiUtil
  {
      private static String BUNDLE_NAME = "org.apache.myfaces.examples.resource.example_messages";
  
      public static String getMessageResource(String key, Object[] arguments)
      {
          FacesContext context = FacesContext.getCurrentInstance();
          String resourceString;
          try
          {
              ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_NAME, context.getViewRoot().getLocale());
              resourceString = bundle.getString(key);
          }
          catch (MissingResourceException e)
          {
              return key;
          }
  
          if (arguments == null) return resourceString;
  
          MessageFormat format = new MessageFormat(resourceString, context.getViewRoot().getLocale());
          return format.format(arguments);
      }
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/util/LocalizedSelectItem.java
  
  Index: LocalizedSelectItem.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.util;
  
  import javax.faces.model.SelectItem;
  
  /**
   * DOCUMENT ME!
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:38 $
   */
  public class LocalizedSelectItem
      extends SelectItem
  {
      public LocalizedSelectItem(String key)
      {
          super(key);
          String label = GuiUtil.getMessageResource(key, null);
          setLabel(label);
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/resource/example_messages_fr.properties
  
  Index: example_messages_fr.properties
  ===================================================================
  welcome = Bienvenue à
  today = Aujourd''hui, le {0,date,short}.
  
  
  nav_Home            = Page d'accueil
  nav_Examples        = Exemples
  nav_Sample_1        = Exemple 1
  nav_Sample_2        = Exemple 2
  nav_dataTable       = Maître/Détail
  nav_sortTable       = Table triable
  nav_Documentation   = Documentation
  nav_Features        = Caractéristiques
  nav_Info            = Info
  nav_Contact         = Contact
  nav_Copyright       = Copyright
  nav_Options         = Options
  nav_Components      = Composants
  nav_Selectbox       = Boîtes de sélection
  nav_FileUpload      = Upload de fichier
  nav_TabbedPane      = Panneau à onglets
  nav_Calendar        = Calendrier
  nav_dataList        = Listes dynamiques
  nav_tree            = Arbre
  nav_Validate		= Validations
  nav_rdfTicker		= Ticker Rdf
  nva_dataScroller    = DataScroller
  nav_Date			= TODO: Translate Date
  
  
  # buttons
  
  button_save = Sauvegarder
  button_apply = Appliquer
  button_cancel = Annuler
  button_delete = Effacer
  
  alt_logo = MyFaces - l''implémentation JSF open source
  
  option_lang = Voir cette page en
  option_layout = Disposition
  
  empty_selitem = Choisissez ...
  
  
  # components examples
  
  label_cars = Modèle
  label_colors = Couleurs
  label_color = Couleur
  label_extras = Extras
  button_calcprice = Calculer le prix
  msg_price = {0,choice,0#Configurer votre rêve le plus fou!|1< Votre prix: \u20AC\u00A0{0}}
  color_black = noir
  color_blue = bleu
  color_marine = bleu marine
  color_red = rouge
  extra_aircond = Air conditionné
  extra_sideab = Airbags de côté
  extra_mirrowheat = Rétroviseurs chauffés
  extra_leaderseat = Siéges en cuir
  discount_0 = Je ne veux pas de remise
  discount_1 = Je veux une remise cumulée
  discount_2 = Je veux une remise entreprise
  discount_2_0 = Les BeachBoys sont super
  discount_2_1 = Les Red Hot Chillis sont mieux
  discount_2_2 = Mon groupe favori
  radio_hint = Ce radio est une extension de myfaces, vous pouvez y intégrer de l''HTML dedans !
  sort_cartype = Type de voiture
  sort_carcolor = Couleur
  sales_tax = Taxe
  doors = Portes
  
  label_country_name = Pays
  label_country_iso = Code Iso
  new_country = Ajouter un pays ?
  country_edit_table = Editer tous les pays ?
  
  dataList_simple = Liste simple
  dataList_ul = Liste non ordonnée
  dataList_ol = Liste ordonnée
  
  dataScroller_pages = Page {0} / {1}
  date_comp_header=Tag input Date
  date_comp_text1=Entrez une date
  date_comp_text2=La date est :
  date_comp_text3=Entrez une heure
  date_comp_text4=L'heure est
  date_comp_text5=Entre la date et l'heure
  date_comp_text6=La date et l'heure sont :
  date_comp_button=Mise à jour
  popup_today_string=Aujourd'hui, le :
  popup_week_string=Sem.
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/resource/example_messages_ja.properties
  
  Index: example_messages_ja.properties
  ===================================================================
  welcome = \u3088\u3046\u3053\u305d
  today = \u4eca\u65e5\u306e\u65e5\u4ed8: {0,date,short}.
  
  
  nav_Home            = \u30db\u30fc\u30e0
  nav_Examples        = \u30b5\u30f3\u30d7\u30eb
  nav_Sample_1        = \u30b5\u30f3\u30d7\u30eb 1
  nav_Sample_2        = \u30b5\u30f3\u30d7\u30eb 2
  nav_dataTable       = \u30c7\u30fc\u30bf\u30c6\u30fc\u30d6\u30eb
  nav_sortTable       = \u30bd\u30fc\u30c8\u6e08\u307f\u30c6\u30fc\u30d6\u30eb
  nav_Documentation   = \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8
  nav_Features        = \u7279\u5fb4
  nav_Info            = \u60c5\u5831
  nav_Contact         = \u30b3\u30f3\u30bf\u30af\u30c8
  nav_Copyright       = \u8457\u4f5c\u6a29
  nav_Options         = \u30aa\u30d7\u30b7\u30e7\u30f3
  nav_Components      = \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8
  nav_Selectbox       = \u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9
  nav_FileUpload      = \u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9
  nav_TabbedPane      = \u30bf\u30d6\u30d1\u30cd\u30eb
  nav_Calendar        = \u30ab\u30ec\u30f3\u30c0\u30fc
  nav_dataList        = \u30c0\u30a4\u30ca\u30df\u30c3\u30af\u30ea\u30b9\u30c8
  nav_tree            =\u30c4\u30ea\u30fc
  nav_Validate		= \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3
  nav_rssTicker		= RSS\u30c6\u30a3\u30c3\u30ab\u30fc
  nav_dataScroller    = \u30c7\u30fc\u30bf\u30b9\u30af\u30ed\u30fc\u30e9
  nav_Date			= \u65e5\u4ed8
  nav_panelstack      = \u30d1\u30cd\u30eb\u30b9\u30bf\u30c3\u30af
  # buttons
  
  button_save = \u4fdd\u5b58
  button_apply = \u9069\u7528
  button_cancel = \u30ad\u30e3\u30f3\u30bb\u30eb
  button_delete = \u524a\u9664
  button_submit = \u9001\u4fe1
  
  alt_logo = MyFaces - \u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9JSF\u5b9f\u88c5
  
  option_lang = \u8868\u793a\u3059\u308b\u8a00\u8a9e
  option_layout = \u30ec\u30a4\u30a2\u30a6\u30c8
  
  empty_selitem = \u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044
  
  # sample1
  
  sample1_form = \u30d5\u30a9\u30fc\u30e0
  sample1_another_form = \u5225\u306e\u30d5\u30a9\u30fc\u30e0\u4f8b
  sample1_validation = \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3
  sample1_number = \u6570\u5b57
  sample1_add = \u548c\u3092\u8a08\u7b97
  sample1_sub = \u5dee\u3092\u8a08\u7b97
  sample1_add_link = \u3053\u306e\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u548c\u3092\u8a08\u7b97
  sample1_sub_link = \u3053\u306e\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u5dee\u3092\u8a08\u7b97
  sample1_result = \u7d50\u679c
  sample1_text = \u30c6\u30ad\u30b9\u30c8
  sample1_uppercase = \u5927\u6587\u5b57\u3078\u5909\u63db
  sample1_lowercase = \u5c0f\u6587\u5b57\u3078\u5909\u63db
  sample1_disable_validation = \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u6709\u52b9\u306b\u3059\u308b
  sample1_enable_validation = \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u7121\u52b9\u306b\u3059\u308b
  
  # components examples
  
  label_cars = \u30e2\u30c7\u30eb
  label_colors = \u8272
  label_color = \u8272
  label_extras = \u30aa\u30d7\u30b7\u30e7\u30f3
  button_calcprice = \u4fa1\u683c\u306e\u8a08\u7b97
  msg_price = {0,choice,0#\u6761\u4ef6\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044!|1< \u898b\u7a4d\u4fa1\u683c: \u20AC\u00A0{0}}
  color_black = \u9ed2
  color_blue = \u9752
  color_marine = \u30de\u30ea\u30f3\u30d6\u30eb\u30fc
  color_red = \u8d64
  extra_aircond = \u30a8\u30a2\u30b3\u30f3
  extra_sideab = \u30b5\u30a4\u30c9\u30a8\u30a2\u30fc\u30d0\u30c3\u30b0
  extra_mirrowheat = \u71b1\u7dda\u4ed8\u304d\u30c9\u30a2\u30df\u30e9\u30fc
  extra_leaderseat = \u30ec\u30b6\u30fc\u30b7\u30fc\u30c8
  discount_0 = \u5272\u5f15\u4e0d\u8981
  discount_1 = \u4e00\u62ec\u8cfc\u5165\u5272\u5f15
  discount_2 = \u6cd5\u4eba\u5272\u5f15
  discount_2_0 = \u30d3\u30fc\u30c1\u30dc\u30fc\u30a4\u30ba\u306f\u7d20\u6674\u3089\u3057\u3044
  discount_2_1 = \u30ec\u30c3\u30c9\u30db\u30c3\u30c8\u30c1\u30ea\u30da\u30c3\u30d1\u306f\u3088\u308a\u3088\u3044
  discount_2_2 = \u79c1\u306e\u597d\u304d\u306a\u30d0\u30f3\u30c9
  radio_hint = \u3053\u306e\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306fmyfaces\u62e1\u5f35\u3067\u3059 - \u3042\u306a\u305f\u306f\u3053\u3053\u306bhtml\u306e\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059
  sort_cartype = \u8eca\u306e\u578b
  sort_carcolor = \u8eca\u306e\u8272
  sales_tax = \u7a0e\u91d1
  doors = \u30c9\u30a2
  
  validate_email = \u30e1\u30fc\u30eb
  validate_credit = \u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9
  validate_regexp = \u6b63\u898f\u8868\u73fe
  validate_equal = \u6587\u5b57\u5217\u306e\u30de\u30c3\u30c1
  
  label_country_name = \u56fd
  label_country_iso = ISO\u30b3\u30fc\u30c9
  label_country_cities = \u5e02\u753a\u6751
  new_country = \u65b0\u3057\u3044\u56fd\u306e\u8ffd\u52a0
  country_edit_table = \u5168\u3066\u306e\u56fd\u306e\u7de8\u96c6
  
  dataList_simple = \u30b7\u30f3\u30d7\u30eb\u30ea\u30b9\u30c8
  dataList_ul = \u756a\u53f7\u306a\u3057\u30ea\u30b9\u30c8
  dataList_ol = \u756a\u53f7\u4ed8\u304d\u30ea\u30b9\u30c8
  
  dataScroller_pages = \u30da\u30fc\u30b8 {0} / {1}
  date_comp_header = \u65e5\u4ed8\u5165\u529b\u30bf\u30b0
  date_comp_text1 = \u65e5\u4ed8\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044
  date_comp_text2 = \u65e5\u4ed8:
  date_comp_text3 = \u6642\u523b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044
  date_comp_text4 = \u6642\u523b:
  date_comp_text5 = \u65e5\u4ed8\u3068\u6642\u9593\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044
  date_comp_text6 = \u65e5\u4ed8\u3068\u6642\u9593:
  date_comp_button = \u66f4\u65b0
  popup_today_string = \u4eca\u65e5\u306f :
  popup_week_string = \u9031
  
  
  selectBoxPanel=\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u30d1\u30cd\u30eb
  treePanel=\u30c4\u30ea\u30fc\u30d1\u30cd\u30eb
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/resource/example_messages_en.properties
  
  Index: example_messages_en.properties
  ===================================================================
  # default is en, so nothing is required here
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/resource/example_messages_de.properties
  
  Index: example_messages_de.properties
  ===================================================================
  welcome = Willkommen zu
  today = Heute ist der {0,date,short}.
  
  
  nav_Home            = Startseite
  nav_Examples        = Beispiele
  nav_Sample_1        = Beispiel 1
  nav_Sample_2        = Beispiel 2
  nav_dataTable       = Master/Detail Beispiel
  nav_sortTable       = Sortierbare Tabelle
  nav_Documentation   = Dokumentation
  nav_Features        = Features
  nav_Info            = Info
  nav_Contact         = Kontakt
  nav_Copyright       = Copyright
  nav_Options         = Einstellungen
  nav_Components      = Komponenten
  nav_Selectbox       = Selectboxen
  nav_FileUpload      = Datei hochladen
  nav_TabbedPane      = Karteireiter
  nav_Calendar        = Kalender
  nav_dataList        = Dynamische Listen
  nav_tree            = Baum
  nav_Validate		= Validierungen
  nav_rssTicker		= RssTicker
  nav_dataScroller    = DataScroller
  nav_Date			= Datum
  
  # buttons
  
  button_save = Speichern
  button_apply = Übernehmen
  button_cancel = Abbrechen
  button_delete = Löschen
  
  alt_logo = MyFaces - Die Opensource JSF Implementierung
  
  option_lang = Sprachauswahl
  option_layout = Layout
  
  empty_selitem = Bitte auswählen ...
  
  
  # components examples
  
  label_cars = Modell
  label_colors = Farben
  label_color = Farbe
  label_extras = Extras
  button_calcprice = Preis berechnen
  msg_price = {0,choice,0#Stell dir dein Traumauto zusammen!|1< Dein Preis: \u20AC\u00A0{0}}
  color_black = schwarz
  color_blue = blau
  color_marine = Marine blau
  color_red = rot
  extra_aircond = Klima-Anlage
  extra_sideab = Seitenairbag
  extra_mirrowheat = Geheizte Aussenspiegel
  extra_leaderseat = Ledersitze
  discount_0 = Ich will keinen Rabatt
  discount_1 = Ich will den Treuerabatt
  discount_2 = Ich will den Großkundenrabatt
  discount_2_0 = BeachBoys sind super
  discount_2_1 = Red Hot Chillis sind besser
  discount_2_2 = Meine Lieblingsband
  radio_hint = This Radio is a myfaces extension - you can use html code here!
  sort_cartype = Typ
  sort_carcolor = Farbe
  sales_tax = Mehrwertsteuer
  Doors=Türen
  
  label_country_name = Land
  label_country_iso = Iso-Code
  new_country = Neues Land anlegen »
  country_edit_table = Alle Länder bearbeiten »
  
  dataList_simple = Einfache Liste
  dataList_ul = Unsortierte Liste
  dataList_ol = Nummerierte Liste
  
  dataScroller_pages = Seite {0} / {1}
  date_comp_header=Datumskomponente
  date_comp_text1=Geben Sie ein Datum an
  date_comp_text2=Das Datum ist:
  date_comp_text3=Geben Sie eine Uhrzeit an
  date_comp_text4=Die Uhrzeit ist:
  date_comp_text5=Geben Sie Datum und Uhrzeit an
  date_comp_text6=Datum und Uhrzeit:
  date_comp_button=Aktualisieren
  popup_today_string=Heute ist :
  popup_week_string=KW
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/resource/example_messages.properties
  
  Index: example_messages.properties
  ===================================================================
  welcome = Welcome to
  today = Today is the {0,date,short}.
  
  
  nav_Home            = Home
  nav_Examples        = Examples
  nav_Sample_1        = Sample 1
  nav_Sample_2        = Sample 2
  nav_dataTable       = Master/Detail Example
  nav_sortTable       = Sortable Table
  nav_Documentation   = Documentation
  nav_Features        = Features
  nav_Info            = Info
  nav_Contact         = Contact
  nav_Copyright       = Copyright
  nav_Options         = Options
  nav_Components      = Components
  nav_Selectbox       = Selectboxes
  nav_FileUpload      = File upload
  nav_TabbedPane      = Tabbed Pane
  nav_Calendar        = Calendar
  nav_dataList        = Dynamic Lists
  nav_tree            = Tree
  nav_Validate		= Validations
  nav_rssTicker		= RssTicker
  nav_dataScroller    = DataScroller
  nav_Date			= Date
  nav_panelstack      = Panel Stack
  # buttons
  
  button_save = Save
  button_apply = Apply
  button_cancel = Cancel
  button_delete = Delete
  button_submit = Submit
  
  alt_logo = MyFaces - the open source JSF implementation
  
  option_lang = View this page in
  option_layout = Layout
  
  empty_selitem = Please select ...
  
  # sample1
  
  sample1_form = A Form
  sample1_another_form = Another Form
  sample1_validation = Validation
  sample1_number = Number
  sample1_add = Add them
  sample1_sub = Subtract them
  sample1_add_link = Add them by clicking this link
  sample1_sub_link = Subtract them by clicking this link
  sample1_result = Result
  sample1_text = Text
  sample1_uppercase = Make it uppercase
  sample1_lowercase = Make it lowercase
  sample1_disable_validation = Disable validation
  sample1_enable_validation = Enable validation
  
  
  # components examples
  
  label_cars = Model
  label_colors = Colors
  label_color = Color
  label_extras = Extras
  button_calcprice = Calculate price
  msg_price = {0,choice,0#Configure your fondest wish!|1< Your price: \u20AC\u00A0{0}}
  color_black = black
  color_blue = blue
  color_marine = marine blue
  color_red = red
  extra_aircond = Aircondition
  extra_sideab = Sideairbag
  extra_mirrowheat = Heated Mirrors
  extra_leaderseat = Leatherseats
  discount_0 = I want no rebate
  discount_1 = I want an aggregated rebate
  discount_2 = I want a corporate client rebate
  discount_2_0 = BeachBoys are great
  discount_2_1 = Red Hot Chillis are better
  discount_2_2 = My favourite Band
  radio_hint = This Radio is a myfaces extension - you can use html code here!
  sort_cartype = Car type
  sort_carcolor = Car color
  sales_tax = Sales Tax
  doors=Doors
  
  validate_email = Email
  validate_credit = Credit Card
  validate_regexp = Regular Expression
  validate_equal = Equal
  
  label_country_name = Country
  label_country_iso = Iso-Code
  label_country_cities = Cities
  new_country = Add New Country »
  country_edit_table = Edit all Countries »
  
  dataList_simple = Simple list
  dataList_ul = Unordered list
  dataList_ol = Ordered list
  
  dataScroller_pages = Page {0} / {1}
  date_comp_header=Date input tag
  date_comp_text1=Gimme a date
  date_comp_text2=Date is:
  date_comp_text3=Gimme a time
  date_comp_text4=Time is:
  date_comp_text5=Gimme a date & time
  date_comp_text6=Date time is:
  date_comp_button=Update
  popup_today_string=Today is :
  popup_week_string=Wk
  
  
  selectBoxPanel=SelectBox Panel
  treePanel=Tree Panel
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/listexample/SimpleCar.java
  
  Index: SimpleCar.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.listexample;
  
  import java.io.Serializable;
  
  /**
   * DOCUMENT ME!
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class SimpleCar
          implements Serializable
  {
      private int _id;
      private String _type;
      private String _color;
  
      public SimpleCar(int id, String type, String color)
      {
          _id = id;
          _type = type;
          _color = color;
      }
  
      public int getId()
      {
          return _id;
      }
  
      public void setId(int id)
      {
          _id = id;
      }
  
      public String getType()
      {
          return _type;
      }
  
      public void setType(String type)
      {
          _type = type;
      }
  
      public String getColor()
      {
          return _color;
      }
  
      public void setColor(String color)
      {
          _color = color;
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/listexample/SimpleCountry.java
  
  Index: SimpleCountry.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.listexample;
  
  import java.io.Serializable;
  import java.math.BigDecimal;
  import java.util.List;
  import java.util.Arrays;
  import java.util.Collections;
  
  /**
   * DOCUMENT ME!
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class SimpleCountry
          implements Serializable
  {
      private long _id;
      private String _name;
      private String _isoCode;
      private BigDecimal _size;
      private boolean _remove = false;
      private List _cities;
  
      public SimpleCountry(long id, String name, String isoCode, BigDecimal size, String[] cities)
      {
          _id = id;
          _name = name;
          _isoCode = isoCode;
          _size = size;
  
          if(cities!=null)
              _cities = Arrays.asList(cities);
          else
              _cities = Collections.EMPTY_LIST;
      }
  
      public long getId()
      {
          return _id;
      }
  
      public String getName()
      {
          return _name;
      }
  
      public String getIsoCode()
      {
          return _isoCode;
      }
  
      public BigDecimal getSize()
      {
          return _size;
      }
  
      public List getCities()
      {
          return _cities;
      }
  
      public void setId(long id)
      {
          _id = id;
      }
  
      public void setIsoCode(String isoCode)
      {
          _isoCode = isoCode;
      }
  
      public void setName(String name)
      {
          _name = name;
      }
  
      public void setSize(BigDecimal size)
      {
          _size = size;
      }
  
      public boolean isRemove()
      {
          return _remove;
      }
  
      public void setRemove(boolean remove)
      {
          _remove = remove;
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/listexample/DataScrollerList.java
  
  Index: DataScrollerList.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.listexample;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * DOCUMENT ME!
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class DataScrollerList
  {
      private List _list = new ArrayList();
      static
      {
      }
  
      public DataScrollerList()
      {
          for (int i = 1; i < 995; i++)
          {
              _list.add(new SimpleCar(i, "Car Type " + i, "blue"));
          }
      }
  
      public List getList()
      {
          return _list;
      }
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/listexample/SimpleSortableCarList.java
  
  Index: SimpleSortableCarList.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.listexample;
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Comparator;
  import java.util.List;
  
  /**
   * DOCUMENT ME!
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class SimpleSortableCarList
      extends SortableList
  {
      private List _cars;
  
      public SimpleSortableCarList()
      {
          super("type");
  
          _cars = new ArrayList();
          _cars.add(new SimpleCar(1, "car A", "red"));
          _cars.add(new SimpleCar(1, "car B", "blue"));
          _cars.add(new SimpleCar(1, "car C", "green"));
          _cars.add(new SimpleCar(1, "car D", "yellow"));
          _cars.add(new SimpleCar(1, "car E", "orange"));
      }
  
      public List getCars()
      {
          sort(getSort(), isAscending());
          return _cars;
      }
  
      protected boolean isDefaultAscending(String sortColumn)
      {
          return true;
      }
  
      protected void sort(final String column, final boolean ascending)
      {
          Comparator comparator = new Comparator()
          {
              public int compare(Object o1, Object o2)
              {
                  SimpleCar c1 = (SimpleCar)o1;
                  SimpleCar c2 = (SimpleCar)o2;
                  if (column == null)
                  {
                      return 0;
                  }
                  if (column.equals("type"))
                  {
                      return ascending ? c1.getType().compareTo(c2.getType()) : c2.getType().compareTo(c1.getType());
                  }
                  else if (column.equals("color"))
                  {
                      return ascending ? c1.getColor().compareTo(c2.getColor()) : c2.getColor().compareTo(c1.getColor());
                  }
                  else return 0;
              }
          };
          Collections.sort(_cars, comparator);
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/listexample/SimpleCountryForm.java
  
  Index: SimpleCountryForm.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.listexample;
  
  import javax.faces.context.FacesContext;
  
  
  /**
   * DOCUMENT ME!
   * @author Manfred Geiler (latest modification by $Author: matzew $)
   * @author Thomas Spiegl
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class SimpleCountryForm
  {
      private long _id;
      private String _name;
      private String _isoCode;
  
      public long getId()
      {
          return _id;
      }
  
      public void setId(long id)
      {
          _id = id;
          if (_id > 0)
          {
              SimpleCountry simpleCountry = getList().getSimpleCountry(_id);
              if (simpleCountry == null)
              {
                  return;
              }
              _name = simpleCountry.getName();
              _isoCode = simpleCountry.getIsoCode();
          }
      }
  
      public void setIsoCode(String isoCode)
      {
          _isoCode = isoCode;
      }
  
      public String getIsoCode()
      {
          return _isoCode;
      }
  
      public String getName()
      {
          return _name;
      }
  
      public void setName(String name)
      {
          _name = name;
      }
  
      private SimpleCountry getSimpleCountry()
      {
          return new SimpleCountry(_id, _name, _isoCode, null, null);
      }
  
      public String save()
      {
          getList().saveSimpleCountry(getSimpleCountry());
          return "ok_next";
      }
  
      public String delete()
      {
          getList().deleteSimpleCountry(getSimpleCountry());
          return "ok_next";
      }
  
      public String apply()
      {
          getList().saveSimpleCountry(getSimpleCountry());
          return "ok";
      }
  
      private SimpleCountryList getList()
      {
          Object obj = FacesContext.getCurrentInstance().getApplication().getVariableResolver()
              .resolveVariable(FacesContext.getCurrentInstance(), "countryList");
          return (SimpleCountryList) obj;
  
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/listexample/SimpleCountryList.java
  
  Index: SimpleCountryList.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.listexample;
  
  import java.math.BigDecimal;
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * DOCUMENT ME!
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class SimpleCountryList
  {
      private List _countries = new ArrayList();
      static
      {
      }
  
      SimpleCountry getSimpleCountry(long id)
      {
          for (int i = 0; i < _countries.size(); i++)
          {
              SimpleCountry country = (SimpleCountry)_countries.get(i);
              if (country.getId() == id)
              {
                  return country;
              }
          }
          return null;
      }
  
      long getNewSimpleCountryId()
      {
          long maxId = 0;
          for (int i = 0; i < _countries.size(); i++)
          {
              SimpleCountry country = (SimpleCountry)_countries.get(i);
              if (country.getId() > maxId)
              {
                  maxId = country.getId();
              }
          }
          return maxId + 1;
      }
  
      void saveSimpleCountry(SimpleCountry simpleCountry)
      {
          if (simpleCountry.getId() == 0)
          {
              simpleCountry.setId(getNewSimpleCountryId());
          }
          boolean found = false;
          for (int i = 0; i < _countries.size(); i++)
          {
              SimpleCountry country = (SimpleCountry)_countries.get(i);
              if (country.getId() == simpleCountry.getId())
              {
                  _countries.set(i, simpleCountry);
                  found = true;
              }
          }
          if (!found)
          {
              _countries.add(simpleCountry);
          }
      }
  
      void deleteSimpleCountry(SimpleCountry simpleCountry)
      {
          for (int i = 0; i < _countries.size(); i++)
          {
              SimpleCountry country = (SimpleCountry)_countries.get(i);
              if (country.getId() == simpleCountry.getId())
              {
                  _countries.remove(i);
              }
          }
      }
  
      public SimpleCountryList()
      {
          _countries.add(new SimpleCountry(1, "AUSTRIA", "AT", new BigDecimal(123),new String[]{"Wien","Graz","Linz","Salzburg"}));
          _countries.add(new SimpleCountry(2, "AZERBAIJAN", "AZ", new BigDecimal(535),new String[]{"Baku","Sumgait","Qabala","Agdam"}));
          _countries.add(new SimpleCountry(3, "BAHAMAS", "BS", new BigDecimal(1345623),new String[]{"Nassau","Alice Town","Church Grove","West End"}));
          _countries.add(new SimpleCountry(4, "BAHRAIN", "BH", new BigDecimal(346),new String[]{"Bahrain"}));
          _countries.add(new SimpleCountry(5, "BANGLADESH", "BD", new BigDecimal(456),new String[]{"Chittagong","Chandpur","Bogra","Feni"}));
          _countries.add(new SimpleCountry(6, "BARBADOS", "BB", new BigDecimal(45645),new String[]{"Grantley Adams"}));
      }
  
      public List getCountries()
      {
          return _countries;
      }
  
      public void setCountries(List countries)
      {
          _countries = countries;
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/listexample/SortableList.java
  
  Index: SortableList.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.listexample;
  
  
  
  /**
   * Convenient base class for sortable lists.
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public abstract class SortableList
  {
      private String _sort;
      private boolean _ascending;
  
      protected SortableList(String defaultSortColumn)
      {
          _sort = defaultSortColumn;
          _ascending = isDefaultAscending(defaultSortColumn);
      }
  
      /**
       * Sort the list.
       */
      protected abstract void sort(String column, boolean ascending);
  
      /**
       * Is the default sort direction for the given column "ascending" ?
       */
      protected abstract boolean isDefaultAscending(String sortColumn);
  
  
      public void sort(String sortColumn)
      {
          if (sortColumn == null)
          {
              throw new IllegalArgumentException("Argument sortColumn must not be null.");
          }
  
          if (_sort.equals(sortColumn))
          {
              //current sort equals new sortColumn -> reverse sort order
              _ascending = !_ascending;
          }
          else
          {
              //sort new column in default direction
              _sort = sortColumn;
              _ascending = isDefaultAscending(_sort);
          }
  
          sort(_sort, _ascending);
      }
  
      public String getSort()
      {
          return _sort;
      }
  
      public void setSort(String sort)
      {
          _sort = sort;
      }
  
      public boolean isAscending()
      {
          return _ascending;
      }
  
      public void setAscending(boolean ascending)
      {
          _ascending = ascending;
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc/OptionsController.java
  
  Index: OptionsController.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.misc;
  
  import javax.faces.context.FacesContext;
  import javax.faces.el.VariableResolver;
  
  
  /**
   * DOCUMENT ME!
   * @author Manfred Geiler
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class OptionsController
  {
      public String changeLocale()
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          VariableResolver vr = facesContext.getApplication().getVariableResolver();
          OptionsForm form = (OptionsForm)vr.resolveVariable(facesContext, "optionsForm");
          facesContext.getViewRoot().setLocale(form.getLocale());
          return "ok";
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc/NavigationMenu.java
  
  Index: NavigationMenu.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.misc;
  
  import org.apache.myfaces.custom.navmenu.NavigationMenuItem;
  import org.apache.myfaces.examples.util.GuiUtil;
  
  /**
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class NavigationMenu
  {
      public NavigationMenuItem[] getInfoItems()
      {
          String label = GuiUtil.getMessageResource("nav_Info", null);
          NavigationMenuItem[] menu= new NavigationMenuItem[1];
  
          menu[0] = new NavigationMenuItem(label, null, null, true);
  
          NavigationMenuItem[] items = new NavigationMenuItem[2];
          menu[0].setNavigationMenuItems(items);
  
          label = GuiUtil.getMessageResource("nav_Contact", null);
          items[0] = new NavigationMenuItem(label, "go_contact", "jscookmenu/ThemeOffice/help.gif", false);
  
          label = GuiUtil.getMessageResource("nav_Copyright", null);
          items[1] = new NavigationMenuItem(label, "go_copyright", "jscookmenu/ThemeOffice/help.gif", false);
  
          return menu;
      }
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc/TabbedPaneBean.java
  
  Index: TabbedPaneBean.java
  ===================================================================
  package org.apache.myfaces.examples.misc;
  
  import java.io.Serializable;
  
  /**
   * @author Manfred Geiler (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class TabbedPaneBean
          implements Serializable
  {
      //private static final Log log = LogFactory.getLog(TabbedPaneBean.class);
  
      private boolean _tab1Visible = true;
      private boolean _tab2Visible = true;
      private boolean _tab3Visible = true;
  
      public boolean isTab1Visible()
      {
          return _tab1Visible;
      }
  
      public void setTab1Visible(boolean tab1Visible)
      {
          _tab1Visible = tab1Visible;
      }
  
      public boolean isTab2Visible()
      {
          return _tab2Visible;
      }
  
      public void setTab2Visible(boolean tab2Visible)
      {
          _tab2Visible = tab2Visible;
      }
  
      public boolean isTab3Visible()
      {
          return _tab3Visible;
      }
  
      public void setTab3Visible(boolean tab3Visible)
      {
          _tab3Visible = tab3Visible;
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc/OptionsForm.java
  
  Index: OptionsForm.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.misc;
  
  import javax.faces.context.FacesContext;
  import javax.faces.model.SelectItem;
  import java.util.AbstractList;
  import java.util.Arrays;
  import java.util.List;
  import java.util.Locale;
  
  /**
   * DOCUMENT ME!
   * @author Manfred Geiler (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class OptionsForm
  {
      private static final List AVAILABLE_LOCALES
          = Arrays.asList(new Locale[] {Locale.ENGLISH,
                                        Locale.GERMAN,
                                        Locale.JAPANESE,
                                        Locale.FRENCH});
  
      private Locale _locale = null;
  
      public String getLanguage()
      {
          return _locale != null
                  ? _locale.getLanguage()
                  : FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage();
      }
  
      public void setLanguage(String language)
      {
          _locale = new Locale(language);
      }
  
      public Locale getLocale()
      {
          return _locale;
      }
  
      public List getAvailableLanguages()
      {
          return new AbstractList()
          {
              public Object get(int index)
              {
                  Locale locale = (Locale)AVAILABLE_LOCALES.get(index);
                  String language = locale.getDisplayLanguage(locale);
                  return new SelectItem(locale.getLanguage(), language, language);
              }
  
              public int size()
              {
                  return AVAILABLE_LOCALES.size();
              }
          };
      }
  
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc/GlobalOptions.java
  
  Index: GlobalOptions.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.misc;
  
  /**
   * Global (dynamically changeable) options for examples application.
   * @author Manfred Geiler (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class GlobalOptions
  {
      private String _pageLayout;
  
      public String getPageLayout()
      {
          return _pageLayout;
      }
  
      public void setPageLayout(String pageLayout)
      {
          _pageLayout = pageLayout;
      }
  
  
      public String getNumericAsString() {
          return "23";
      }
  
      
      public long getNumeric() {
          return 23L;
      }
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/misc/FileUploadForm.java
  
  Index: FileUploadForm.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.misc;
  
  import java.io.IOException;
  
  import org.apache.myfaces.custom.fileupload.UploadedFile;
  
  import javax.faces.context.FacesContext;
  
  /**
   * @author Manfred Geiler (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class FileUploadForm
  {
      private UploadedFile _upFile;
      private String _name = "";
  
      public UploadedFile getUpFile()
      {
          return _upFile;
      }
  
      public void setUpFile(UploadedFile upFile)
      {
          _upFile = upFile;
      }
  
      public String getName()
      {
          return _name;
      }
  
      public void setName(String name)
      {
          _name = name;
      }
  
      public String upload() throws IOException
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          facesContext.getExternalContext().getApplicationMap().put("fileupload_bytes", _upFile.getBytes());
          facesContext.getExternalContext().getApplicationMap().put("fileupload_type", _upFile.getContentType());
          facesContext.getExternalContext().getApplicationMap().put("fileupload_name", _upFile.getName());
          return "ok";
      }
  
      public boolean isUploaded()
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          return facesContext.getExternalContext().getApplicationMap().get("fileupload_bytes")!=null;
      }
  
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/example2/QuotationForm.java
  
  Index: QuotationForm.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.example2;
  
  import javax.faces.model.SelectItem;
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * DOCUMENT ME!
   * @author Thomas Spiegl
   */
  public class QuotationForm
  {
      private String _text = "QuotationTest";
      private String _quoteChar;
      private String[] _selectManyValues;
  
      private SelectItem[] _selectItems = null;
      private List _selectManyItems = null;
  
  
  
      public QuotationForm()
      {
      }
  
  
      public String getText()
      {
          return _text;
      }
  
      public void setText(String text)
      {
          _text = text;
      }
  
      public String getQuoteChar()
      {
          return _quoteChar;
      }
  
      public void setQuoteChar(String value)
      {
          _quoteChar = value;
      }
  
      public SelectItem[] getSelectOneItems()
      {
          if (_selectItems == null)
          {
              _selectItems = new SelectItem[2];
              _selectItems[0] = new SelectItem("*", "Asterisk");
              _selectItems[1] = new SelectItem("+", "Plus");
          }
          return _selectItems;
      }
  
  
  
  
      public String[] getSelectManyValues()
      {
          return _selectManyValues;
      }
  
      public void setSelectManyValues(String[] value)
      {
          _selectManyValues = value;
      }
  
      public List getSelectManyItems()
      {
          if (_selectManyItems == null)
          {
              _selectManyItems = new ArrayList();
              _selectManyItems.add(new SelectItem("\"", "Double"));
              _selectManyItems.add(new SelectItem("'", "Single"));
              _selectManyItems.add(new SelectItem("*", "Asterisk"));
              _selectManyItems.add(new SelectItem("+", "Plus"));
              _selectManyItems.add(new SelectItem("-", "Hyphen"));
          }
          return _selectManyItems;
      }
  
  
      public void quote()
      {
          if (_quoteChar != null)
          {
              _text = _quoteChar + _text + _quoteChar;
          }
      }
  
      public void unquote()
      {
          if (_selectManyValues != null)
          {
              for (int i = 0; i < _selectManyValues.length; i++)
              {
                  unquote(_selectManyValues[i]);
              }
          }
      }
  
      private void unquote(String quoteChar)
      {
          if (quoteChar != null && quoteChar.length() > 0)
          {
              if (_text.startsWith(quoteChar))
              {
                  _text = _text.substring(1);
              }
  
              if (_text.endsWith(quoteChar))
              {
                  _text = _text.substring(0, _text.length() - 1);
              }
          }
      }
  
  }
  
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/example2/QuotationController.java
  
  Index: QuotationController.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.example2;
  
  import javax.faces.component.UIComponent;
  import javax.faces.context.FacesContext;
  import javax.faces.el.VariableResolver;
  import javax.faces.event.AbortProcessingException;
  import javax.faces.event.ActionEvent;
  import javax.faces.event.ActionListener;
  import javax.faces.event.PhaseId;
  
  /**
   * DOCUMENT ME!
   * @author Thomas Spiegl
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class QuotationController
      implements ActionListener
  {
      public void processAction(ActionEvent event) throws AbortProcessingException
      {
          if (event.getPhaseId() == PhaseId.INVOKE_APPLICATION)
          {
              FacesContext facesContext = FacesContext.getCurrentInstance();
              UIComponent component = event.getComponent();
  
              VariableResolver vr = facesContext.getApplication().getVariableResolver();
              QuotationForm form = (QuotationForm)vr.resolveVariable(facesContext, "q_form");
              if (component.getId().equals("button1"))
              {
                  form.quote();
              }
              else
              {
                  form.unquote();
              }
          }
  
      }
      
      public PhaseId getPhaseId()
      {
          return PhaseId.UPDATE_MODEL_VALUES;
      }
  }
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/calendarexample/DateHolder.java
  
  Index: DateHolder.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.calendarexample;
  
  import java.util.Date;
  
  /**
   * DOCUMENT ME!
   * @author Martin Marinschek (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class DateHolder
  {
      private Date _date = new Date();
  
      public Date getDate()
      {
          return _date;
      }
  
      public void setDate(Date date)
      {
          _date = date;
      }
  }
  
  
  
  1.1                  incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/common/CarConfigurator.java
  
  Index: CarConfigurator.java
  ===================================================================
  /*
   * Copyright 2004 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.
   */
  package org.apache.myfaces.examples.common;
  
  import org.apache.myfaces.examples.util.LocalizedSelectItem;
  
  import javax.faces.application.FacesMessage;
  import javax.faces.component.UIComponent;
  import javax.faces.context.FacesContext;
  import javax.faces.model.SelectItem;
  import javax.faces.validator.ValidatorException;
  import java.io.Serializable;
  import java.math.BigDecimal;
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
  
  /**
   * @author Thomas Spiegl (latest modification by $Author: matzew $)
   * @version $Revision: 1.1 $ $Date: 2004/10/20 07:46:39 $
   */
  public class CarConfigurator
          implements Serializable
  {
      private static List _cars;
      private static List _colors;
      private static List _extrasList;
      private static HashMap _priceList = new HashMap();
      private static HashMap _priceFactorColors = new HashMap();
      private static HashMap _priceListExtras = new HashMap();
      static
      {
          _cars = new ArrayList();
          _colors = new ArrayList();;
          _extrasList = new ArrayList();;
  
          _cars.add(new SelectItem("c1", "Audee X6", null));
          _cars.add(new SelectItem("c2", "PMW 321u", null));
          _cars.add(new SelectItem("c3", "Masta ZX7", null));
          _cars.add(new SelectItem("c4", "Renolt ESP", null));
          _cars.add(new SelectItem("c5", "WV Lumpo", null));
          _cars.add(new SelectItem("c6", "James Blond Car", null));
          _cars.add(new SelectItem("c7", "Neko Bus", null));
  
          _colors.add(new LocalizedSelectItem("color_black"));
          _colors.add(new LocalizedSelectItem("color_blue"));
          _colors.add(new LocalizedSelectItem("color_marine"));
          _colors.add(new LocalizedSelectItem("color_red"));
  
          _extrasList.add(new LocalizedSelectItem("extra_aircond"));
          _extrasList.add(new LocalizedSelectItem("extra_sideab"));
          _extrasList.add(new LocalizedSelectItem("extra_mirrowheat"));
          _extrasList.add(new LocalizedSelectItem("extra_leaderseat"));
  
          _priceList.put("c1", new BigDecimal(30000));
          _priceList.put("c2", new BigDecimal(32000));
          _priceList.put("c3", new BigDecimal(20000));
          _priceList.put("c4", new BigDecimal(25000));
          _priceList.put("c5", new BigDecimal(10000));
          _priceList.put("c6", new BigDecimal(100000000));
          _priceList.put("c7", new BigDecimal(1000000000));
  
          _priceFactorColors.put("color_black", new BigDecimal(1.15));
          _priceFactorColors.put("color_blue", new BigDecimal(1.10));
          _priceFactorColors.put("color_marine", new BigDecimal(1.05));
          _priceFactorColors.put("color_red", new BigDecimal(1.0));
  
          _priceListExtras.put("extra_aircond", new BigDecimal(510));
          _priceListExtras.put("extra_sideab", new BigDecimal(1220));
          _priceListExtras.put("extra_mirrowheat", new BigDecimal(1230));
          _priceListExtras.put("extra_leaderseat", new BigDecimal(840));
      }
  
  
      private BigDecimal _price = new BigDecimal(0);
      private String[] _extras;
      private String _discount = "0";
      private String _discount2 = "0";
      private String _bandName;
      private String _car;
      private String _color = "color_blue";
      private boolean _salesTax = false;
      private int _doors = 4;
  
      public CarConfigurator()
      {
      }
  
  
      public int getDoors()
      {
          return _doors;
      }
  
  
      public void setDoors(int doors)
      {
          this._doors = doors;
      }
  
  
      public List getCars()
      {
          return _cars;
      }
  
      public List getColors()
      {
          return _colors;
      }
  
      public List getExtrasList()
      {
          return _extrasList;
      }
  
      public String getCar()
      {
          return _car;
      }
  
      public void setCar(String car)
      {
          _car = car;
      }
  
      public String getColor()
      {
          return _color;
      }
  
      public void setColor(String color)
      {
          _color = color;
      }
  
      public BigDecimal getPrice()
      {
          return _price;
      }
  
      public void setPrice(BigDecimal price)
      {
          _price = price;
      }
  
      public String[] getExtras()
      {
          return _extras;
      }
  
      public void setExtras(String[] extras)
      {
          _extras = extras;
      }
  
      public String getDiscount()
      {
          return _discount;
      }
  
      public void setDiscount(String discount)
      {
          _discount = discount;
      }
  
      public String getDiscount2()
      {
          return _discount2;
      }
  
      public void setDiscount2(String discount2)
      {
          _discount2 = discount2;
      }
  
      public String getBandName()
      {
          return _bandName;
      }
  
      public void setBandName(String bandName)
      {
          _bandName = bandName;
      }
  
      public boolean isSalesTax()
      {
          return _salesTax;
      }
  
      public void setSalesTax(boolean salesTax)
      {
          _salesTax = salesTax;
      }
  
      public String calcPrice()
      {
          String car = getCar();
          String color = getColor();
          if (car == null ||
              color == null)
          {
              _price = new BigDecimal(0);
              return "ok";
          }
  
          BigDecimal carprice = (BigDecimal)_priceList.get(car);
          BigDecimal colorfactor = (BigDecimal)_priceFactorColors.get(color);
          if (carprice == null ||
              colorfactor == null)
          {
              _price = new BigDecimal(0);
              return "ok";
          }
          _price = carprice.multiply(colorfactor);
  
          String[] extras = getExtras();
          if (extras != null)
          {
              for (int i = 0; i < extras.length; i++)
              {
                  String extra = extras[i];
                  _price = _price.add((BigDecimal)_priceListExtras.get(extra));
              }
          }
  
          if (_discount != null)
          {
              try
              {
                  int i = Integer.parseInt(_discount);
                  switch (i)
                  {
                      case 0: break;
                      case 1: _price = _price.multiply(new BigDecimal(0.95)); break;
                      case 2: _price = _price.multiply(new BigDecimal(0.91)); break;
                  }
              }
              catch (NumberFormatException e)
              {
              }
          }
  
          if (_discount2 != null)
          {
              try
              {
                  int i = Integer.parseInt(_discount2);
                  switch (i)
                  {
                      case 1: _price = _price.multiply(new BigDecimal(0.85)); break;
                      case 2: _price = _price.multiply(new BigDecimal(0.80)); break;
                      case 3: _price = _price.multiply(new BigDecimal(0.6)); break;
                  }
              }
              catch (NumberFormatException e)
              {
              }
          }
  
          if (_salesTax)
          {
              _price = _price.multiply(new BigDecimal(1.2));
          }
  
          return "ok";
      }
  
  
      public void validateCar(FacesContext context, UIComponent component, Object value) throws ValidatorException
      {
          if (value instanceof String && value.equals("c6"))
          {
              throw new ValidatorException(new FacesMessage("Are you kidding?", "You cannot buy a James Blond car!"));
          }
      }
  
  
  }
  
  
  

Mime
View raw message