de.postfuse.ui
Interface ScriptFactory


public interface ScriptFactory

This interface has to be implemented by factories of scripts which extend our plugin.

Author:
Peter

Method Summary
 boolean canGetScript(String language)
          If this method returns true the getScript method is not allowed to return null for the same name!
 Script getScript(String language, String label, org.eclipse.core.resources.IFile file)
          Creates a script from a given eclipse file.
 Script getScript(String language, String label, String code)
          Creates a script from code.
 Collection<String> getSupportedScripts()
          Every language name which is returned here must not cause a null return of the getScript method!
 

Method Detail

getScript

Script getScript(String language,
                 String label,
                 String code)
Creates a script from code.

Parameters:
language - the name of the language - more than one name per language allowed!
label - the label of the script
code - the script code
Returns:
the created script or null if language undefined

getScript

Script getScript(String language,
                 String label,
                 org.eclipse.core.resources.IFile file)
Creates a script from a given eclipse file.

Parameters:
language - the name of the language - more than one name per language allowed!
label - the label of the script
file - the file containing the code
Returns:
the created script or null if language undefined

getSupportedScripts

Collection<String> getSupportedScripts()
Every language name which is returned here must not cause a null return of the getScript method!

Returns:
a collection of the names of the supported script languages

canGetScript

boolean canGetScript(String language)
If this method returns true the getScript method is not allowed to return null for the same name!

Parameters:
language -
Returns:
if the factory can create a script linked with this name