Writing a new tool for sluice is easy, providing you understand the
TableView protocol and has some knowledge of java
beans.
A tool is sieve is a java bean that is extended to handle the
TableView protocol, and that has a User Interface
(UI). There are two ways of implementing a new tool: To fuse the UI and the
tool in one class, or to have the UI and the tool behavior in separate classes.
The first approach makes sense in cases where the main purpose of the tool
is visualization, like drawing a histogram or showing the content of a table,
and uses few UI components. The second approach is better when the tool has
a UI made of interface widgets that have a complicate dependency.
Since a tool in sluice (and in sieve in general) is a bean, the class implementing the UI will be a customizer. When sieve creates a new instance of a tool (bean), it checks for the existence of a customizer for that tool; if it finds one it will use it as the visible component of the tool. There is nothing in particular about this customizer, it needs to follow the same set of rules any other bean customizer would follow.
You do not need to start from scratch if you want to write a new tool. The
files TableViewTool.java,
TableViewToolCustomizer.java
and
TableViewToolBeanInfo.java
are skeletons for the classes to implement the TableView behavior, the User
Interface and the BeanInfo, respectively. The code is commented to tell where
you need to add the behavior for your particular tool.