Class TemplateEngineHelper


  • public class TemplateEngineHelper
    extends Object
    Acts as an Helper class for Template Engine
    Since:
    4.0
    • Constructor Detail

      • TemplateEngineHelper

        public TemplateEngineHelper()
    • Method Detail

      • getSharedDefaultLocation

        public static File getSharedDefaultLocation​(String sharedLocation)
        Gets the backup shareddefaults XML file. Presence of the file indicates that the template engine or the application underwent some crash or destruction.
        Parameters:
        sharedLocation -
        Returns:
        sharedXMLFile
        Since:
        4.0
      • storeSharedDefaultLocation

        public static File storeSharedDefaultLocation​(String sharedLocation)
        Stores the shareddefaults xml file in "${workspace}/.metadata/.plugins/${plugin.name}/shareddefaults.xml" path.
        Parameters:
        sharedLocation - the relative path within the plug-in
        Returns:
        a File object corresponding to the location within the plug-in
        Since:
        4.0
      • getWorkspacePath

        public static org.eclipse.core.runtime.IPath getWorkspacePath()
        This method returns the workspace path present in the workspace
        Returns:
        String Example : file:/C:/eclipse/workspace/
        Since:
        4.0
      • getFirstMarkerID

        public static String getFirstMarkerID​(String markerString)
        Parameters:
        markerString -
        Returns:
        the first content of a region matching $(.*) e.g. given a String of the form "foo $(ID) bar", return ID.
        Since:
        4.0
      • checkDirectoryInWorkspace

        public static boolean checkDirectoryInWorkspace​(String directoryName)
        Check whether there is a directory existing in present workspace, with the given name.
        Parameters:
        directoryName -
        Returns:
        true, if directory exists.
        Since:
        4.0
      • getTemplateResourceURL

        public static URL getTemplateResourceURL​(String pluginId,
                                                 String resourcePath)
                                          throws IOException
        Return Template Source path as URL
        Parameters:
        pluginId -
        resourcePath -
        Returns:
        URL, of the Template Resource
        Throws:
        IOException
        Since:
        4.0
      • getTemplateResourceURLRelativeToTemplate

        public static URL getTemplateResourceURLRelativeToTemplate​(TemplateCore template,
                                                                   String resourcePath)
                                                            throws IOException
        Returns the Template Resource Relative Path as URL
        Parameters:
        template -
        resourcePath -
        Returns:
        URL, of the Template Resource
        Throws:
        IOException
        Since:
        4.0
      • externalizeTemplateString

        public static String externalizeTemplateString​(String pluginId,
                                                       String location,
                                                       String key)