public static final Editor createEditorForExtension(String extension, 
                                                      JWP app) {
    EditorActionManager eam = app.getEditorActionManager();
    
    // Is it an HTML File?
    for (int i = 0; i < HTMLEditor.FILE_EXTENSIONS.length; i++) {
      if (extension.equalsIgnoreCase(HTMLEditor.FILE_EXTENSIONS[i])) {
        return new HTMLEditor(eam);
      }
    }

    // Is it an RTF file?
    for (int i = 0; i < RTFEditor.FILE_EXTENSIONS.length; i++) {
      if (extension.equalsIgnoreCase(RTFEditor.FILE_EXTENSIONS[i])) {
        return new RTFEditor(eam);
      }
    }

    // Is it a text file?
    for (int i = 0; i < TEXTEditor.FILE_EXTENSIONS.length; i++) {
      if (extension.equalsIgnoreCase(TEXTEditor.FILE_EXTENSIONS[i])) {
        // this is redundant, but we'll include it for uniformity for now.
        return new TEXTEditor(eam);
      }
    }

    return new TEXTEditor(eam);
  }