JETERS makes it easy to create own components, which can be used to implement own functionality, give JETERS access to text sources it cannot handle natively or exchange the user interface. This document explains how to build your own components. More detailled information is given in the javadocs.
JETERS uses Java, and so do the components. You need to create a class
implementing at least one of the four component interfaces contained in the
net.sf.jeters.componentInterface package:
InputComponent
,
OutputComponent
,
UIComponent
,
ReplacerComponent
.
Add the required methods and you are done.
There are, however, a few advanced possibilities. If you need to store
configuration data for your component in a file, JETERS will handle this for
you. Just add attributes to your component whose name starts with
“conf_
” (possible types: String, int, float, boolean) and
extend the abstract class
AssistedConfigurable
.
Last, but not least: Helpful stuff for component building can be found in
net.sf.jeters.util
, make sure to give it a look.
And don’t forget that you can re-use existing components by simply extending
them with your class. A simple
extends net.sf.jeters.components.JustAnExample
might save lots of work.
If you want to use a plain class file, your component class must be part of the default package (i.e. no explicit package specified). Simply compile your class, put it into the “components” directory and run JETERS. If your component consists of more than one class, make sure not to forget any of them!
You can use a jar as a component, too. Its manifest specifies the component
class as “JETERS-Class
”. Example: Assuming your component class
is any.package.MyComponent, the manifest must contain the line
JETERS-Class: any.package.MyComponent
Like the .class files, the jar goes into the “components” folder.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.