Class AntCorePreferences

  • All Implemented Interfaces:
    EventListener, Preferences.IPropertyChangeListener

    public class AntCorePreferences
    extends Object
    implements 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.
    • Method Detail

      • getDefaultAntHome

        public String 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
      • getDefaultAntURLs

        @Deprecated
        public URL[] getDefaultAntURLs()
        Deprecated.
        Returns 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

        public IAntClasspathEntry[] 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
        public URL[] getAntURLs()
        Deprecated.
        use getAntHomeClasspathEntries and getToolsJarEntry
        Returns the array of URLs that is the set of URLs defining the Ant classpath.
        Returns:
        the set of URLs defining the Ant classpath
      • computeDefaultExtraClasspathEntries

        protected void computeDefaultExtraClasspathEntries​(List<IConfigurationElement> entries)
      • getToolsJarEntry

        public IAntClasspathEntry getToolsJarEntry​(IPath javaHomePath)
        Returns the IAntClasspathEntry for the tools.jar associated with the path supplied. May return null 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
        public URL 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 return null if no tools.jar is found.
        Returns:
        URL tools.jar URL or null
      • getToolsJarEntry

        public IAntClasspathEntry getToolsJarEntry()
        Returns the IAntClasspathEntry 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 return null if no tools.jar is found.
        Returns:
        IAntClasspathEntry tools.jar IAntClasspathEntry or null
      • addPluginClassLoader

        protected void addPluginClassLoader​(Bundle bundle)
      • getExtraClasspathURLs

        public URL[] 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

        public URL[] 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

        public URL[] 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

        protected ClassLoader[] getPluginClassLoaders()
      • getTasks

        public List<Task> getTasks()
        Returns the default and custom tasks.
        Returns:
        the list of default and custom tasks.
      • getRemoteTasks

        public List<Task> 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

        public Task[] getCustomTasks()
        Returns the user defined custom tasks
        Returns:
        the user defined tasks
      • getCustomTypes

        public Type[] getCustomTypes()
        Returns the user defined custom types
        Returns:
        the user defined types
      • getCustomProperties

        public Property[] getCustomProperties()
        Returns the custom user properties specified for Ant builds.
        Returns:
        the properties defined for Ant builds.
      • getProperties

        public List<Property> getProperties()
        Returns the default and custom properties.
        Returns:
        the list of default and custom properties.
        Since:
        3.0
      • getRemoteAntProperties

        public List<Property> 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

        public String[] getCustomPropertyFiles​(boolean performStringSubstition)
        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

        public String[] getCustomPropertyFiles()
        Returns the custom property files specified for Ant builds.
        Returns:
        the property files defined for Ant builds.
      • getCustomURLs

        @Deprecated
        public URL[] getCustomURLs()
        Deprecated.
        Returns the custom URLs specified for the Ant classpath
        Returns:
        the URLs defining the Ant classpath
      • setCustomTasks

        public void setCustomTasks​(Task[] tasks)
        Sets the user defined custom tasks. To commit the changes, updatePluginPreferences must be called.
        Parameters:
        tasks - The custom tasks.
      • setCustomTypes

        public void setCustomTypes​(Type[] types)
        Sets the user defined custom types. To commit the changes, updatePluginPreferences must be called.
        Parameters:
        types - The custom types
      • setCustomURLs

        @Deprecated
        public void setCustomURLs​(URL[] urls)
        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
        public void setAntURLs​(URL[] urls)
        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

        public void setCustomPropertyFiles​(String[] paths)
        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

        public void setCustomProperties​(Property[] properties)
        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

        public List<Type> getTypes()
        Returns the default and custom types.
        Returns:
        all of the defined types
      • getRemoteTypes

        public List<Type> 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

        public List<Type> getDefaultTypes()
        Returns the default types defined via the type extension point
        Returns:
        all of the default types
      • getDefaultTasks

        public List<Task> getDefaultTasks()
        Returns the default tasks defined via the task extension point
        Returns:
        all of the default tasks
      • getDefaultProperties

        public List<Property> getDefaultProperties()
        Returns the default properties defined via the properties extension point
        Returns:
        all of the default properties
        Since:
        3.0
      • getArrayFromString

        protected String[] getArrayFromString​(String list)
      • updatePluginPreferences

        public void updatePluginPreferences()
        Updates the underlying plug-in preferences to the current state.
      • updateTasks

        protected void updateTasks​(Preferences prefs)
      • updateTypes

        protected void updateTypes​(Preferences prefs)
      • updateProperties

        protected void updateProperties​(Preferences prefs)
      • updateAdditionalEntries

        protected void updateAdditionalEntries​(Preferences prefs)
      • updateAntHomeEntries

        protected void updateAntHomeEntries​(Preferences prefs)
      • updatePropertyFiles

        protected void updatePropertyFiles​(Preferences prefs)
      • setAntHome

        public void setAntHome​(String antHome)
        Sets the string that defines the Ant home set by the user. May be set to null.
        Parameters:
        antHome - the fully qualified path to Ant home
      • getAntHome

        public String 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 return null
        Returns:
        the fully qualified path to Ant home
      • getAntHomeClasspathEntries

        public IAntClasspathEntry[] 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

        public IAntClasspathEntry[] 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

        public 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.
        Parameters:
        entries - the set of ant home classpath entries
        Since:
        3.0
      • setAdditionalClasspathEntries

        public void setAdditionalClasspathEntries​(IAntClasspathEntry[] entries)
        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

        public URL[] 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

        public IAntClasspathEntry[] getContributedClasspathEntries()
        Returns all contributed classpath entries via the extraClasspathEntries extension point.
        Returns:
        all contributed classpath entries via the extraClasspathEntries extension point
        Since:
        3.0