Search in sources :

Example 21 with StringList

use of processing.data.StringList in project processing by processing.

the class ErrorMessageSimplifier method removePackagePrefixes.

/**
   * Converts java.lang.String into String, etc
   */
private static String removePackagePrefixes(String input) {
    if (!input.contains(".")) {
        return input;
    }
    String[] names = PApplet.split(input, ',');
    //    List<String> names = new ArrayList<String>();
    //    if (inp.indexOf(',') >= 0) {
    //      names.addAll(Arrays.asList(inp.split(",")));
    //    } else {
    //      names.add(inp);
    //    }
    StringList result = new StringList();
    for (String name : names) {
        int dot = name.lastIndexOf('.');
        if (dot >= 0) {
            name = name.substring(dot + 1, name.length());
        }
        result.append(name);
    }
    return result.join(", ");
}
Also used : StringList(processing.data.StringList)

Aggregations

StringList (processing.data.StringList)21 Point (java.awt.Point)3 File (java.io.File)2 ZipFile (java.util.zip.ZipFile)2 Library (processing.app.Library)2 SketchCode (processing.app.SketchCode)2 SketchException (processing.app.SketchException)2 Argument (com.sun.jdi.connect.Connector.Argument)1 FileDialog (java.awt.FileDialog)1 Font (java.awt.Font)1 GraphicsDevice (java.awt.GraphicsDevice)1 GraphicsEnvironment (java.awt.GraphicsEnvironment)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 ConnectException (java.net.ConnectException)1 MatchResult (java.util.regex.MatchResult)1 ZipOutputStream (java.util.zip.ZipOutputStream)1 JFileChooser (javax.swing.JFileChooser)1 BuildException (org.apache.tools.ant.BuildException)1 Editor (processing.app.ui.Editor)1