Example usage for java.util Locale KOREA

List of usage examples for java.util Locale KOREA

Introduction

In this page you can find the example usage for java.util Locale KOREA.

Prototype

Locale KOREA

To view the source code for java.util Locale KOREA.

Click Source Link

Document

Useful constant for country.

Usage

From source file:com.example.seonoh2.smarttoliet01.beacon.RecoMonitoringActivity.java

@Override
public void didEnterRegion(RECOBeaconRegion recoRegion, Collection<RECOBeacon> beacons) {
    /**/*from  www .java 2  s .com*/
     * For the first run, this callback method will not be called.
     * Please check the state of the region using didDetermineStateForRegion() callback method.
     *
     *  , ?   ? .
     * didDetermineStateForRegion()    region ? ?  .
     */

    //Get the region and found beacon list in the entered region
    Log.i("RecoMonitoringActivity", "didEnterRegion() region:" + recoRegion.getUniqueIdentifier());
    this.popupNotification("Inside of  ? ?" + recoRegion.getUniqueIdentifier());

    mMonitoringListAdapter.updateRegion(recoRegion, RECOBeaconRegionState.RECOBeaconRegionInside,
            beacons.size(), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.KOREA).format(new Date()));
    mMonitoringListAdapter.notifyDataSetChanged();
    //Write the code when the device is enter the region
}

From source file:com.nbplus.vbroadlistener.BaseActivity.java

@Override
public void onInit(int status) {
    Log.d(TAG, "> TTS onInit()");

    LauncherSettings.getInstance(this).setIsCheckedTTSEngine(true);
    if (status != TextToSpeech.SUCCESS) {
        Log.e(TAG, String.format("TextToSpeechManager.onInit(%d) fail!", status));
        Log.d(TAG, "   ??.... ? ??...");
        if (mcheckText2SpeechLister != null) {
            mcheckText2SpeechLister.onCheckResult(null);
            mText2Speech.shutdown();//  w  ww .j ava  2 s.  c o  m
            mText2Speech = null;
        }
        showText2SpeechAlertDialog();
    } else {
        int result = mText2Speech.setLanguage(Locale.KOREA);
        if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
            Log.e(TAG, String.format("TextToSpeech.setLanguage(%s) fail!", Locale.KOREA.getDisplayName()));
            Log.d(TAG, "   ??.... ? ??...");
            if (mcheckText2SpeechLister != null) {
                mcheckText2SpeechLister.onCheckResult(null);
                mText2Speech.shutdown();
                mText2Speech = null;
            }
            showText2SpeechAlertDialog();
        } else {
            if (mcheckText2SpeechLister != null) {
                mcheckText2SpeechLister.onCheckResult(mText2Speech);

            } else {
                if (mcheckText2SpeechLister != null) {
                    mcheckText2SpeechLister.onCheckResult(null);
                    mText2Speech.shutdown();
                    mText2Speech = null;
                }
            }
        }
    }
}

From source file:org.talend.designer.core.ui.preferences.I18nPreferencePage.java

