A plugin for S2S has to be developed with the
Groovy language. All the plugins are stored in the hidden directory named ".s2s/plugins" located in the user's home directory.
To create a new plugin, create a new directory containing a file named "Plugin.groovy". This file has to contain the following code:
class Plugin {
def subTitleLabels = ["SubTitle1", "SubTitle2"]
def getMenuTitle() {
"My First Plugin";
}
def getMenuToolTip() {
"This is my first plugin"
}
def getSubTitles() {
subTitleLabels
}
def getSubToolTips() {
["This is the sub-title1", "This is the sub-title2"];
}
//this method is called when any menu item of the plugin is selected by the user
//the "title" argument corresponds to the title of the menu item selected by the user
def run(S2S s2s, String title) {
//this is where the magic happens
if (title == subTitleLabels[0])
println "First subtitle selected"
if (title == subTitleLabels[1])
println "Second subtitle selected"
}
}
This produces the following result:
To develop your plugin, you have to know what you can do with S2S "from the outside". Its
Javadoc will help you.
If you have developed an interesting plugin and if you want to diffuse it "officially", please
contact us and we will add it to the list of the available plugins.