Class TemplateEngineHelper


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

      • TemplateEngineHelper

        public TemplateEngineHelper()
    • Method Detail

      • getSharedDefaultLocation

        public static java.io.File getSharedDefaultLocation​(java.lang.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 java.io.File storeSharedDefaultLocation​(java.lang.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 java.lang.String getFirstMarkerID​(java.lang.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​(java.lang.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 java.net.URL getTemplateResourceURL​(java.lang.String pluginId,
                                                          java.lang.String resourcePath)
                                                   throws java.io.IOException
        Return Template Source path as URL
        Parameters:
        pluginId -
        resourcePath -
        Returns:
        URL, of the Template Resource
        Throws:
        java.io.IOException
        Since:
        4.0
      • getTemplateResourceURLRelativeToTemplate

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

        public static java.lang.String externalizeTemplateString​(TemplateInfo ti,
                                                                 java.lang.String key)
      • externalizeTemplateString

        public static java.lang.String externalizeTemplateString​(java.lang.String pluginId,
                                                                 java.lang.String location,
                                                                 java.lang.String key)