Skip to content

Commit 798e927

Browse files
committed
fix up the Eclipse build after moving modes a bit
1 parent 4186ee6 commit 798e927

3 files changed

Lines changed: 22 additions & 14 deletions

File tree

app/.classpath

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,5 @@
2121
<classpathentry kind="lib" path="lib/apple.jar"/>
2222
<classpathentry kind="lib" path="test/lib/junit-4.8.1.jar"/>
2323
<classpathentry kind="lib" path="lib/org-netbeans-swing-outline.jar"/>
24-
<classpathentry kind="lib" path="/Users/fry/coconut/processing/java2/mode/org.eclipse.jdt.core_3.8.2.v20120814-155456.jar"/>
25-
<classpathentry kind="lib" path="/Users/fry/coconut/processing/java2/mode/org.eclipse.text_3.5.200.v20120523-1310.jar"/>
26-
<classpathentry kind="lib" path="/Users/fry/coconut/processing/java2/mode/org.eclipse.core.runtime_3.8.0.v20120521-2346.jar"/>
27-
<classpathentry kind="lib" path="/Users/fry/coconut/processing/java2/mode/org.eclipse.equinox.common_3.6.100.v20120522-1841.jar"/>
2824
<classpathentry kind="output" path="bin"/>
2925
</classpath>

app/src/processing/app/Base.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,19 @@ private void buildCoreModes() {
277277
ModeContribution.load(this, getContentFile("modes/javascript"),
278278
"processing.mode.javascript.JavaScriptMode").getMode();
279279

280-
if (true) {
281-
coreModes = new Mode[] { javaMode, androidMode, javaScriptMode };
280+
coreModes = new Mode[] { javaMode, androidMode, javaScriptMode };
282281

283-
} else {
284-
Mode debugMode =
285-
ModeContribution.load(this, getContentFile("modes/java2"),
286-
"processing.mode.java2.DebugMode").getMode();
287-
coreModes = new Mode[] { javaMode, androidMode, javaScriptMode, debugMode };
288-
}
282+
// check for the new mode in case it's available
283+
// try {
284+
// Class.forName("processing.mode.java2.DebugMode");
285+
ModeContribution experimentalContrib =
286+
ModeContribution.load(this, getContentFile("modes/java2"),
287+
"processing.mode.java2.DebugMode");
288+
if (experimentalContrib != null) {
289+
Mode experimentalMode = experimentalContrib.getMode();
290+
coreModes = new Mode[] { javaMode, androidMode, javaScriptMode, experimentalMode };
291+
}
292+
// } catch (ClassNotFoundException e) { }
289293

290294
// for (Mode mode : coreModes) { // already called by load() above
291295
// mode.setupGUI();

app/src/processing/app/contrib/ModeContribution.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,21 @@ static public ModeContribution load(Base base, File folder) {
6868

6969

7070
// static public ModeContribution load(Base base, File folder, String searchName) {
71-
static public ModeContribution load(Base base, File folder, String searchName) {
71+
static public ModeContribution load(Base base, File folder,
72+
String searchName) {
7273
try {
7374
return new ModeContribution(base, folder, searchName);
7475
} catch (IgnorableException ig) {
7576
Base.log(ig.getMessage());
7677
} catch (Exception e) {
77-
e.printStackTrace();
78+
if (searchName == null) {
79+
e.printStackTrace();
80+
} else {
81+
// For the built-in modes, don't print the exception, just log it
82+
// for debugging. This should be impossible for most users to reach,
83+
// but it helps us load experimental mode when it's available.
84+
Base.log("ModeContribution.load() failed for " + searchName, e);
85+
}
7886
}
7987
return null;
8088
}

0 commit comments

Comments
 (0)