Search in sources :

Example 1 with StringTokenizer

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()]);
}
Also used : StringTokenizer(com.intellij.util.text.StringTokenizer) PsiReference(com.intellij.psi.PsiReference)

Example 2 with StringTokenizer

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));
        }
    }
}
Also used : StringTokenizer(com.intellij.util.text.StringTokenizer)

Example 3 with StringTokenizer

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;
}
Also used : StringTokenizer(com.intellij.util.text.StringTokenizer) Preferences(java.util.prefs.Preferences)

Example 4 with StringTokenizer

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);
    }
}
Also used : StringTokenizer(com.intellij.util.text.StringTokenizer) MalformedURLException(java.net.MalformedURLException) File(java.io.File)

Example 5 with StringTokenizer

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;
}
Also used : StringTokenizer(com.intellij.util.text.StringTokenizer) ArrayList(java.util.ArrayList)

Aggregations

StringTokenizer (com.intellij.util.text.StringTokenizer)25 File (java.io.File)5 IOException (java.io.IOException)4 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 ArrayList (java.util.ArrayList)3 NotNull (org.jetbrains.annotations.NotNull)3 TextRange (com.intellij.openapi.util.TextRange)2 PsiReference (com.intellij.psi.PsiReference)2 InputStreamReader (java.io.InputStreamReader)2 NonNls (org.jetbrains.annotations.NonNls)2 JavacOutputParser (com.intellij.compiler.impl.javaCompiler.javac.JavacOutputParser)1 ConsoleViewContentType (com.intellij.execution.ui.ConsoleViewContentType)1 Lexer (com.intellij.lexer.Lexer)1 AccessToken (com.intellij.openapi.application.AccessToken)1 CompilerMessageCategory (com.intellij.openapi.compiler.CompilerMessageCategory)1 Document (com.intellij.openapi.editor.Document)1 RangeMarker (com.intellij.openapi.editor.RangeMarker)1 ProjectFileIndex (com.intellij.openapi.roots.ProjectFileIndex)1 Problem (com.intellij.problems.Problem)1 WolfTheProblemSolver (com.intellij.problems.WolfTheProblemSolver)1