Пример #1
0
  /**
   * Add value to the list of workbench encodings.
   *
   * @param value
   */
  public static void addIDEEncoding(String value) {

    if (WorkbenchEncoding.getDefinedEncodings().contains(value)) {
      return;
    }

    writeEncodingsPreference(value, getIDEEncodingsPreference());
  }
Пример #2
0
  /**
   * Get all of the available encodings including any that were saved as a preference in the IDE or
   * in core resources.
   *
   * @return List of String
   */
  public static List getIDEEncodings() {
    List encodings = getIDEEncodingsPreference();
    encodings.addAll(WorkbenchEncoding.getDefinedEncodings());

    String enc = getResourceEncoding();

    if (!(enc == null || encodings.contains(enc))) {
      encodings.add(enc);
    }

    Collections.sort(encodings);
    return encodings;
  }