Serverside Plugins
Java Plugin Developement
Implementing the plugin (implementing the IClientPlugin interface)
public class WhoisPlugin implements IClientPlugin {
public static final String PLUGIN_NAME = "whois";
private WhoisPluginProvider provider;
@Override
public Properties getProperties() {
Properties props = new Properties();
props.put(DISPLAY_NAME, getName());
return props;
}
/**
* Called when the plugin is loaded, can be used todo some initializations.
*/
@Override
public void load() throws PluginException {
// ignore
}
/**
* Called when the plugin is unloaded (client closed), can be used todo some clean ups
*/
@Override
public void unload() throws PluginException {
provider = null;
}
@Override
public void propertyChange(PropertyChangeEvent arg0) {
// ignore
}
/**
* This will return the object that has the api this plugin where servoy developers code against
*/
@Override
public IScriptable getScriptObject() {
if (provider == null) {
provider = new WhoisPluginProvider();
}
return provider;
}
@Override
public Icon getImage() {
URL iconUrl = getClass().getResource("images/whois.png"); //the image is added under a package 'com.servoy.plugins.whois.images' added to the WhoisPlugin project.
if (iconUrl != null) {
return new ImageIcon(iconUrl);
} else {
return null;
}
}
@Override
public String getName() {
return PLUGIN_NAME;
}
@Override
public void initialize(IClientPluginAccess pluginAccess) throws PluginException {
// ignore
}
}Implement the Script Object
Code the Plugin Main Behavior
Entry Points
Documenting the Plugin API
The IScriptable Interface
Documenting Method & Properties Using JavaDoc
The Documentation Generator Tool
Last updated
Was this helpful?