values(Map map) {
return map == null ? emptyList() : map.values();
}
static boolean swic(String a, String b) {
return startsWithIgnoreCase(a, b);
}
static boolean ewic(String a, String b) {
return endsWithIgnoreCase(a, b);
}
static boolean containsNewLines(String s) {
return containsNewLine(s);
}
static String jlabel_textAsHTML_center(String text) {
return ""
+ replace(htmlencode(text), "\n", "
")
+ "
";
}
static String getSelectedItem(JList l) {
return (String) l.getSelectedValue();
}
static String getSelectedItem(JComboBox cb) {
return strOrNull(cb.getSelectedItem());
}
static File localSnippetsDir() {
return javaxDataDir("Personal Programs");
}
static File localSnippetsDir(String sub) {
return newFile(localSnippetsDir(), sub);
}
static String getOneLineFileInfoField(File f, String field) {
File infoFile = associatedInfosFile(f);
List lines = lines(loadTextFile(infoFile));
return firstStartingWithIC_drop(lines, field + ": ");
}
static File fileInSameDir(File f, String newName) {
return newFile(parentFile(f), newName);
}
static List takeFirst(List l, int n) {
return l(l) <= n ? l : newSubListOrSame(l, 0, n);
}
static List takeFirst(int n, List l) {
return takeFirst(l, n);
}
static String takeFirst(int n, String s) { return substring(s, 0, n); }
static String takeFirst(String s, int n) { return substring(s, 0, n); }
static List takeFirst(int n, Iterable i) {
List l = new ArrayList();
Iterator it = i.iterator();
for (int _repeat_17 = 0; _repeat_17 < n; _repeat_17++) { if (it.hasNext()) l.add(it.next()); else break; }
return l;
}
static int smartLastIndexOf(String s, char c) {
if (s == null) return 0;
int i = s.lastIndexOf(c);
return i >= 0 ? i : l(s);
}
static String makePostData(Map