001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.web.jsf.api.facesmodel;
043:
044: import java.util.List;
045: import org.netbeans.modules.web.jsf.impl.facesmodel.JSFConfigQNames;
046:
047: /**
048: * The "locale-config" element allows the app developer to
049: * declare theĀ supported locales for this application.
050: *
051: * @author Petr Pisl
052: */
053: public interface LocaleConfig extends JSFConfigComponent {
054:
055: /**
056: * Property name of <default-locale> element.
057: */
058: public static final String DEFAULT_LOCALE = JSFConfigQNames.DEFAULT_LOCALE
059: .getLocalName();
060: /**
061: * Property name of <supported-locale> element.
062: */
063: public static final String SUPPORTED_LOCALE = JSFConfigQNames.SUPPORTED_LOCALE
064: .getLocalName();
065:
066: /**
067: * The "default-locale" element declares the default locale
068: * for this application instance.
069: *
070: * @return the default locale
071: */
072: DefaultLocale getDefaultLocale();
073:
074: /**
075: * The "default-locale" element declares the default locale
076: * for this application instance.
077: *
078: * It must be specified as :language:[_:country:[_:variant:]]
079: * without the colons, for example "ja_JP_SJIS". The
080: * separators between the segments may be '-' or '_'.
081: * @param locale the default locale
082: */
083: void setDefaultLocale(DefaultLocale locale);
084:
085: /**
086: * The "supported-locale" element allows authors to declare
087: * which locales are supported in this application instance.
088: *
089: * @return a list of supported locales
090: */
091: List<SupportedLocale> getSupportedLocales();
092:
093: /**
094: * The "supported-locale" element allows authors to declare
095: * which locales are supported in this application instance.
096: *
097: * It must be specified as :language:[_:country:[_:variant:]]
098: * without the colons, for example "ja_JP_SJIS". The
099: * separators between the segments may be '-' or '_'.
100: * @param locale the supported locale
101: */
102: void addSupportedLocales(SupportedLocale locale);
103:
104: /**
105: * The "supported-locale" element allows authors to declare
106: * which locales are supported in this application instance.
107: *
108: * It must be specified as :language:[_:country:[_:variant:]]
109: * without the colons, for example "ja_JP_SJIS". The
110: * separators between the segments may be '-' or '_'.
111: * @param index where will be putted
112: * @param locale the supported locale
113: */
114: void addSupportedLocales(int index, SupportedLocale locale);
115: }
|