values(Map map) {
return map == null ? emptyList() : map.values();
}
static JTextArea jTextAreaWithUndo() {
return jTextAreaWithUndo("");
}
static JTextArea jTextAreaWithUndo(final String text) {
return jenableUndoRedo(swingNu(JTextArea.class, text));
}
static boolean swic(String a, String b) {
return startsWithIgnoreCase(a, b);
}
static boolean swic(String a, String b, Matches m) {
if (!swic(a, b)) return false;
m.m = new String[] {substring(a, l(b))};
return true;
}
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 boolean isInstance(Class type, Object arg) {
return type.isInstance(arg);
}
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_1103 = 0; _repeat_1103 < n; _repeat_1103++) { 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