@Override
protected void createFieldEditors() {
    // Adds a combo for language selection.

    String spanish = "Espa\u00F1ol"; //$NON-NLS-1$
    byte[] utf8Bytes;
    try {/*from   w ww  .  j  a v a  2 s  . co  m*/
        utf8Bytes = spanish.getBytes("UTF8"); //$NON-NLS-1$
        spanish = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
    } catch (UnsupportedEncodingException e1) {
        // could be translated, but it's only in case of error when change UTF8 characters.
        spanish = "Spanish"; //$NON-NLS-1$
    }

    String russian = "\u0420\u0443\u0441\u0441\u043A\u0438\u0439"; //$NON-NLS-1$
    try {
        utf8Bytes = russian.getBytes("UTF8"); //$NON-NLS-1$
        russian = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
    } catch (UnsupportedEncodingException e1) {
        // could be translated, but it's only in case of error when change UTF8 characters.
        russian = "Russian"; //$NON-NLS-1$
    }

    String greek = "\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"; //$NON-NLS-1$
    try {
        utf8Bytes = greek.getBytes("UTF8"); //$NON-NLS-1$
        greek = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
    } catch (UnsupportedEncodingException e1) {
        // could be translated, but it's only in case of error when change UTF8 characters.
        greek = "Greek"; //$NON-NLS-1$
    }

    String arabic = "\u0627\u0644\u0639\u0631\u0628\u064a\u0647"; //$NON-NLS-1$
    try {
        utf8Bytes = arabic.getBytes("UTF8"); //$NON-NLS-1$
        arabic = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
    } catch (UnsupportedEncodingException e1) {
        // could be translated, but it's only in case of error when change UTF8 characters.
        arabic = "Arabic"; //$NON-NLS-1$
    }

    String serbian = "\u0421\u0440\u043f\u0441\u043a\u0438"; //$NON-NLS-1$
    try {
        utf8Bytes = serbian.getBytes("UTF8"); //$NON-NLS-1$
        serbian = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
    } catch (UnsupportedEncodingException e1) {
        // could be translated, but it's only in case of error when change UTF8 characters.
        serbian = "Serbian"; //$NON-NLS-1$
    }

    String[][] entryNamesAndValues = {
            { Locale.ENGLISH.getDisplayLanguage(Locale.ENGLISH), Locale.ENGLISH.getLanguage() },
            { Locale.FRENCH.getDisplayLanguage(Locale.FRENCH), Locale.FRENCH.getLanguage() },
            { Locale.CHINESE.getDisplayLanguage(Locale.CHINESE), "zh_CN" },
            { Locale.GERMAN.getDisplayLanguage(Locale.GERMAN), Locale.GERMAN.getLanguage() },
            { Locale.JAPANESE.getDisplayLanguage(Locale.JAPANESE), Locale.JAPANESE.getLanguage() },
            { Locale.ITALIAN.getDisplayLanguage(Locale.ITALIAN), Locale.ITALIAN.getLanguage() },
            { "Brasil", "pt_BR" }, //$NON-NLS-1$ //$NON-NLS-2$ 
            { spanish, "es" }, { russian, "ru" }, //$NON-NLS-1$ //$NON-NLS-2$ 
            { Locale.KOREA.getDisplayLanguage(Locale.KOREA), "kr" }, { "Turkish", "tr" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
            { greek, "el" }, { "Hrvatski", "hr" }, { arabic, "ar" }, { serbian, "sr" }, { "Polski", "pl" },
            { "Romanian", "ro" }, { "Netherlands", "nl" } }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ // /$NON-NLS-7$ 
    languageSelectionEditor = new OneLineComboFieldEditor(ITalendCorePrefConstants.LANGUAGE_SELECTOR,
            Messages.getString("I18nPreferencePage.needRestart"), entryNamesAndValues, getFieldEditorParent()); //$NON-NLS-1$
    addField(languageSelectionEditor);

    Composite composite = getFieldEditorParent();
    LabelFieldEditor importAll = new LabelFieldEditor(
            Messages.getString("I18nPreferencePage.translationInformation"), //$NON-NLS-1$
            composite);
    addField(importAll);

    Button allUpdate = new Button(composite, SWT.FLAT);
    allUpdate.setText(Messages.getString("I18nPreferencePage.importBabili")); //$NON-NLS-1$
    allUpdate.setLayoutData(new GridData());

    allUpdate.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            // import all update from Babili
            // select the .zip file
            FileDialog fd = new FileDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                    SWT.OPEN);
            fd.setText("Open"); //$NON-NLS-1$
            fd.setFilterPath("C:" + fs); //$NON-NLS-1$
            String[] filterExtensions = { "*.zip" }; //$NON-NLS-1$
            fd.setFilterExtensions(filterExtensions);
            String selected = fd.open();
            if (selected != null) {
                isBabiliButtonClicked = true;
                runProgressMonitorDialog(selected);
                if (MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                        Messages.getString("I18nPreferencePage.restart"), //$NON-NLS-1$
                        Messages.getString("I18nPreferencePage.restartButton"))) {
                    PlatformUI.getWorkbench().restart();
                }
            }
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            // Nothing to do
        }
    });

    // added by nma
    Button restoredefault = new Button(composite, SWT.FLAT);
    restoredefault.setText("Restore Defaults"); //$NON-NLS-1$
    restoredefault.setLayoutData(new GridData());
    restoredefault.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            // Nothing to do
        }

        @Override
        public void widgetSelected(SelectionEvent e) {
            isBabiliButtonClicked = true;
            runProgressMonitorDialog(Messages.getString("I18nPreferencePage.restoreDefault")); //$NON-NLS-1$
            if (MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                    Messages.getString("I18nPreferencePage.restart"),
                    Messages.getString("I18nPreferencePage.restartButton"))) {
                PlatformUI.getWorkbench().restart();
            }
        }
    });
}

From source file:com.example.seonoh2.smarttoliet01.beacon.RecoMonitoringActivity.java

@Override
public void didExitRegion(RECOBeaconRegion recoRegion) {
    /**//from   w w  w.  j a v a2 s.  c o  m
     * For the first run, this callback method will not be called.
     * Please check the state of the region using didDetermineStateForRegion() callback method.
     *
     *  , ?   ? .
     * didDetermineStateForRegion()    region ? ?  .
     */

    Log.i("RecoMonitoringActivity", "didExitRegion() region:" + recoRegion.getUniqueIdentifier());

    mMonitoringListAdapter.updateRegion(recoRegion, RECOBeaconRegionState.RECOBeaconRegionOutside, 0,
            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.KOREA).format(new Date()));
    mMonitoringListAdapter.notifyDataSetChanged();
    //Write the code when the device is exit the region
}

