Examples of MessageFormat


Examples of java.text.MessageFormat

     * @param locale
     * @param args
     * @return String
     */
    static public String format(String pattern, Locale locale, Object[] args) {
        MessageFormat format = getFormat(pattern, locale);

        return format.format(args);
    }
View Full Code Here

Examples of java.text.MessageFormat

     * @param pattern
     * @param locale
     * @return MessageFormat
     */
    static public MessageFormat getFormat(String pattern, Locale locale) {
        MessageFormat result = getFromCache(pattern, locale);

        if (result == null) {
            result = new MessageFormat(pattern, locale);
            storeInCache(result, pattern, locale);
        }

        return result;
    }
View Full Code Here

Examples of java.text.MessageFormat

public final class ImportSpigot implements ActionListener {

    public void actionPerformed(ActionEvent e) {
        SpigotWizardIterator wizardIterator = new SpigotWizardIterator();
        WizardDescriptor wizardDescriptor = new WizardDescriptor(wizardIterator);
        wizardDescriptor.setTitleFormat(new MessageFormat("{0} ({1})"));
        wizardDescriptor.setTitle(NbBundle.getMessage(getClass(), "ImportSpigot.wizard.title"));
        Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
        dialog.setVisible(true);
        dialog.toFront();
View Full Code Here

Examples of java.text.MessageFormat

            // Minimize memory allocations here.
            dat.setTime(record.getMillis());
            args[0] = dat;
            StringBuffer text = new StringBuffer();
            if (formatter == null) {
                formatter = new MessageFormat(format);
            }
            formatter.format(args, text, null);
            sb.append(text);
            sb.append(" ");
   
View Full Code Here

Examples of java.text.MessageFormat

      Object []params = paramList.toArray(new Object[paramList.size()]);

      String pattern = toString(context, component, value);

      String string
        = new MessageFormat(pattern, context.getViewRoot().getLocale())
        .format(params);

      out.writeText(string, "value");
    }
    else {
View Full Code Here

Examples of java.text.MessageFormat

            setEditorValue(i, descriptors[i].getValue(DEFAULT));

        }

        // Obtain message formats:
        propertyFieldLabelMessage = new MessageFormat(JMeterUtils.getResString("property_as_field_label")); //$NON-NLS-1$
        propertyToolTipMessage = new MessageFormat(JMeterUtils.getResString("property_tool_tip")); //$NON-NLS-1$

        // Initialize the GUI:
        init();
    }
View Full Code Here

Examples of java.text.MessageFormat

    final public static String getMessage(ResourceBundle messages, String messageKey, Object msgArgs[])
    {
        for (int i=0; i<msgArgs.length; i++) {
            if (msgArgs[i] == null) msgArgs[i] = ""; // NOI18N
        }
        MessageFormat formatter = new MessageFormat(messages.getString(messageKey));
        return formatter.format(msgArgs);
    }
View Full Code Here

Examples of java.text.MessageFormat

        String language = languagePreferences.getProperty(friend, defaultLanguage);
        return greet(language, friend);
    }

    public String greet(String language, String friend) {
        MessageFormat greeting = greetings.get(language);
        if (greeting == null) {
            Locale locale = new Locale(language);
            return "Sorry, I don't speak " + locale.getDisplayLanguage() + ".";
        }

        return greeting.format(new Object[]{friend});
    }
View Full Code Here

Examples of java.text.MessageFormat

        return greeting.format(new Object[]{friend});
    }

    public void addGreeting(String language, String message) {
        greetings.put(language, new MessageFormat(message));
    }
View Full Code Here

Examples of java.text.MessageFormat

            }
        }

        if (args != null && args.length > 0)
        {
            MessageFormat format;

            if (summary != null)
            {
                format = new MessageFormat(summary, locale);
                summary = format.format(args);
            }

            if (detail != null)
            {
                format = new MessageFormat(detail, locale);
                detail = format.format(args);
            }
        }

        return new _LabeledFacesMessage(severity, summary, detail);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.