Пример #1
0
  /**
   * Returns the list of chart plot options selected by the user in the View Options dialog box.
   * These options specify which items are plotted on the Diagnostics Chart.
   *
   * @param delimitedPrefsString - The delimeter string that is used to separate the returned list
   *     of chart plot options.
   * @return A List of ChartPlotOptions enumeration values that specify the user selected chart plot
   *     options.
   */
  public static List<ChartPlotOptions> toUserPrefsList(String delimitedPrefsString) {
    List<ChartPlotOptions> list = new ArrayList<ChartPlotOptions>();

    if (delimitedPrefsString == null) {
      return null;
    }

    String[] tokens = delimitedPrefsString.split(DELIM);
    for (String s : tokens) {
      if (s != null && !"".equals(s.trim())) {
        try {
          ChartPlotOptions cpo = ChartPlotOptions.valueOf(s);
          if (cpo != null) {
            list.add(cpo);
          }
        } catch (IllegalArgumentException e) {
          logger.warning("Unrecognized chart plot option in preferences: " + s);
        }
      }
    }
    return list;
  }