|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.plugin.CommandPlugger
public class CommandPlugger
Plugin handler superclass with the ability to store the localized menu labels and a module name for each plugin. This class is under development, use it at your own risk!
| Constructor Summary | |
|---|---|
CommandPlugger()
Constructs an empty plugger. |
|
| Method Summary | |
|---|---|
protected void |
addCommand(java.lang.String cmd,
java.lang.String modname,
java.lang.Object icon,
java.lang.String folder,
java.lang.Class cl)
Adds a plugin. |
protected void |
addFolder(java.lang.String name,
java.lang.Class cl)
Adds a plugin folder. |
protected void |
clear()
Removes all plugins. |
java.lang.String |
getCommand(int i)
Gets a command. |
int |
getCommandCount()
Gets the number of commands (plugins). |
java.lang.String |
getCommandFolder(java.lang.String cmd)
Gets the folder name for a command. |
java.lang.Object |
getCommandIcon(int i)
Gets the small icon for a command. |
java.lang.String |
getCommandLabel(int i)
Gets the menu item label for a command. |
java.lang.Class |
getCommandPluggerClass(int i)
Gets the class of the plugger the specified plugin corresponds to. |
java.util.ResourceBundle |
getCommandPluggerRC(int i)
Gets the resource bundle of the plugger the specified plugin corresponds to. |
int |
getFolderCount()
Gets the number of folders. |
java.lang.String |
getFolderLabel(int i)
Gets the label of a folder. |
java.lang.String |
getFolderLabel(java.lang.String folder)
Gets the label of a folder. |
java.lang.String |
getFolderName(int i)
Gets the name of a folder. |
java.lang.Class |
getFolderPluggerClass(int i)
Gets the class of the plugger that created the specified folder. |
java.util.ResourceBundle |
getFolderPluggerRC(int i)
Gets the resource bundle of the plugger that created the specified folder. |
java.util.ResourceBundle |
getFolderPluggerRC(java.lang.String name)
Gets the resource bundle of the plugger that created the specified folder. |
java.lang.String |
getModuleName(java.lang.String cmd)
Gets the module name for a command. |
static java.util.ResourceBundle |
getResourceBundle(java.lang.String name,
java.lang.String locales)
Utility method to get a resource bundle. |
void |
init(java.lang.String locales)
Initializes the plugger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandPlugger()
| Method Detail |
|---|
public void init(java.lang.String locales)
locales - the default locales or nulladdCommand(String, String, Object, String, Class),
addFolder(String, Class)protected final void clear()
protected final void addCommand(java.lang.String cmd,
java.lang.String modname,
java.lang.Object icon,
java.lang.String folder,
java.lang.Class cl)
init(String) method.
cmd - the commandmodname - the module nameicon - the icon object or nullfolder - folder name in
"/folder"
or "/folder1/.../folderN" form,
the first character is the field separator
(slash "/" is recommended)cl - this plugger classinit(String),
addFolder(java.lang.String, java.lang.Class)
protected final void addFolder(java.lang.String name,
java.lang.Class cl)
throws java.lang.IllegalArgumentException
init(String) method.
name - folder name in
"/folder"
or "/folder1/.../folderN" form,
the first character is the field separator
(slash "/" is recommended)cl - this plugger class
java.lang.IllegalArgumentException - if a parent folder was not addedinit(String),
addCommand(String, String, Object, String, Class)public final int getCommandCount()
public final java.lang.String getCommand(int i)
i - the command index
public final java.lang.String getCommandLabel(int i)
i - the command index
public final java.lang.Object getCommandIcon(int i)
i - the command index
public final java.lang.String getCommandFolder(java.lang.String cmd)
cmd - the command
public final java.lang.Class getCommandPluggerClass(int i)
i - the command index
public final int getFolderCount()
public final java.lang.String getFolderName(int i)
i - the folder index
public final java.lang.String getFolderLabel(int i)
i - the folder index
public final java.lang.String getFolderLabel(java.lang.String folder)
folder - the folder name
public final java.lang.Class getFolderPluggerClass(int i)
i - the folder index
public final java.util.ResourceBundle getFolderPluggerRC(int i)
i - the folder index
public final java.util.ResourceBundle getFolderPluggerRC(java.lang.String name)
name - the folder name
public final java.util.ResourceBundle getCommandPluggerRC(int i)
i - the command index
public final java.lang.String getModuleName(java.lang.String cmd)
cmd - the command
public static java.util.ResourceBundle getResourceBundle(java.lang.String name,
java.lang.String locales)
name - resource file pathlocales - the locales to use or null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||