@@ -192,6 +192,39 @@ var JS_EXAMPLES = {
192192 jsInhExLink : 'js-example-code/inheritance.js' ,
193193} ;
194194
195+ var JAVA_EXAMPLES = {
196+ javaVarLink : 'java-example-code/Variables.java' ,
197+ javaCFLink : 'java-example-code/ControlFlow.java' ,
198+ javaSqrtLink : 'java-example-code/Sqrt.java' ,
199+ javaExecLimitLink : 'java-example-code/ExecLimit.java' ,
200+ javaStringsLink : 'java-example-code/Strings.java' ,
201+
202+ javaPassByValLink : 'java-example-code/PassByValue.java' ,
203+ javaRecurLink : 'java-example-code/Recursion.java' ,
204+ javaSOLink : 'java-example-code/StackOverflow.java' ,
205+
206+ javaRolexLink : 'java-example-code/Rolex.java' ,
207+ javaPersonLink : 'java-example-code/Person.java' ,
208+ javaComplexLink : 'java-example-code/Complex.java' ,
209+ javaCastingLink : 'java-example-code/Casting.java' ,
210+
211+ javaLLLink : 'java-example-code/LinkedList.java' ,
212+ javaStackQueueLink : 'java-example-code/StackQueue.java' ,
213+ javaPostfixLink : 'java-example-code/Postfix.java' ,
214+ javaSTLink : 'java-example-code/SymbolTable.java' ,
215+
216+ javaToStringLink : 'java-example-code/ToString.java' ,
217+ javaReflectLink : 'java-example-code/Reflect.java' ,
218+ javaExceptionLink : 'java-example-code/Exception.java' ,
219+ javaExceptionFlowLink : 'java-example-code/ExceptionFlow.java' ,
220+ javaTwoClassesLink : 'java-example-code/TwoClasses.java' ,
221+
222+ javaForestLink : 'java-example-code/Forest.java' ,
223+ javaKnapsackLink : 'java-example-code/Knapsack.java' ,
224+ javaStaticInitLink : 'java-example-code/StaticInitializer.java' ,
225+ javaSyntheticLink : 'java-example-code/Synthetic.java' ,
226+ } ;
227+
195228var PY2_EXAMPLES = {
196229 tutorialExampleLink : "example-code/py_tutorial.txt" ,
197230 strtokExampleLink : "example-code/strtok.txt" ,
@@ -287,12 +320,16 @@ $(document).ready(function() {
287320 if ( JS_EXAMPLES [ myId ] !== undefined ) {
288321 exFile = JS_EXAMPLES [ myId ] ;
289322 $ ( '#pythonVersionSelector' ) . val ( 'js' ) ;
323+ } else if ( JAVA_EXAMPLES [ myId ] !== undefined ) {
324+ exFile = JAVA_EXAMPLES [ myId ] ;
325+ $ ( '#pythonVersionSelector' ) . val ( 'java' ) ;
290326 } else if ( PY2_EXAMPLES [ myId ] !== undefined ) {
291327 exFile = PY2_EXAMPLES [ myId ] ;
292328
293- // only switch Python mode to 2 if we're on 'js'; otherwise leave
294- // it as-is so as not to rock the boat
295- if ( $ ( '#pythonVersionSelector' ) . val ( ) === 'js' ) {
329+ // only switch Python mode to 2 if we're not on '2' or '3'; otherwise
330+ // leave as-is so as not to rock the boat
331+ if ( $ ( '#pythonVersionSelector' ) . val ( ) !== '2' &&
332+ $ ( '#pythonVersionSelector' ) . val ( ) !== '3' ) {
296333 $ ( '#pythonVersionSelector' ) . val ( '2' ) ;
297334 }
298335 } else {
0 commit comments