Example usage for java.util Locale US

List of usage examples for java.util Locale US

Introduction

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

Prototype

Locale US

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

Click Source Link

Document

Useful constant for country.

Usage

From source file:com.vaporwarecorp.mirror.feature.texttospeech.TextToSpeechManagerImpl.java

@Override
public void onFeatureResume() {
    mTextToSpeech = new TextToSpeech(mAppManager.getAppContext(), status -> {
        if (status == TextToSpeech.SUCCESS) {
            mTextToSpeech.setLanguage(Locale.US);
        } else {/*from   w  ww  . jav a 2 s  .c  o m*/
            mTextToSpeech = null;
        }
    });
}

From source file:org.jmesa.core.CoreContextTest.java

@Test
public void createCoreContext() {

    MockHttpServletRequest request = new MockHttpServletRequest();
    WebContext webContext = new HttpServletRequestWebContext(request);
    webContext.setParameterMap(getParameters());
    webContext.setLocale(Locale.US);
    LimitFactory limitFactory = new LimitFactory(ID, webContext);
    Limit limit = limitFactory.createLimit();

    RowSelect rowSelect = limitFactory.createRowSelect(MAX_ROWS, TOTAL_ROWS);
    limit.setRowSelect(rowSelect);/*from w w w.  ja  v a  2  s.c  om*/

    RowFilter rowFilter = new DefaultRowFilter();
    ColumnSort columnSort = new DefaultColumnSort();

    List<Object> data = new ArrayList<Object>();

    Items items = new Items(data, limit, rowFilter, columnSort);

    Preferences preferences = new PropertiesPreferences("/org/jmesa/core/test.properties", webContext);
    Messages messages = new ResourceBundleMessages("org.jmesa.core.message.testResourceBundle", webContext);

    CoreContext coreContext = new CoreContext(items, limit, null, preferences, messages);

    assertNotNull(coreContext);
}

From source file:com.bearstech.openid.CookieParser.java

CookieParser(String input) {
    this.input = input;
    this.inputLowerCase = input.toLowerCase(Locale.US);
}

From source file:Main.java

/**
 * This method is used by the core logging functions to nicely format output to the logcat
 * @param logMethod the method to call. Should be {@link Log#i(String, String)} or another {@link Log} static method
 * @param format the text to display, using java string format arguments
 * @param args the arguments to show in the format string.
 *//*  ww w  . j  a  v  a  2  s.  c  o m*/
private static void log(Method logMethod, String format, Object... args) {
    try {
        StackTraceElement[] trace = Thread.currentThread().getStackTrace();
        StringBuilder b = new StringBuilder();
        b.append(format).append(", ");
        int index = 1;
        String name = null;
        boolean loop = true;
        do {
            index++;
            if (trace != null && index < trace.length) {
                name = trace[index].getClassName();

                if (name != null) {
                    if (!name.contains("self.philbrown.AbLE.AbLEUtil")) {
                        loop = false;
                    }
                }
            } else {
                index = 1;
                loop = false;
            }

        } while (loop);
        b.append(formatStackTrace(trace[index]));
        b.append(buildCommaSeparatedString(args));
        try {
            logMethod.invoke(null, "AbLE", String.format(Locale.US, b.toString(), args));
        } catch (Exception e) {
            e.printStackTrace();
        }
    } catch (Throwable t) {
        Log.w("AbLE", "Log Failed", t);
    }
}

From source file:mailjimp.dom.request.campaign.CampaignListRequest.java

