Package com.sun.star.lang

Examples of com.sun.star.lang.Locale


    protected Locale[] locales = null;
    protected HashMap algorithms = new HashMap();

    public void _compareIndexEntry() {
        requiredMethod("getIndexKey()");
        Locale locale = new Locale("zh", "CN", "");
        String val1 = new String(new char[]{UnicodeStringPair.getUnicodeValue(0), UnicodeStringPair.getUnicodeValue(1)});
        String val2 = new String(new char[]{UnicodeStringPair.getUnicodeValue(1), UnicodeStringPair.getUnicodeValue(0)});
        short result1 = oObj.compareIndexEntry(val1, "", locale, val1, "", locale);
        short result2 = oObj.compareIndexEntry(val1, "", locale, val2, "", locale);
        short result3 = oObj.compareIndexEntry(val2, "", locale, val1, "", locale);
View Full Code Here


    public void _getPhoneticCandidate() {
        requiredMethod("getLocaleList()");

        boolean res = true;

        Locale loc = new Locale("zh", "CN", "");
       
        for (int i = 0;i<UnicodeStringPair.getValCount();i++) {            

            char[] c = new char[]{UnicodeStringPair.getUnicodeValue(i)};
View Full Code Here

    */
    public void _addDictionaryListEventListener() {
        listenerCalled = false;

        XDictionary xDic = oObj.createDictionary("ListenDic",
            new Locale("en","US","WIN"),
            com.sun.star.linguistic2.DictionaryType.POSITIVE,"");

        boolean res = oObj.addDictionaryListEventListener(listener, false);

        oObj.flushEvents();
View Full Code Here

    */
    public void _removeDictionaryListEventListener() {
        listenerCalled = false;

        XDictionary xDic = oObj.createDictionary("ListenDic",
            new Locale("en","US","WIN"),
            com.sun.star.linguistic2.DictionaryType.POSITIVE,"");

        oObj.addDictionaryListEventListener(listener,false);

        oObj.flushEvents();
View Full Code Here

    * Has <b> OK </b> status if number of dictionaries after method call is
    * greater than number of dictionaries before method call. <p>
    */
    public void _addDictionary() {
        short previous = oObj.getCount();
        addedDic = oObj.createDictionary("AddedDic",new Locale("en","US","WIN"),
                        com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
        addedDic.add("Positiv",false,"");

        oObj.addDictionary(addedDic);

View Full Code Here

    * Test calls the method and checks returned value. <p>
    * Has <b> OK </b> status if returned value isn't null. <p>
    */
    public void _createDictionary() {
        XDictionary tmpDic = oObj.createDictionary("AddedDic",
            new Locale("en","US","WIN"),
            com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
        tRes.tested("createDictionary()", tmpDic != null );
    }
View Full Code Here

    */
    public void _beginCollectEvents() {
        listenerCalled = false;

        XDictionary xDic = oObj.createDictionary("ListenDic",
            new Locale("en","US","WIN"),
            com.sun.star.linguistic2.DictionaryType.POSITIVE,"");

        oObj.addDictionaryListEventListener(listener,false);
        oObj.beginCollectEvents();

View Full Code Here

    * Method returns locale for a given language and country.
    * @param localeIndex index of needed locale.
    * @return Locale by the index from arrays defined above
    */
    public Locale getLocale(int k) {
        return new Locale(languages[k], countries[k], "");
    }
View Full Code Here

        for (int i=0; i< locales.length; i++) {
            res &= oObj.hasLocale(locales[i]);
        }

        // now create a invalid locale
        Locale invalid = new Locale("myLanguage","myCountry","");
        res &= !oObj.hasLocale(invalid);

        tRes.tested("hasLocale()", res);
    }
View Full Code Here

    */
    public void _queryMeanings() {
        boolean res = true;
        try {
            XMeaning[] mean = oObj.queryMeanings(
                "survive",new Locale("en","US",""), new PropertyValue[0]);
            res = (mean.length > 0);
        } catch (com.sun.star.lang.IllegalArgumentException ex) {
            log.println("Exception while checking 'queryMeanings'");
            res = false;
            ex.printStackTrace(log);
View Full Code Here

TOP

Related Classes of com.sun.star.lang.Locale

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.