Package org.eclipse.ant.core
Class AntCorePreferences
java.lang.Object
org.eclipse.ant.core.AntCorePreferences
- All Implemented Interfaces:
EventListener
,Preferences.IPropertyChangeListener
Represents the Ant Core plug-in's preferences providing utilities for extracting, changing and updating the underlying preferences. Clients may not
instantiate or subclass this class.
- Since:
- 2.1
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Constructor Summary
ModifierConstructorDescriptionprotected
AntCorePreferences
(List<IConfigurationElement> defaultTasks, List<IConfigurationElement> defaultExtraClasspath, List<IConfigurationElement> defaultTypes, boolean headless) protected
AntCorePreferences
(List<IConfigurationElement> defaultTasks, List<IConfigurationElement> defaultExtraClasspath, List<IConfigurationElement> defaultTypes, List<IConfigurationElement> defaultProperties, boolean headless) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPluginClassLoader
(Bundle bundle) protected void
Returns the complete list of pre-configuredTask
sReturns the complete listing of pre-configuredType
sprotected Property[]
extractProperties
(Preferences prefs, String[] properties) protected Task[]
extractTasks
(Preferences prefs, String[] tasks) protected Type[]
extractTypes
(Preferences prefs, String[] types) Returns the set of classpath entries that the user has added to the Ant runtime classpath.Returns the string that defines the Ant home set by the user or the location of the Eclipse Ant plug-in if Ant home has not been specifically set by the user.Returns the set of classpath entries that compose the libraries added to the Ant runtime classpath from the Ant home location.URL[]
Deprecated.use getAntHomeClasspathEntries and getToolsJarEntryprotected String[]
getArrayFromString
(String list) Returns all contributed classpath entries via theextraClasspathEntries
extension point.Property[]
Returns the custom user properties specified for Ant builds.String[]
Returns the custom property files specified for Ant builds.String[]
getCustomPropertyFiles
(boolean performStringSubstition) Returns the custom property files specified for Ant builds performing any required string substitution if indicated.Task[]
Returns the user defined custom tasksType[]
Returns the user defined custom typesURL[]
Deprecated.Returns the absolute path of the default ant.home to use for the build.Returns the array of classpath entries that is the default set of entries defining the Ant classpath.URL[]
Deprecated.usegetDefaultAntHomeEntries()
insteadReturns the default properties defined via the properties extension pointReturns the default tasks defined via the task extension pointReturns the default types defined via the type extension pointURL[]
Returns the list of URLs added to the classpath by the extra classpath entries extension point.protected ClassLoader[]
Returns the default and custom properties.Returns the default and custom properties that are relevant when there is no Eclipse runtime context (Ant build in a separate VM).URL[]
Returns the list of URLs to added to the classpath for an Ant build that is occurring without the Eclipse runtime.URL[]
Returns the list of URLs added to the classpath by the extra classpath entries extension point for an Ant build that is occurring without the Eclipse runtime.Returns the default and custom tasks that are relevant when there is no Eclipse runtime context (an Ant build in a separate VM).Returns the default and custom types that are relevant when there is no Eclipse runtime context (an Ant build in a separate VM).getTasks()
Returns the default and custom tasks.Returns theIAntClasspathEntry
for the tools.jar associated with the System property "java.home" location.getToolsJarEntry
(IPath javaHomePath) Returns the IAntClasspathEntry for the tools.jar associated with the path supplied.Deprecated.use getToolsJarEntry()getTypes()
Returns the default and custom types.URL[]
getURLs()
Returns the entire set of URLs that define the Ant runtime classpath.void
When a preference changes, update the in-memory cache of the preference.void
setAdditionalClasspathEntries
(IAntClasspathEntry[] entries) Sets the set of classpath entries that the user has added to the Ant runtime classpath.void
setAntHome
(String antHome) Sets the string that defines the Ant home set by the user.void
setAntHomeClasspathEntries
(IAntClasspathEntry[] entries) Sets the set of classpath entries that compose the libraries added to the Ant runtime classpath from the Ant home location.void
setAntURLs
(URL[] urls) Deprecated.use setAntHomeEntires(IAntClasspathEntry[])void
setCustomProperties
(Property[] properties) Sets the custom user properties specified for Ant builds.void
setCustomPropertyFiles
(String[] paths) Sets the custom property files specified for Ant builds.void
setCustomTasks
(Task[] tasks) Sets the user defined custom tasks.void
setCustomTypes
(Type[] types) Sets the user defined custom types.void
setCustomURLs
(URL[] urls) Deprecated.use setAdditionalEntries(IAntClasspathEntry)[]protected void
protected void
updateAntHomeEntries
(Preferences prefs) void
Updates the underlying plug-in preferences to the current state.protected void
updateProperties
(Preferences prefs) protected void
updatePropertyFiles
(Preferences prefs) protected void
updateTasks
(Preferences prefs) protected void
updateTypes
(Preferences prefs)
-
Constructor Details
-
AntCorePreferences
protected AntCorePreferences(List<IConfigurationElement> defaultTasks, List<IConfigurationElement> defaultExtraClasspath, List<IConfigurationElement> defaultTypes, boolean headless) -
AntCorePreferences
protected AntCorePreferences(List<IConfigurationElement> defaultTasks, List<IConfigurationElement> defaultExtraClasspath, List<IConfigurationElement> defaultTypes, List<IConfigurationElement> defaultProperties, boolean headless)
-
-
Method Details
-
propertyChange
When a preference changes, update the in-memory cache of the preference.- Specified by:
propertyChange
in interfacePreferences.IPropertyChangeListener
- Parameters:
event
- The property change event that has occurred.- See Also:
-
getDefaultAntHome
Returns the absolute path of the default ant.home to use for the build. The default is the org.apache.ant plug-in folder provided with Eclipse.- Returns:
- String absolute path of the default ant.home
- Since:
- 3.0
-
extractTasks
-
extractTypes
-
extractProperties
-
getDefaultAntURLs
Deprecated.usegetDefaultAntHomeEntries()
insteadReturns the array of URLs that is the default set of URLs defining the Ant classpath. Ant running through the command line tries to find tools.jar to help the user. Try emulating the same behavior here.- Returns:
- the default set of URLs defining the Ant classpath
-
getDefaultAntHomeEntries
Returns the array of classpath entries that is the default set of entries defining the Ant classpath.- Returns:
- the default set of classpath entries defining the Ant classpath
-
getAntURLs
Deprecated.use getAntHomeClasspathEntries and getToolsJarEntryReturns the array of URLs that is the set of URLs defining the Ant classpath.- Returns:
- the set of URLs defining the Ant classpath
-
computeDefaultTasks
Returns the complete list of pre-configuredTask
s- Parameters:
tasks
- theIConfigurationElement
handles for contributedTask
s- Returns:
- the list of
Task
s
-
computeDefaultTypes
Returns the complete listing of pre-configuredType
s- Parameters:
types
- the list ofIConfigurationElement
handles to contributedType
s- Returns:
- the list of
Type
s
-
computeDefaultExtraClasspathEntries
-
getToolsJarEntry
Returns the IAntClasspathEntry for the tools.jar associated with the path supplied. May returnnull
if no tools.jar is found (e.g. the path points to a JRE install).- Parameters:
javaHomePath
- path for Java home- Returns:
- IAntClasspathEntry tools.jar IAntClasspathEntry or
null
- Since:
- 3.0
-
getToolsJarURL
Deprecated.use getToolsJarEntry()Returns the URL for the tools.jar associated with the System property "java.home" location. If "java.home" has no associated tools.jar (such as a JRE install), the environment variable "JAVA_HOME" is resolved to check for a tools.jar. May returnnull
if no tools.jar is found.- Returns:
- URL tools.jar URL or
null
-
getToolsJarEntry
Returns theIAntClasspathEntry
for the tools.jar associated with the System property "java.home" location. If "java.home" has no associated tools.jar (such as a JRE install), the environment variable "JAVA_HOME" is resolved to check for a tools.jar. May returnnull
if no tools.jar is found.- Returns:
- IAntClasspathEntry tools.jar IAntClasspathEntry or
null
-
addPluginClassLoader
-
getExtraClasspathURLs
Returns the list of URLs added to the classpath by the extra classpath entries extension point.- Returns:
- the list of extra classpath URLs
-
getRemoteExtraClasspathURLs
Returns the list of URLs added to the classpath by the extra classpath entries extension point for an Ant build that is occurring without the Eclipse runtime.- Returns:
- the list of extra classpath URLs
- Since:
- 3.0
-
getURLs
Returns the entire set of URLs that define the Ant runtime classpath. Includes the Ant URLs, the additional URLs and extra classpath URLs.- Returns:
- the entire runtime classpath of URLs
-
getPluginClassLoaders
-
getTasks
Returns the default and custom tasks.- Returns:
- the list of default and custom tasks.
-
getRemoteTasks
Returns the default and custom tasks that are relevant when there is no Eclipse runtime context (an Ant build in a separate VM).- Returns:
- the list of default and custom tasks.
-
getCustomTasks
Returns the user defined custom tasks- Returns:
- the user defined tasks
-
getCustomTypes
Returns the user defined custom types- Returns:
- the user defined types
-
getCustomProperties
Returns the custom user properties specified for Ant builds.- Returns:
- the properties defined for Ant builds.
-
getProperties
Returns the default and custom properties.- Returns:
- the list of default and custom properties.
- Since:
- 3.0
-
getRemoteAntProperties
Returns the default and custom properties that are relevant when there is no Eclipse runtime context (Ant build in a separate VM).- Returns:
- the list of default and custom properties.
- Since:
- 3.0
-
getCustomPropertyFiles
Returns the custom property files specified for Ant builds performing any required string substitution if indicated.- Parameters:
performStringSubstition
- whether or not to perform the string substitution on the property file strings- Returns:
- the property files defined for Ant builds.
- Since:
- 3.0
-
getCustomPropertyFiles
Returns the custom property files specified for Ant builds.- Returns:
- the property files defined for Ant builds.
-
getCustomURLs
Deprecated.Returns the custom URLs specified for the Ant classpath- Returns:
- the URLs defining the Ant classpath
-
setCustomTasks
Sets the user defined custom tasks. To commit the changes, updatePluginPreferences must be called.- Parameters:
tasks
- The custom tasks.
-
setCustomTypes
Sets the user defined custom types. To commit the changes, updatePluginPreferences must be called.- Parameters:
types
- The custom types
-
setCustomURLs
Deprecated.use setAdditionalEntries(IAntClasspathEntry)[]Sets the custom URLs specified for the Ant classpath. To commit the changes, updatePluginPreferences must be called.- Parameters:
urls
- the URLs defining the Ant classpath
-
setAntURLs
Deprecated.use setAntHomeEntires(IAntClasspathEntry[])Sets the Ant URLs specified for the Ant classpath. To commit the changes, updatePluginPreferences must be called.- Parameters:
urls
- the URLs defining the Ant classpath
-
setCustomPropertyFiles
Sets the custom property files specified for Ant builds. To commit the changes, updatePluginPreferences must be called.- Parameters:
paths
- the absolute paths defining the property files to use.
-
setCustomProperties
Sets the custom user properties specified for Ant builds. To commit the changes, updatePluginPreferences must be called.- Parameters:
properties
- the properties defining the Ant properties
-
getTypes
Returns the default and custom types.- Returns:
- all of the defined types
-
getRemoteTypes
Returns the default and custom types that are relevant when there is no Eclipse runtime context (an Ant build in a separate VM).- Returns:
- the list of default and custom types.
-
getDefaultTypes
Returns the default types defined via the type extension point- Returns:
- all of the default types
-
getDefaultTasks
Returns the default tasks defined via the task extension point- Returns:
- all of the default tasks
-
getDefaultProperties
Returns the default properties defined via the properties extension point- Returns:
- all of the default properties
- Since:
- 3.0
-
getArrayFromString
-
updatePluginPreferences
public void updatePluginPreferences()Updates the underlying plug-in preferences to the current state. -
updateTasks
-
updateTypes
-
updateProperties
-
updateAdditionalEntries
-
updateAntHomeEntries
-
updatePropertyFiles
-
setAntHome
Sets the string that defines the Ant home set by the user. May be set tonull
.- Parameters:
antHome
- the fully qualified path to Ant home
-
getAntHome
Returns the string that defines the Ant home set by the user or the location of the Eclipse Ant plug-in if Ant home has not been specifically set by the user. Can returnnull
- Returns:
- the fully qualified path to Ant home
-
getAntHomeClasspathEntries
Returns the set of classpath entries that compose the libraries added to the Ant runtime classpath from the Ant home location.- Returns:
- the set of ant home classpath entries
- Since:
- 3.0
-
getAdditionalClasspathEntries
Returns the set of classpath entries that the user has added to the Ant runtime classpath.- Returns:
- the set of user classpath entries
- Since:
- 3.0
-
setAntHomeClasspathEntries
Sets the set of classpath entries that compose the libraries added to the Ant runtime classpath from the Ant home location.- Parameters:
entries
- the set of ant home classpath entries- Since:
- 3.0
-
setAdditionalClasspathEntries
Sets the set of classpath entries that the user has added to the Ant runtime classpath.- Parameters:
entries
- the set of user classpath entries- Since:
- 3.0
-
getRemoteAntURLs
Returns the list of URLs to added to the classpath for an Ant build that is occurring without the Eclipse runtime.- Returns:
- the list of classpath entries
- Since:
- 3.0
-
getContributedClasspathEntries
Returns all contributed classpath entries via theextraClasspathEntries
extension point.- Returns:
- all contributed classpath entries via the
extraClasspathEntries
extension point - Since:
- 3.0
-