GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — processing4/java/src/processing/mode/java/JavaProblem.java at main · D-I-R-M/processing4 Expand file tree/ Copy pathJavaProblem.javaMore file actions 156 lines (113 loc) · 3.66 KB / Copy pathJavaProblem.javaFile metadata and controls156 lines (113 loc) · 3.66 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* Part of the Processing project - http://processing.org Copyright (c) 2012-15 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package processing.mode.java; import org.eclipse.jdt.core.compiler.IProblem; import processing.app.Problem; /** * Wrapper class for IProblem that stores the tabIndex and line number * according to its tab, including the original IProblem object */ public class JavaProblem implements Problem { /** Error Message. Processed form of IProblem.getMessage() */ private final String message; /** The type of error - WARNING or ERROR. */ private final int type; /** The tab number the error belongs to. */ private final int tabIndex; /** Line number (pde code) of the error */ private final int lineNumber; private int startOffset; private int stopOffset; /** * If the error is a 'cannot find type' contains the list of suggested imports */ private String[] importSuggestions; static final int ERROR = 1; static final int WARNING = 2; public JavaProblem(String message, int type, int tabIndex, int lineNumber) { this.message = message; this.type = type; this.tabIndex = tabIndex; this.lineNumber = lineNumber; // Default to 0, 1 unless a longer section is specified this.startOffset = 0; this.stopOffset = 1; } /** * @param iProblem - The IProblem which is being wrapped * @param tabIndex - The tab number to which the error belongs to * @param lineNumber - Line number(pde code) of the error * @param badCode - The code iProblem refers to. */ static public JavaProblem fromIProblem(IProblem iProblem, int tabIndex, int lineNumber, String badCode) { int type = 0; if (iProblem.isError()) { type = ERROR; } else if (iProblem.isWarning()) { type = WARNING; } String message = CompileErrorMessageSimplifier.getSimplifiedErrorMessage(iProblem, badCode); return new JavaProblem(message, type, tabIndex, lineNumber); } public void setPDEOffsets(int startOffset, int stopOffset){ this.startOffset = startOffset; this.stopOffset = stopOffset; } @Override public int getStartOffset() { return startOffset; } @Override public int getStopOffset() { return stopOffset; } @Override public boolean isError() { return type == ERROR; } @Override public boolean isWarning() { return type == WARNING; } @Override public String getMessage() { return message; } @Override public int getTabIndex() { return tabIndex; } @Override public int getLineNumber() { return lineNumber; } public String[] getImportSuggestions() { return importSuggestions; } public void setImportSuggestions(String[] a) { importSuggestions = a; } public boolean usesLineOffset() { return false; } @Override public String toString() { return "TAB " + tabIndex + ",LN " + lineNumber + "LN START OFF: " + startOffset + ",LN STOP OFF: " + stopOffset + ",PROB: " + message; } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |