use of com.intellij.util.text.StringTokenizer in project intellij-community by JetBrains.
the class MicrodataUtil method getReferencesForAttributeValue.
public static PsiReference[] getReferencesForAttributeValue(@Nullable XmlAttributeValue element, PairFunction<String, Integer, PsiReference> refFun) {
if (element == null) {
return PsiReference.EMPTY_ARRAY;
}
String text = element.getText();
String urls = StringUtil.unquoteString(text);
StringTokenizer tokenizer = new StringTokenizer(urls);
List<PsiReference> result = new ArrayList<>();
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
int index = text.indexOf(token);
PsiReference ref = refFun.fun(token, index);
if (ref != null) {
result.add(ref);
}
}
return result.toArray(new PsiReference[result.size()]);
}
use of com.intellij.util.text.StringTokenizer in project intellij-community by JetBrains.
the class SplitterProportionsDataImpl method readExternal.
@Override
public void readExternal(Element element) throws InvalidDataException {
proportions.clear();
String prop = element.getAttributeValue(ATTRIBUTE_PROPORTIONS);
String version = element.getAttributeValue(ATTRIBUTE_VERSION);
if (prop != null && Comparing.equal(version, DATA_VERSION)) {
StringTokenizer tokenizer = new StringTokenizer(prop, ",");
while (tokenizer.hasMoreTokens()) {
String p = tokenizer.nextToken();
proportions.add(Float.valueOf(p));
}
}
}
use of com.intellij.util.text.StringTokenizer in project intellij-community by JetBrains.
the class Prefs method getPreferences.
private static Preferences getPreferences(String key) {
Preferences prefs = Preferences.userRoot();
final int dotIndex = key.lastIndexOf('.');
if (dotIndex > 0) {
final StringTokenizer tokenizer = new StringTokenizer(key.substring(0, dotIndex), ".", false);
while (tokenizer.hasMoreElements()) {
prefs = prefs.node(tokenizer.nextElement().toLowerCase(Locale.US));
}
}
return prefs;
}
use of com.intellij.util.text.StringTokenizer in project intellij-community by JetBrains.
the class BootstrapClassLoaderUtil method addAdditionalClassPath.
private static void addAdditionalClassPath(Collection<URL> classpath) {
try {
StringTokenizer tokenizer = new StringTokenizer(System.getProperty(PROPERTY_ADDITIONAL_CLASSPATH, ""), File.pathSeparator + ",", false);
while (tokenizer.hasMoreTokens()) {
String pathItem = tokenizer.nextToken();
classpath.add(new File(pathItem).toURI().toURL());
}
} catch (MalformedURLException e) {
getLogger().error(e);
}
}
use of com.intellij.util.text.StringTokenizer in project intellij-community by JetBrains.
the class PathMacroListEditor method parseIgnoredVariables.
private Collection<String> parseIgnoredVariables() {
final String s = myIgnoredVariables.getText();
final List<String> ignored = new ArrayList<>();
final StringTokenizer st = new StringTokenizer(s, ";");
while (st.hasMoreElements()) {
ignored.add(st.nextElement().trim());
}
return ignored;
}
Aggregations