From source file:hk.idv.kenson.jrconsole.Console.java

/**
 * //  w w  w  .  j  a  v a2 s.  c om
 * @param localeString
 * @return
 */
private static Locale getLocale(String localeString) {
    if ("default".equals(localeString))
        return Locale.getDefault();
    if ("canada".equals(localeString))
        return Locale.CANADA;
    if ("canada_french".equals(localeString))
        return Locale.CANADA_FRENCH;
    if ("china".equals(localeString))
        return Locale.CHINA;
    if ("chinese".equals(localeString))
        return Locale.CHINESE;
    if ("english".equals(localeString))
        return Locale.ENGLISH;
    if ("franch".equals(localeString))
        return Locale.FRANCE;
    if ("german".equals(localeString))
        return Locale.GERMAN;
    if ("germany".equals(localeString))
        return Locale.GERMANY;
    if ("italian".equals(localeString))
        return Locale.ITALIAN;
    if ("italy".equals(localeString))
        return Locale.ITALY;
    if ("japan".equals(localeString))
        return Locale.JAPAN;
    if ("japanese".equals(localeString))
        return Locale.JAPANESE;
    if ("korea".equals(localeString))
        return Locale.KOREA;
    if ("korean".equals(localeString))
        return Locale.KOREAN;
    if ("prc".equals(localeString))
        return Locale.PRC;
    if ("simplified_chinese".equals(localeString))
        return Locale.SIMPLIFIED_CHINESE;
    if ("taiwan".equals(localeString))
        return Locale.TAIWAN;
    if ("traditional_chinese".equals(localeString))
        return Locale.TRADITIONAL_CHINESE;
    if ("uk".equals(localeString))
        return Locale.UK;
    if ("us".equals(localeString))
        return Locale.US;

    String parts[] = localeString.split("_", -1);
    if (parts.length == 1)
        return new Locale(parts[0]);
    else if (parts.length == 2)
        return new Locale(parts[0], parts[1]);
    else
        return new Locale(parts[0], parts[1], parts[2]);
}

From source file:io.netty.example.file.FileServerHandler.java

protected String getTodayDateTime() {
    SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.KOREA);
    Date currentTime = new Date();
    String dTime = formatter.format(currentTime);
    return dTime;
}

From source file:io.netty.example.file.FileServerHandler.java

protected String getToday() {
    SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd", Locale.KOREA);
    Date currentTime = new Date();
    String dTime = formatter.format(currentTime);
    return dTime;
}

From source file:com.embedded.dgu.crimenotifier.MyRecoBackgroundMonitoringService.java

private void popupNotification(String msg) {
    Log.i("BackMonitoringService", "popupNotification()");
    String currentTime = new SimpleDateFormat("HH:mm:ss", Locale.KOREA).format(new Date());
    NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    NotificationCompat.Builder builder = new NotificationCompat.Builder(this).setSmallIcon(R.mipmap.ic_launcher)
            .setContentTitle(msg + " " + currentTime).setContentText(msg);

    NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
    builder.setStyle(inboxStyle);/*from  w  w w  .  j a va2s . co  m*/
    nm.notify(mNotificationID, builder.build());
    mNotificationID = (mNotificationID - 1) % 1000 + 9000;
}

From source file:com.a3did.partner.recosample.RecoBackgroundMonitoringService.java

private void popupNotification(String msg) {
    Log.i("BackMonitoringService", "popupNotification()");
    String currentTime = new SimpleDateFormat("HH:mm:ss", Locale.KOREA).format(new Date());
    NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
            .setSmallIcon(R.drawable.ic_menu_camera).setContentTitle(msg + " " + currentTime)
            .setContentText(msg);//from w w w  .  j a  v  a2  s .  c  om

    NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
    builder.setStyle(inboxStyle);
    nm.notify(mNotificationID, builder.build());
    mNotificationID = (mNotificationID - 1) % 1000 + 9000;
}

From source file:com.example.androidchoi.beacontest.RecoBackgroundMonitoringService.java

private void popupNotification(String msg) {
    Log.i("BackMonitoringService", "popupNotification()");
    String currentTime = new SimpleDateFormat("HH:mm:ss", Locale.KOREA).format(new Date());
    NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    NotificationCompat.Builder builder = new NotificationCompat.Builder(this).setSmallIcon(R.mipmap.ic_launcher)
            .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.image_1))
            .setColor(getResources().getColor(R.color.colorPrimary)).setContentTitle(msg + " " + currentTime)
            .setContentText(msg).setContentIntent(getPendingIntent());
    NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
    builder.setStyle(inboxStyle);/* w ww .  ja v  a  2 s  .  c  om*/
    nm.notify(mNotificationID, builder.build());
    mNotificationID = (mNotificationID - 1) % 1000 + 9000;
}