Extending Goat

Although Goat comes with four built-in viewers/editors you are by no means limited to these four viewers. To create custom viewers and editors for your data you will have to use the pluggable editor mechanism available in Goat. To do that open the file plugins.xml which would be present in your distribution. It will look something like below :


<?xml version="1.0" encoding="UTF-8" ?>
<plug-in>
<editor>
<name>Text Editor</name>
<displayText>View as Text</displayText>
<class>goat.editors.TextEditor</class>
<isDefault>true</isDefault>
</editor>
<editor>
<name>XML Editor</name>
<displayText>View as XML</displayText>
<class>goat.editors.XMLEditor</class>
</editor>
...

<plug-in>

The description of each tag in the document is as below :

<plug-in>  :  The beginning of the plugin document.

<editor>  :  Each custom editor should be enclosed within its own editor tag. The application will look inside each tag for information relevant to the particular editor.

<displayText>  :  The text that will be displayed when the user right clicks on any cell in the Data Panel within goat. The right click action will parse with document to get the plugin.xml document to fetch all the defined editors.

<class>  :  The editor java class. This should implement the Editor interface and should be in the classpath when you start Goat.

<isDefault>  :  If this value is set to true, this will be the default editor which is opened when you double click any cell in the Data Panel. By default the Text Editor is the default editor which will be opened when you double click the cell. You can however change it if you wish. Note that you can have only one default editor in plugins.xml.

Click here if you want to look at the API for creating your own custom Editors in Goat.