static public HashMap<String, Object> buildFilters(String campaignId, String listId, Integer folderId,
        Integer templateId, String status, String type, String fromName, String fromEmail, String title,
        String subject, Date sendTimeStart, Date sendTimeEnd, Boolean exact) {
    HashMap<String, Object> options = new HashMap<String, Object>();

    if (campaignId != null)
        options.put("campaign_id", campaignId);

    if (listId != null)
        options.put("list_id", listId);

    if (folderId != 0)
        options.put("folderId", (int) folderId);

    if (templateId != null)
        options.put("template_id", templateId);

    if (status != null)
        options.put("status", status);

    if (type != null)
        options.put("type", type);

    if (fromName != null)
        options.put("from_name", fromName);

    if (fromEmail != null)
        options.put("from_email", fromEmail);

    if (title != null)
        options.put("title", title);

    if (subject != null)
        options.put("subject", subject);

    if (sendTimeStart != null)
        options.put("sendtime_start", df.print(sendTimeStart, Locale.US));

    if (sendTimeEnd != null)
        options.put("sendtime_end", df.print(sendTimeStart, Locale.US));

    if (exact != null)
        options.put("exact", (boolean) exact);

    return options;
}

From source file:com.sawyer.advadapters.app.adapters.jsonadapter.UnitTestMovieAdapter.java

@Override //Default isFilteredOut, required by all subclasses to implement
protected boolean isFilteredOut(Object item, CharSequence constraint) {
    return !item.toString().toLowerCase(Locale.US).contains(constraint.toString().toLowerCase(Locale.US));
}

From source file:net.resheim.eclipse.timekeeper.internal.TaskActivationListener.java

@Override
public void preTaskActivated(ITask task) {
    LocalDateTime now = LocalDateTime.now();
    String startString = Activator.getValue(task, Activator.START);
    String tickString = Activator.getValue(task, Activator.TICK);
    if (startString != null) {
        LocalDateTime ticked = LocalDateTime.parse(tickString);
        LocalDateTime stopped = LocalDateTime.now();
        long seconds = ticked.until(stopped, ChronoUnit.SECONDS);
        String time = DurationFormatUtils.formatDuration(seconds * 1000, "H:mm", true);
        boolean confirm = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Add elapsed time?",
                "Work was already started and task was last updated on "
                        + ticked.format(DateTimeFormatter.ofPattern("EEE e, HH:mm", Locale.US))
                        + ". Continue and add the elapsed time since (" + time + ") to the task total?");
        if (confirm) {
            Activator.accumulateTime(task, startString, ticked.until(LocalDateTime.now(), ChronoUnit.MILLIS));
        }/*from   w w  w.  j  av a 2s . com*/
    }
    Activator.setValue(task, Activator.TICK, now.toString());
    Activator.setValue(task, Activator.START, now.toString());
}

From source file:de.xaniox.heavyspleef.core.i18n.YMLControl.java

@Override
public List<Locale> getCandidateLocales(String baseName, Locale locale) {
    List<Locale> candidates = Lists.newArrayList();
    candidates.add(locale);//from w w  w .  j a  v a 2 s  .  c  o m

    if (!locale.equals(Locale.US)) {
        candidates.add(Locale.US);
    }

    return candidates;
}

From source file:com.cloudmade.api.geometry.Point.java

@Override
public String toString() {
    DecimalFormat formatter = new DecimalFormat("0.#####", new DecimalFormatSymbols(Locale.US));
    return formatter.format(lat) + "," + formatter.format(lng);
}

From source file:com.ok2c.lightmtp.impl.protocol.cmd.DefaultProtocolHandler.java

@Override
public Action<ServerState> handle(final SMTPCommand command) throws SMTPErrorException {
    Args.notNull(command, "Command");
    String cmd = command.getVerb();
    CommandHandler<ServerState> handler = this.map.get(cmd.toUpperCase(Locale.US));
    if (handler != null) {
        if (this.log.isDebugEnabled()) {
            this.log.debug("Command " + command);
        }/*from  ww w.  j  a  v a  2  s  . c om*/
        return handler.handle(command.getArgument(), command.getParams());
    } else {
        throw new SMTPErrorException(SMTPCodes.ERR_PERM_SYNTAX_ERR_COMMAND, new SMTPCode(5, 5, 1),
                "command not recognized");
    }
}