|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object MatchingTask uic.anttask.UICompiler
The class that allows you to compile ui files into java files from ant. Since this class will only be usefull from ant, this javadoc will only discuss ant options.
Before asking questions; always refer to the ant manual first.
Before you start ant; make sure this class (in the form of the uic.jar) is in the classpath of ant. Read that again; ant needs uic.jar in its classpath!
In ant you need 2 parts; the first is to define the uicompile task in this form:
<path id="uicompiler.classpath"> <pathelement path="jars/uic.jar"/> <pathelement path="${jdomjar}/> </path> <taskdef name="uicompiler" classname="uic.anttask.UICompiler" classpathref="uicompiler.classpath"/>
Next you provide the ant task inside a target, like this:
<target name="compile.ui.files"> <uicompiler srcdir="." includes="**/*.ui" /> </target>
Wnen called with ant compile.ui.files
the java files will be created after
which the normal step of compiling can take place.
Automatically creating a java file brings with it a problem that a clean
task
becomes a lot harder; you can't simply remove all files but need something more intelligent.
The following target can also be placed in your ant build file to make sure that intelligence
is exactly the thing that happens.
<!-- clean up --> <target name="clean" description="Clean out compiled files"> <delete> <fileset dir="." includes="**/*.java"> <present targetdir="${src}"> <mapper type="glob" from="*.java" to="*.ui"/> </present> </fileset> </delete> </target>
 :
Attribute | Description | Required |
src | The source base dir. Just like the javac task this should point to the dir that contains the base directory for your classes | Yes |
dest | the destination directory where the generated files go. | No |
includes | Comma- or space-separated list of files (may be specified using wildcard patterns) that must be included; all .ui files are included when omitted. | No |
excludes | Comma- or space-separated list of files (may be specified using wildcard patterns) that must be excluded; no files (except default excludes) are excluded when omitted. | No |
source | Generate compatible code with jre [source] version. Defaults to 1.4 | No |
listfiles | Indicates whether the source files to be compiled will be listed; defaults to no. | No |
widgetset | Overrule the widgetset to be used for compiling. Note that the uic.properties version will be used when empty; or when that is also not supplied the default "swing" will be used. | No |
postProcessor | Overrule the postProcessor to be used for compiling. Note that the uic.properties version will be used when empty; or when that is also not supplied the default "fileWriter" will be used. | No |
debug | Create java classes that include a main for quick start and check, defaults to no. | No |
buildProperties | point to an alternative uic.properties file | Not when in classpath |
Field Summary | |
protected File[] |
compileList
|
protected boolean |
debug
|
protected boolean |
debugGrid
|
protected boolean |
listFiles
|
Constructor Summary | |
UICompiler()
|
Method Summary | |
protected void |
checkParameters()
Check that all required attributes have been set and nothing silly has been entered. |
protected void |
compile()
Perform the compilation. |
void |
execute()
|
boolean |
getListfiles()
Get the listfiles flag. |
protected void |
resetFileLists()
Clear the list of files to be compiled and copied.. |
protected void |
scanDir(File srcDir,
File destDir,
String[] files)
Scans the directory looking for source files to be compiled. |
void |
setBuildProperties(File propertiesFile)
|
void |
setDebug(boolean debug)
|
void |
setDestDir(File destDir)
|
void |
setDrawGrid(boolean draw)
|
void |
setListfiles(boolean list)
If true, list the source files being handed off to the compiler. |
void |
setPostProcessor(String post)
|
void |
setSource(String sourceVersion)
Sourcecode version |
void |
setSrcDir(Path srcDir)
|
void |
setWidgetSet(String widgetSet)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected File[] compileList
protected boolean listFiles
protected boolean debug
protected boolean debugGrid
Constructor Detail |
public UICompiler()
Method Detail |
public void setSrcDir(Path srcDir)
public void setDestDir(File destDir)
public void setPostProcessor(String post)
public void setWidgetSet(String widgetSet)
public void setDebug(boolean debug)
public void execute() throws BuildException
BuildException
protected void scanDir(File srcDir, File destDir, String[] files)
protected void checkParameters() throws BuildException
BuildException
protected void resetFileLists()
protected void compile()
public void setListfiles(boolean list)
public void setDrawGrid(boolean draw)
public boolean getListfiles()
public void setBuildProperties(File propertiesFile)
public void setSource(String sourceVersion)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |