com.apelon.apps.dts.editor.modules
Class DTSEditorModule

java.lang.Object
  extended by com.apelon.apps.dts.editor.modules.DTSEditorModule

public abstract class DTSEditorModule
extends Object

This class should be extended to create a custom plug-in module for the Apelon DTS Editor. The extending class must have constructor with no parameter. Otherwise the module class won't be recognized as a module.

The module class in package or a subpackage of com.apelon.modules.dts.editor are loaded by default. If the package of the class is other than this, this should be specified in DTSEditor property file (bin/editor/dtseditor.xml):

A module is loaded during DTSEditor startup. The sequence of actions are :

Since:
DTS 3.4.0
Author:
Apelon Inc.

Field Summary
static int FILE_MENU_ITEMS
          Identifier representing the DTS Editor 'File' menu.
static int HELP_MENU_ITEMS
          Identifier representing the DTS Editor 'Help' menu.
static int OPTIONS_MENU_ITEMS
          Identifier representing the DTS Editor 'Options' menu.
static int TOOLS_MENU_ITEMS
          Identifier representing the DTS Editor 'Tools' menu.
static int VIEW_MENU_ITEMS
          Identifier representing the DTS Editor 'View' menu.
 
Constructor Summary
protected DTSEditorModule()
          Default constructor.
 
Method Summary
 DTSModuleConfig getDTSModuleConfig()
          Returns DTSModuleConfig if module config file is specified using getDTSModuleConfigFile().
 String getDTSModuleConfigFile()
          Return a xml file name (.xml) for the module configuration file.
 JMenuItem[] getModuleMenuItems(int group)
          Returns menu items to be added to an existing DTSEditor menu group.
 JMenu[] getModuleMenus()
          Return a new main menu to be displayed on the DTS Editor menu bar.
 JComponent[] getModuleToolbarItems()
          Buttons to be displayed in the DTS Editor toolbar.
abstract  void initModule(DTSEditorModuleMgr mgr)
          Called by DTS Editor at startup to initialize this module.
 void setDTSModuleConfig(DTSModuleConfig config)
          If getDTSModuleConfigFile() returns a file path, the corresponding DTSModuleConfig is set by DTS Editor using this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_MENU_ITEMS

public static final int FILE_MENU_ITEMS
Identifier representing the DTS Editor 'File' menu.

Since:
DTS 3.4.0
See Also:
Constant Field Values

VIEW_MENU_ITEMS

public static final int VIEW_MENU_ITEMS
Identifier representing the DTS Editor 'View' menu.

Since:
DTS 3.4.0
See Also:
Constant Field Values

TOOLS_MENU_ITEMS

public static final int TOOLS_MENU_ITEMS
Identifier representing the DTS Editor 'Tools' menu.

Since:
DTS 3.4.0
See Also:
Constant Field Values

OPTIONS_MENU_ITEMS

public static final int OPTIONS_MENU_ITEMS
Identifier representing the DTS Editor 'Options' menu.

Since:
DTS 3.4.0
See Also:
Constant Field Values

HELP_MENU_ITEMS

public static final int HELP_MENU_ITEMS
Identifier representing the DTS Editor 'Help' menu.

Since:
DTS 3.4.0
See Also:
Constant Field Values
Constructor Detail

DTSEditorModule

protected DTSEditorModule()
Default constructor. For any class extended from this class, if it has one or more constructors which has parameters, the default constructor which has no parameter must be declared. Otherwise the module class won't be recognized as a module.

Method Detail

initModule

public abstract void initModule(DTSEditorModuleMgr mgr)
Called by DTS Editor at startup to initialize this module. The DTS Editor will pass in its instance of the DTSEditorModuleMgr. Any operations required to initialize this module should be called from here.

Parameters:
mgr - DTSModuleMgr
See Also:
DTSEditorModuleMgr

getModuleMenus

public JMenu[] getModuleMenus()
Return a new main menu to be displayed on the DTS Editor menu bar. This menu will be placed to the left of the Help menu.

Returns:
a valid JMenu object containing custom menu items
Since:
DTS 3.4.0

getModuleMenuItems

public JMenuItem[] getModuleMenuItems(int group)
Returns menu items to be added to an existing DTSEditor menu group.

Parameters:
group - an integer representing a particular menu group from the DTS Editor
Returns:
a valid JMenuItem array populated with the custom menu item(s)
Since:
DTS 3.4.0
See Also:
FILE_MENU_ITEMS, VIEW_MENU_ITEMS, TOOLS_MENU_ITEMS, OPTIONS_MENU_ITEMS, HELP_MENU_ITEMS

getModuleToolbarItems

public JComponent[] getModuleToolbarItems()
Buttons to be displayed in the DTS Editor toolbar.

Returns:
a valid JComponent array populated with the custom toolbar button(s)
Since:
DTS 3.4.0

getDTSModuleConfigFile

public String getDTSModuleConfigFile()
Return a xml file name (.xml) for the module configuration file. If only file name is specified, the file will be created in bin/editor directory. If a relative path is spacified, the file will be created relative to bin directory.

For null, no DTSModuleConfig will be created.

Returns:
String File Name

setDTSModuleConfig

public void setDTSModuleConfig(DTSModuleConfig config)
If getDTSModuleConfigFile() returns a file path, the corresponding DTSModuleConfig is set by DTS Editor using this method.

Parameters:
config - DTSModuleConfig

getDTSModuleConfig

public DTSModuleConfig getDTSModuleConfig()
Returns DTSModuleConfig if module config file is specified using getDTSModuleConfigFile(). Otherwise null.

Returns:
DTSModuleConfig or null if no module config file is specified.


Copyright © 2011. All Rights Reserved.