Example #1
0
 /**
  * @return an array containing the class names of the currently available ContentType's [pending]
  *     fetch from a Properties on disk ?
  */
 public static String[] getAvailableContentTypesNames() {
   ContentTypeBasics[] v = ContentTypeBasics.values();
   String[] a = new String[v.length];
   int i = 0;
   for (ContentTypeBasics e : v) a[i++] = e.getContentTypeName();
   return a;
 }
Example #2
0
 /**
  * Utility to retrieve the index of the given content-type class name in the array returned by
  * <code>getAvailableContentTypes</code> ; to be used by JComboBox'es.
  *
  * @param contentTypeClassName e.g. "jpicedt.format.latex.LatexContentType"
  * @return DEFAULT_CONTENT_TYPE_INDEX if not found.
  */
 public static int getContentTypeIndex(String contentTypeClassName) {
   ContentTypeBasics[] v = ContentTypeBasics.values();
   int i = 0;
   for (ContentTypeBasics c : v) {
     if (c.getClassName().equals(contentTypeClassName)) return i;
     else ++i;
   }
   return DEFAULT_CONTENT_TYPE_INDEX;
 }
Example #3
0
 /**
  * @return an array containing the class names of the currently available ContentType's [pending]
  *     fetch from a Properties on disk ?
  */
 public static String[][] getAvailableContentTypesFileExtensions() {
   ContentTypeBasics[] v = ContentTypeBasics.values();
   String[][] a = new String[v.length][];
   int i = 0;
   for (ContentTypeBasics e : v) {
     a[i++] = e.getFileExtentions().split(":");
   }
   return a;
 }