From 7bfb091f7021b478f8f45cb27381de94d193c4ea Mon Sep 17 00:00:00 2001 From: metasim Date: Tue, 19 Dec 2000 03:55:07 +0000 Subject: [PATCH] Added (draft) instructions for people interesting in implementing new modules for Antidote. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268375 13f79535-47bb-0310-9956-ffa450edef68 --- src/antidote/docs/new-module-howto.html | 81 +++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/antidote/docs/new-module-howto.html diff --git a/src/antidote/docs/new-module-howto.html b/src/antidote/docs/new-module-howto.html new file mode 100644 index 000000000..14777cccc --- /dev/null +++ b/src/antidote/docs/new-module-howto.html @@ -0,0 +1,81 @@ + + + + Antidote New Module HOWTO + + + + +

Antidote New Module HOWTO

+ +

Version 0.1 (2000/12/18)

+ +

Authors: + Simeon H.K. Fitch +

+ +

Introduction

+ +

The purpose of this document is to provide an overview of the + basic steps one must undertake to add a new module to + Antidote. Please see The Antidote + Design Overview for information on what a module is and how it + fits into Antidote. If you've already got all that, then read + on!

+ +

NB: Please submit updates and criticisms to this, particularly + areas that were unclear, missing, or difficult to follow.

+ +

1) Specialize org.apache.tools.ant.gui.AntModule

+ +

All modules must inherit from the AntModule + class. This will probably irritate some of you, but it essentially + enforces inheritance from javax.swing.JComponent and + provides encapsulated handling of the AppContext instance + that is so important to this class.

+ +

Your module is required to implement the + AntModule.contextualize(AppContext) method. The first + thing this method should do is call + AntModule.setContext(AppContext), and then it is safe for + it to begin constructing its display, using whatever resources it + needs from the given AppContext instance. Think of this + in a similar manner to Applet.init() or + Servlet.init(). + +

2) Update + org/apache/tools/ant/gui/resources/antidote.properties

+ +

2a) Externalize All Displayable Strings

+ +

All displayable strings must be externalized to the + antidote.properties file, and looked up via the + AppContext.getResources() method after the + AntModule.contextualize() method has been called. Follow + the naming convention currently used in the properties file and + you should have to problems. This task should be done + during development of your module. Under no cercumstances + should your module be submitted or committed without this task + being completed. Remember that Antidote has an international + audience.

+ +

2b) Add Module to List of Auto-Loaded Modules

+ +

Look for the properties with the format + org.apache.tools.ant.gui.Antidote.xxx.modules where + xxx is one of {left | right | top | bottom}. Depending on + where you want your module to appear, and the order that you want + it to appear in relationship to the other modules, add the class + name of your module appropriately. If multiple modules are listed + for a single property (via a comma delimited list), then each + module will have it's own tab in a javax.swing.JTabbedPane. + +

Run it!

+

That should be all you need to do, at least to get your module + plugged in. Check out the source code for + ProjectNavigator and PropertyEditor for module + examples that use the various facilities of the Antidote + framework.

+ + +