org.openide.loaders
Class CompilerSupport

java.lang.Object
  |
  +--org.openide.loaders.CompilerSupport
All Implemented Interfaces:
CompilerCookie, Node.Cookie
Direct Known Subclasses:
CompilerSupport.Build, CompilerSupport.Clean, CompilerSupport.Compile

public class CompilerSupport
extends Object
implements CompilerCookie

Support for compilation of data objects.


Inner Class Summary
static class CompilerSupport.Build
          Build cookie support.
static class CompilerSupport.Clean
          Clean cookie support.
static class CompilerSupport.Compile
          Compile cookie support.
 
Inner classes inherited from class org.openide.cookies.CompilerCookie
CompilerCookie.Build, CompilerCookie.Clean, CompilerCookie.Compile
 
Field Summary
static String PROP_COMPILER_TYPE
          Name of property providing a custom CompilerType for a file.
 
Constructor Summary
protected CompilerSupport(MultiDataObject.Entry entry, Class cookie)
          New support for given entry.
 
Method Summary
 void addProperties(Sheet.Set set)
          Helper method that creates default properties for compilation of given file entry.
 void addToJob(CompilerJob job, Compiler.Depth depth)
          Allows the cookie to add its compiler(s) into a compiler job.
protected  CompilerType defaultCompilerType()
          Allows subclasses to override the default compiler that should be used for this support.
static CompilerType getCompilerType(MultiDataObject.Entry entry)
          Get compiler manager associated with a given file.
 boolean isDepthSupported(Compiler.Depth depth)
          Supports only depth one.
static void prepareJob(CompilerJob job, Enumeration en, Class type, Compiler.Depth depth)
          Utility method to handle compilation on given set of DataObject.
static void setCompilerType(MultiDataObject.Entry entry, CompilerType man)
          Set compiler manager for a given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_COMPILER_TYPE

public static final String PROP_COMPILER_TYPE
Name of property providing a custom CompilerType for a file.
Constructor Detail

CompilerSupport

protected CompilerSupport(MultiDataObject.Entry entry,
                          Class cookie)
New support for given entry. The file is taken from the entry and is updated if the entry moves or renames itself.
Parameters:
entry - entry to create instance from
cookie - cookie class for the compilation (e.g. CompilerCookie.Build)
Method Detail

isDepthSupported

public boolean isDepthSupported(Compiler.Depth depth)
Supports only depth one.
Specified by:
isDepthSupported in interface CompilerCookie
Following copied from interface: org.openide.cookies.CompilerCookie
Parameters:
depth - the depth to test
Returns:
true if this cookie supports such depth

addToJob

public void addToJob(CompilerJob job,
                     Compiler.Depth depth)
Description copied from interface: CompilerCookie
Allows the cookie to add its compiler(s) into a compiler job. The depth parameter specifies whether or not the cookie should continue with its children. If the Compiler.Depth#isLastDepth is true then no children should be processed. Otherwise process the children with a new depth obtained by calling Compiler.Depth#nextDepth.
Specified by:
addToJob in interface CompilerCookie
Following copied from interface: org.openide.cookies.CompilerCookie
Parameters:
job - the compiler job to add the compiler for this cookie to
depth - the depth to use for compilation

defaultCompilerType

protected CompilerType defaultCompilerType()
Allows subclasses to override the default compiler that should be used for this support.

setCompilerType

public static void setCompilerType(MultiDataObject.Entry entry,
                                   CompilerType man)
                            throws IOException
Set compiler manager for a given file.
Parameters:
entry - entry to set the compiler for
man - type to use
Throws:
IOException - if compiler cannot be set

getCompilerType

public static CompilerType getCompilerType(MultiDataObject.Entry entry)
Get compiler manager associated with a given file.
Parameters:
entry - entry to obtain the compiler for
Returns:
associated manager or null

addProperties

public void addProperties(Sheet.Set set)
Helper method that creates default properties for compilation of given file entry.
Parameters:
set - sheet set to add properties to

prepareJob

public static void prepareJob(CompilerJob job,
                              Enumeration en,
                              Class type,
                              Compiler.Depth depth)
Utility method to handle compilation on given set of DataObject. Extracts compiler cookies from the provided enumeration of DataObjects and adds all of them into the provided compiler job.
Parameters:
job - compiler job to add objects to
en - enumeration of DataObject or Node objects
type - class that should be requested as a cookie (CompilerCookie.Compile,CompilerCookie.Build, CompilerCookie.Clean)
depth - the initial depth of compilation to start with


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.