Package com.sun.star.lang

Examples of com.sun.star.lang.Locale


            chars[0] = ch ; chars[1] = (char) (ch + 1) ;
            result &= testCompareString(chars, col) ;
        }

        log.println(" #### Testing China locale ####") ;
        oObj.loadDefaultCollator(new Locale("zh", "CN", ""), 0) ;
        col = Collator.getInstance(new java.util.Locale("zh", "CN")) ;
        for (char ch = 0x4E00; ch < 0x4EFD; ch ++) {
            chars[0] = ch ; chars[1] = (char) (ch + 1) ;
            result &= testCompareString(chars, col) ;
        }

        log.println(" #### Testing Korean locale ####") ;
        oObj.loadDefaultCollator(new Locale("ko", "KR", ""), 0) ;
        col = Collator.getInstance(new java.util.Locale("ko", "KR")) ;
        for (char ch = 0x4E00; ch < 0x4EFD; ch ++) {
            chars[0] = ch ; chars[1] = (char) (ch + 1) ;
            result &= testCompareString(chars, col) ;
        }
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

    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

    * 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

        //creating a user defined dictionary for XSearchableDictionaryList
        XDictionaryList xDicList = (XDictionaryList) UnoRuntime.queryInterface(
                                                    XDictionaryList.class, oObj);
        xDicList.removeDictionary(xDicList.getDictionaryByName("MyDictionary"));
        XDictionary xDic = xDicList.createDictionary("NegativDic",new Locale(
            "en","US","WIN"),com.sun.star.linguistic2.DictionaryType.NEGATIVE,"");
        XDictionary xDic2 = xDicList.createDictionary("PositivDic",new Locale(
            "en","US","WIN"),com.sun.star.linguistic2.DictionaryType.POSITIVE,"");
        xDic2.add("Positiv",false,"");
        xDic.add("Negativ",true,"");
        xDicList.addDictionary(xDic);
        xDicList.addDictionary(xDic2);
View Full Code Here

                                throws IllegalArgumentException {
            return new String[] { "getConversion" };
        }

        public com.sun.star.lang.Locale getLocale() {
            return new Locale("de", "DE", "");
        }
View Full Code Here

    public void _isValid() {
        boolean res = true;
        try {
            log.println("Checking 'original' Spellchecker");
            PropertyValue[] empty = new PropertyValue[0] ;
            res &= oObj.isValid("Sun", new Locale("en","US",""), empty);
            res &= !oObj.isValid("Summersun", new Locale("en","US","") ,empty);
            log.println("Result so far is - "+ (res ? "OK" : "failed"));           
            log.println("Checking alternative Spellchecker");
            res &= alternative.isValid("Sun", new Locale("en","US",""), empty);
            res &= !alternative.isValid("Summersun", new Locale("en","US","") ,empty);           
        } catch (com.sun.star.lang.IllegalArgumentException ex) {
            log.println("Exception while checking 'isValid'");
            res = false;
            ex.printStackTrace(log);
        }
View Full Code Here

        boolean res = true;
        try {
            log.println("Checking 'original' Spellchecker");
            PropertyValue[] empty = new PropertyValue[0] ;
            XSpellAlternatives alt = oObj.spell(
                            "Summersun",new Locale("en","US",""),empty);
            String alternatives = alt.getAlternatives()[0];
            res = (alternatives != null);
            log.println("Result so far is - "+ (res ? "OK" : "failed"));           
            log.println("Checking alternative Spellchecker");
            alt =alternative.spell(
                            "Summersun",new Locale("en","US",""),empty);
            alternatives = alt.getAlternatives()[0];
            res &= (alternatives != null);
        } catch (com.sun.star.lang.IllegalArgumentException ex) {
            log.println("Exception while checking 'spell'");
            res = false;
View Full Code Here

    public void _hyphenate() {
        boolean res = true;
        PropertyValue[] Props = null;
        try {
            XHyphenatedWord result = oObj.hyphenate(
                    "wacker",new Locale("de","DE",""),(short)3,Props);
            res &= (result != null);
        } catch (com.sun.star.lang.IllegalArgumentException ex) {
            log.println("Exception while checking 'hyphenate'");
            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.