Examples of MessageFormat


Examples of java.text.MessageFormat

                    BUNDLE_NAME,
                    context.getViewRoot().getLocale());
            resourceString = bundle.getString(key);
            if (arguments != null)
            {
                final MessageFormat format = new MessageFormat(resourceString,
                        context.getViewRoot().getLocale());
                resourceString = format.format(arguments);
            }
        }
        catch (final MissingResourceException exception)
        {
            resourceString = key;
View Full Code Here

Examples of java.text.MessageFormat

            catch (final MissingResourceException exception)
            {
                message = messageKey;
            }
        }
        message = new MessageFormat(
                message,
                locale).format(args);
        return message;
    }
View Full Code Here

Examples of java.text.MessageFormat

        contentLen += 2;
        contentLen += cmdsize;
      }
     

      MessageFormat mFormat = new MessageFormat(sb.toString());
      String headstr = mFormat.format(new Object[] { 200, "OK", contentLen});

     
      byte[] headdata = null;
      try {
        headdata = headstr.getBytes("ISO-8859-1");
View Full Code Here

Examples of java.text.MessageFormat

            // qualifiers.
            qualifierNames.length != 0 ? formatList(qualifierNames, listPattern, listCompositionPattern) : null
        };

        if (displayNamePattern != null) {
            return new MessageFormat(displayNamePattern).format(displayNames);
        }
        else {
            // If we cannot get the message format pattern, then we use a simple
            // hard-coded pattern.  This should not occur in practice unless the
            // installation is missing some core files (FormatData etc.).
View Full Code Here

Examples of java.text.MessageFormat

            return result.toString();
        }

        // Compose the list down to three elements if necessary
        if (stringList.length > 3) {
            MessageFormat format = new MessageFormat(listCompositionPattern);
            stringList = composeList(format, stringList);
        }

        // Rebuild the argument list with the list length as the first element
        Object[] args = new Object[stringList.length + 1];
        System.arraycopy(stringList, 0, args, 1, stringList.length);
        args[0] = new Integer(stringList.length);

        // Format it using the pattern in the resource
        MessageFormat format = new MessageFormat(listPattern);
        return format.format(args);
    }
View Full Code Here

Examples of java.text.MessageFormat

  args[0] = dat;
  StringBuffer text = new StringBuffer();
  if (!NO_FIRST_LINE)
  {
    if (formatter == null) {
        formatter = new MessageFormat(format);
    }
    formatter.format(args, text, null);
    sb.append(text);
    sb.append(" ");
    if (record.getSourceClassName() != null) { 
View Full Code Here

Examples of java.text.MessageFormat

    String defaultVal = defaultValue;
    if (null == text && null == defaultVal) {
      defaultVal = key;
    }
    if (null == text && defaultVal != null) {
      MessageFormat format = new MessageFormat(defaultVal);
      format.setLocale(getLocale());
      format.applyPattern(defaultVal);
      return format.format(args);
    }
    return text;
  }
View Full Code Here

Examples of java.text.MessageFormat

    return bundle.getString(key);
  }

  public String getText(String key, Object[] args) {
    String text = bundle.getString(key);
    MessageFormat format = new MessageFormat(text);
    format.setLocale(locale);
    format.applyPattern(text);
    return format.format(args);
  }
View Full Code Here

Examples of java.text.MessageFormat

        getChart().getPropertiesMap().getProperty(DefaultChartTheme.PROPERTY_DIAL_LABEL) : null;
   
    if(label != null)
    {
      if(dialUnitScale < 0)
        label = new MessageFormat(label).format(new Object[]{String.valueOf(Math.pow(10, dialUnitScale))});
      else if(dialUnitScale < 3)
        label = new MessageFormat(label).format(new Object[]{"1"});
      else
        label = new MessageFormat(label).format(new Object[]{String.valueOf((int)Math.pow(10, dialUnitScale-2))});
   
    }
   
    // Set the units - this is just a string that will be shown next to the
    // value
View Full Code Here

Examples of java.text.MessageFormat

        getChart().getPropertiesMap().getProperty(DefaultChartTheme.PROPERTY_DIAL_LABEL) : null;

    if(label != null)
    {
      if(dialUnitScale < 0)
        label = new MessageFormat(label).format(new Object[]{String.valueOf(Math.pow(10, dialUnitScale))});
      else if(dialUnitScale < 3)
        label = new MessageFormat(label).format(new Object[]{"1"});
      else
        label = new MessageFormat(label).format(new Object[]{String.valueOf((int)Math.pow(10, dialUnitScale-2))});

      JRFont displayFont = jrPlot.getValueDisplay().getFont();
      Font themeDisplayFont = getFont((JRFont)getDefaultValue(defaultPlotPropertiesMap, ChartThemesConstants.PLOT_DISPLAY_FONT), displayFont, defaultBaseFontSize);
     
      String[] textLines = label.split("\\n");
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.