KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > compiler > DebugCompiler


1 /******************************************************************************
2  * DebugCompiler.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.compiler;
11
12 import org.jdom.Element;
13 import java.io.File JavaDoc;
14 import java.io.FileNotFoundException JavaDoc;
15 import java.util.*;
16
17 /**
18  * Compiler for <code>debug</code> element.
19  *
20  * @author Henry Minsky
21  */

22 class DebugCompiler extends ViewCompiler {
23     DebugCompiler(CompilationEnvironment env) {
24         super(env);
25     }
26
27     /** Returns true iff this class applies to this element.
28      * @param element an element
29      * @return see doc
30      */

31     public static boolean isElement(Element element) {
32         return element.getName().equals("debug");
33     }
34
35     public void compile(Element element) throws CompilationError
36     {
37         // If the canvas does not have the debug flag, or if we have already instantiated a debugger,
38
// return now.
39
if (!mEnv.getBooleanProperty(mEnv.DEBUG_PROPERTY)
40             || mEnv.getBooleanProperty(mEnv.USER_DEBUG_WINDOW)) {
41             return;
42         } else {
43             mEnv.setProperty(mEnv.USER_DEBUG_WINDOW, true);
44             super.compile(element);
45         }
46     }
47 }
48
Popular Tags