Package java.text

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


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

            // 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

      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

            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

    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

        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

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

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

            }
        }

        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

            // for the setEditorValue above!)
            propertyEditor.addPropertyChangeListener(this);
        }

    // Obtain message formats:
    propertyFieldLabelMessage= new MessageFormat
      JMeterUtils.getResString("property_as_field_label"));
    propertyToolTipMessage= new MessageFormat
      JMeterUtils.getResString("property_tool_tip"));

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

TOP

Related Classes of java.text.MessageFormat

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.