public class JETNature extends java.lang.Object implements IJETNature
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
BUILDER |
protected static java.lang.String |
DEFAULT_TEMPLATE_CONTAINER_NAME |
protected static java.lang.String |
JET_NATURE_PROPERTIES_FILE |
protected static java.lang.String |
JET_SETTINGS_NODE |
protected IContainer |
jetJavaSourceContainer |
protected IProject |
jetProject |
protected java.util.List<java.lang.Object> |
jetTemplateContainers |
protected java.util.List<java.lang.Object> |
jetTemplateSourceContainers |
protected static java.lang.String |
SOURCE_CONTAINER_NODE |
protected static java.lang.String |
TEMPLATE_CONTAINER_NODE |
NATURE_ID| Constructor and Description |
|---|
JETNature()
Constructor for JETNature.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToFrontOfBuildSpec(java.lang.String builderID)
Adds a builder to the build specification for the given project.
|
protected void |
commitXML(org.w3c.dom.Document document) |
void |
configure() |
void |
configure(IProgressMonitor monitor) |
protected void |
createDefaultJETSettingsFile(java.util.List<java.lang.Object> templateContainers,
IContainer sourceContainer) |
protected void |
createDefaultJETSettingsFile(java.util.List<java.lang.Object> templateContainers,
java.util.List<java.lang.Object> templateSourceContainers,
IContainer sourceContainer)
Writes the default file
|
void |
deconfigure() |
protected org.w3c.dom.Element |
getChildWithLocalName(org.w3c.dom.Element element,
java.lang.String localName)
Returns the child with the given local name.
|
static java.lang.String |
getContainer(IProject project,
IContainer container) |
static IContainer |
getContainer(IProject project,
IPath path) |
static IContainer |
getContainer(IProject project,
java.lang.String path) |
static java.lang.String |
getContainers(IProject project,
java.util.List<java.lang.Object> containers) |
static java.lang.String |
getContainers(IProject project,
java.util.List<java.lang.Object> containers,
java.util.List<java.lang.Object> sourceContainers) |
static java.util.List<java.lang.Object> |
getContainers(IProject project,
java.lang.String paths) |
static java.util.List<java.lang.Object> |
getContainers(IProject project,
java.lang.String paths,
boolean filter) |
protected IContainer |
getContainerValue(org.w3c.dom.Element element,
java.lang.String localName)
Returns the container defined from the base Element passed in.
|
protected java.util.List<java.lang.Object> |
getContainerValues(org.w3c.dom.Element element,
java.lang.String localName)
Returns the containers defined from the base Element passed in.
|
protected java.util.List<java.lang.Object> |
getContainerValues(org.w3c.dom.Element element,
java.lang.String localName,
boolean filter)
Returns the containers defined from the base Element passed in with entries starting with @ filtered out.
|
protected IPath |
getDefaultSourcePath()
Returns the project's root directory
|
protected IPath |
getDefaultSourcePath(IProject project)
Returns the project's root directory
|
static java.util.Set<URI> |
getIncludingTemplates(URI templateURI) |
IContainer |
getJavaSourceContainer()
Returns the container where the generated Java sources go.
|
IContainer |
getJavaSourceContainerFromFile()
Returns the template file from the .jetproperties file
|
IProject |
getProject() |
static JETNature |
getRuntime(IProject project)
Get a JETNature that corresponds to the supplied project.
|
java.util.List<java.lang.Object> |
getTemplateContainers()
Returns the containers where the templates are located.
|
java.util.List<java.lang.Object> |
getTemplateContainersFromFile()
Returns the template path from the .jetproperties file.
|
java.util.List<java.lang.Object> |
getTemplateSourceContainers()
Returns the containers where the template sources are located.
|
protected java.util.List<java.lang.Object> |
getTemplateSourceContainersFromFile()
Returns the template source path from the .jetproperties file.
|
protected void |
initJavaSourceContainer(IProgressMonitor monitor)
Initializes the Java Source Container
|
protected void |
initTemplateContainer(IProgressMonitor monitor)
Initializes the template container.
|
protected org.w3c.dom.Document |
parseJETSettings()
Parse the JET settings file for the root element.
|
static byte[] |
readContentsAsBytes(java.io.InputStream input)
Reads an input stream and converts it to bytes
|
protected java.io.StringReader |
readJETSettingFile()
Open the JET Settings file and return a StringReader on the contents
|
static URI |
resolve(URI uri) |
protected void |
setContainerValue(IContainer container,
org.w3c.dom.Element element,
java.lang.String localName)
Sets the template container location in the settings file
|
protected void |
setContainerValues(java.util.List<java.lang.Object> containers,
org.w3c.dom.Element element,
java.lang.String localName) |
protected void |
setContainerValues(java.util.List<java.lang.Object> containers,
java.util.List<java.lang.Object> sourceContainers,
org.w3c.dom.Element element,
java.lang.String localName)
Sets the template container locations in the settings file
|
void |
setDefaults(IProgressMonitor monitor)
Sets the containers to their defaults.
|
void |
setJavaSourceContainer(IContainer javaSourceContainer)
Sets the container where the generated Java sources go.
|
void |
setJavaSourceContainerToFile(IContainer sourceContainer)
Writes the Java Source Container Location to a file
|
void |
setProject(IProject project) |
void |
setTemplateContainers(java.util.List<java.lang.Object> templateContainers)
Sets the containers where the templates are located.
|
void |
setTemplateContainers(java.util.List<java.lang.Object> templateContainers,
java.util.List<java.lang.Object> templateSourceContainers)
Sets the containers where the template sources are located.
|
void |
setTemplateContainersToFile(java.util.List<java.lang.Object> templateContainers) |
void |
setTemplateContainersToFile(java.util.List<java.lang.Object> templateContainers,
java.util.List<java.lang.Object> templateSourceContainers)
Writes the Template Container Location to a file
|
protected static final java.lang.String BUILDER
protected static final java.lang.String DEFAULT_TEMPLATE_CONTAINER_NAME
protected static final java.lang.String JET_NATURE_PROPERTIES_FILE
protected static final java.lang.String TEMPLATE_CONTAINER_NODE
protected static final java.lang.String SOURCE_CONTAINER_NODE
protected static final java.lang.String JET_SETTINGS_NODE
protected IProject jetProject
protected java.util.List<java.lang.Object> jetTemplateContainers
protected java.util.List<java.lang.Object> jetTemplateSourceContainers
protected IContainer jetJavaSourceContainer
public static JETNature getRuntime(IProject project)
project - IProjectpublic java.util.List<java.lang.Object> getTemplateContainers()
IJETNaturegetTemplateContainers in interface IJETNaturepublic java.util.List<java.lang.Object> getTemplateSourceContainers()
IJETNaturegetTemplateSourceContainers in interface IJETNaturepublic IContainer getJavaSourceContainer()
IJETNaturegetJavaSourceContainer in interface IJETNaturepublic void setTemplateContainers(java.util.List<java.lang.Object> templateContainers)
IJETNaturesetTemplateContainers in interface IJETNaturetemplateContainers - the new locations.public void setTemplateContainers(java.util.List<java.lang.Object> templateContainers,
java.util.List<java.lang.Object> templateSourceContainers)
IJETNaturesetTemplateContainers in interface IJETNaturetemplateContainers - the new locations.templateSourceContainers - the new source locations.public void setJavaSourceContainer(IContainer javaSourceContainer)
IJETNaturesetJavaSourceContainer in interface IJETNaturejavaSourceContainer - the new location.public void configure()
throws CoreException
CoreExceptionpublic void configure(IProgressMonitor monitor)
throws CoreException
CoreExceptionpublic void setDefaults(IProgressMonitor monitor)
throws CoreException
CoreExceptionpublic void deconfigure()
throws CoreException
CoreExceptionpublic IProject getProject()
public void setProject(IProject project)
protected void initTemplateContainer(IProgressMonitor monitor)
throws CoreException
CoreExceptionprotected void initJavaSourceContainer(IProgressMonitor monitor)
throws CoreException
CoreExceptionprotected IPath getDefaultSourcePath()
protected IPath getDefaultSourcePath(IProject project)
protected void addToFrontOfBuildSpec(java.lang.String builderID)
throws CoreException
CoreExceptionpublic java.util.List<java.lang.Object> getTemplateContainersFromFile()
protected java.util.List<java.lang.Object> getTemplateSourceContainersFromFile()
public IContainer getJavaSourceContainerFromFile()
protected org.w3c.dom.Document parseJETSettings()
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException,
CoreException
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjava.io.IOExceptionCoreExceptionprotected java.io.StringReader readJETSettingFile()
throws CoreException,
java.io.IOException
CoreExceptionjava.io.IOExceptionprotected java.util.List<java.lang.Object> getContainerValues(org.w3c.dom.Element element,
java.lang.String localName)
protected java.util.List<java.lang.Object> getContainerValues(org.w3c.dom.Element element,
java.lang.String localName,
boolean filter)
protected IContainer getContainerValue(org.w3c.dom.Element element,
java.lang.String localName)
protected void setContainerValues(java.util.List<java.lang.Object> containers,
org.w3c.dom.Element element,
java.lang.String localName)
protected void setContainerValues(java.util.List<java.lang.Object> containers,
java.util.List<java.lang.Object> sourceContainers,
org.w3c.dom.Element element,
java.lang.String localName)
protected void setContainerValue(IContainer container,
org.w3c.dom.Element element,
java.lang.String localName)
protected org.w3c.dom.Element getChildWithLocalName(org.w3c.dom.Element element,
java.lang.String localName)
public static byte[] readContentsAsBytes(java.io.InputStream input)
throws java.io.IOException
java.io.IOExceptionpublic void setTemplateContainersToFile(java.util.List<java.lang.Object> templateContainers)
throws CoreException
CoreExceptionpublic void setTemplateContainersToFile(java.util.List<java.lang.Object> templateContainers,
java.util.List<java.lang.Object> templateSourceContainers)
throws CoreException
CoreExceptionpublic void setJavaSourceContainerToFile(IContainer sourceContainer)
throws CoreException
CoreExceptionprotected void createDefaultJETSettingsFile(java.util.List<java.lang.Object> templateContainers,
IContainer sourceContainer)
throws CoreException,
java.io.IOException
CoreExceptionjava.io.IOExceptionprotected void createDefaultJETSettingsFile(java.util.List<java.lang.Object> templateContainers,
java.util.List<java.lang.Object> templateSourceContainers,
IContainer sourceContainer)
throws CoreException,
java.io.IOException
CoreExceptionjava.io.IOExceptionprotected void commitXML(org.w3c.dom.Document document)
throws CoreException,
java.lang.ClassNotFoundException,
java.io.IOException
CoreExceptionjava.lang.ClassNotFoundExceptionjava.io.IOExceptionpublic static IContainer getContainer(IProject project,
IPath path)
public static IContainer getContainer(IProject project,
java.lang.String path)
public static java.util.List<java.lang.Object> getContainers(IProject project,
java.lang.String paths)
public static java.util.List<java.lang.Object> getContainers(IProject project,
java.lang.String paths,
boolean filter)
public static java.lang.String getContainers(IProject project,
java.util.List<java.lang.Object> containers)
public static java.lang.String getContainers(IProject project,
java.util.List<java.lang.Object> containers,
java.util.List<java.lang.Object> sourceContainers)
public static java.lang.String getContainer(IProject project,
IContainer container)
public static URI resolve(URI uri)
public static java.util.Set<URI> getIncludingTemplates(URI templateURI)
Copyright © 2019. Licensed under the Eclipse Public License v2.0. All rights reserved.
Submit a bug or feature