Class ScriptLanguageProvider
java.lang.Object
qupath.lib.gui.scripting.languages.ScriptLanguageProvider
Class with static methods to fetch all the available ScriptLanguages.
- Since:
- v0.4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScriptLanguagefromString(String languageString) Get theScriptLanguageobject corresponding to the specified String.static Collection<ScriptLanguage> Get the available script languages.static ScriptEnginegetEngineByName(String languageName) Get theScriptEnginebased on its name.static ScriptLanguageReturn the firstScriptLanguagecompatible with the specified extension (can be runnable or not).static ScriptLanguagegetLanguageFromName(String name) Given a file name, determine the associated language - or null if no suitable (supported) language can be found.static booleaninstallLanguage(ScriptLanguage language) Install a new script language.
-
Constructor Details
-
ScriptLanguageProvider
public ScriptLanguageProvider()
-
-
Method Details
-
getAvailableLanguages
Get the available script languages.- Returns:
-
getLanguageFromName
Given a file name, determine the associated language - or null if no suitable (supported) language can be found.- Parameters:
name-- Returns:
-
fromString
Get theScriptLanguageobject corresponding to the specified String. If the string cannot be matched,PlainLanguageis returned.- Parameters:
languageString-- Returns:
- corresponding script language, or
PlainLanguageif no match
-
getLanguageFromExtension
Return the firstScriptLanguagecompatible with the specified extension (can be runnable or not).- Parameters:
ext- the extension of the script file- Returns:
- compatible script language
-
installLanguage
Install a new script language.- Parameters:
language- the language to install- Returns:
- true if the language was installed, false otherwise (e.g. it was already installed)
-
getEngineByName
Get theScriptEnginebased on its name.- Parameters:
languageName-- Returns:
- script engine
-