Package org.freeplane.plugin.script
Class FreeplaneScriptBaseClass
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Script
org.freeplane.plugin.script.FreeplaneScriptBaseClass
- All Implemented Interfaces:
- groovy.lang.GroovyObject
public abstract class FreeplaneScriptBaseClass
extends groovy.lang.Script
All methods of this class are available as "global" methods in every script.
 Only documented methods are meant to be used in scripts.
 
The following global objects are provided as shortcuts by the binding of this class:
- ui: see UITools
- logger: see LogUtils
- htmlUtils: see HtmlUtils
- textUtils: see TextUtils
- menuUtils: see MenuUtils
- config: see FreeplaneScriptBaseClass.ConfigProperties
- FreeplaneVersion
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classAccessor for Freeplane's configuration: In scripts available as "global variable"config.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected groovy.lang.BindingcreateBinding(NodeRO nodeProxy, ControllerRO controllerProxy) Applies default date-time format for dates or default number format for numbers.uses formatString to return a FormattedObject.formatDate(Date date) Applies default date format (instead of standard date-time) format on the given date.getProperty(String property) returns valueIfNull if value is null and value otherwise.invokeMethod(String methodName, Object args) voidopens a linkvoidopens aURIShortcut for node.map.node(id) - necessary for ids to other maps.parses text to the proper data type, if possible, setting format to the standard.rounds a number to integral type.round to the given number of decimal places:round(0.1234, 2) → 0.12voidsetBinding(groovy.lang.Binding binding) Shortcut for node.map.node(id).text.toString()formats according to the internal standard, that is the conversion will be reversible for types that are handled special by the scripting api namely Dates and Numbers.Shortcut for node.map.node(id).value.Methods inherited from class groovy.lang.Scriptevaluate, evaluate, getBinding, print, printf, printf, println, println, run, run, setPropertyMethods inherited from class groovy.lang.GroovyObjectSupportgetMetaClass, setMetaClass
- 
Constructor Details- 
FreeplaneScriptBaseClasspublic FreeplaneScriptBaseClass()
- 
FreeplaneScriptBaseClasspublic FreeplaneScriptBaseClass(groovy.lang.Binding binding) 
 
- 
- 
Method Details- 
setBindingpublic void setBinding(groovy.lang.Binding binding) - Overrides:
- setBindingin class- groovy.lang.Script
 
- 
createBinding
- 
getProperty- Specified by:
- getPropertyin interface- groovy.lang.GroovyObject
- Overrides:
- getPropertyin class- groovy.lang.Script
 
- 
invokeMethod- Specified by:
- invokeMethodin interface- groovy.lang.GroovyObject
- Overrides:
- invokeMethodin class- groovy.lang.Script
 
- 
NShortcut for node.map.node(id) - necessary for ids to other maps.
- 
TShortcut for node.map.node(id).text.
- 
VShortcut for node.map.node(id).value.
- 
ifNullreturns valueIfNull if value is null and value otherwise.
- 
roundrounds a number to integral type.
- 
roundround to the given number of decimal places:round(0.1234, 2) → 0.12
- 
parseparses text to the proper data type, if possible, setting format to the standard. Parsing is configured via config file scanner.xmlassert parse('2012-11-30') instanceof Date assert parse('1.22') instanceof Number // if parsing fails the original string is returned assert parse('2012XX11-30') == '2012XX11-30' def d = parse('2012-10-30') c.statusInfo = "${d} is ${new Date() - d} days ago"
- 
formatuses formatString to return a FormattedObject.Note: If you want to format the node core better use the format node attribute instead: node.object = new Date() node.format = 'dd/MM/yy' - Returns:
- IFormattedObjectif object is formattable and the unchanged object otherwise.
 
- 
formatApplies default date-time format for dates or default number format for numbers. All other objects are left unchanged.- Returns:
- IFormattedObjectif object is formattable and the unchanged object otherwise.
 
- 
formatDateApplies default date format (instead of standard date-time) format on the given date.- Returns:
- IFormattedObjectif object is formattable and the unchanged object otherwise.
 
- 
toStringformats according to the internal standard, that is the conversion will be reversible for types that are handled special by the scripting api namely Dates and Numbers.- See Also:
 
- 
loadUriopens aURI
- 
loadUriopens a link
- 
toString
 
-