Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.poseidon.generator

Class CodeGenerationConnector

com.gentleware.poseidon.generator.CodeGenerationConnector

public final class CodeGenerationConnector


This class offers a set of static methods for installing a new plugin with code generation skills and tightly integrate it with the existing code generation framework.
Authors:
Thorsten Sturm


 Method Summary
public static void   addActionListener(ActionListener listener)
Adds a new ActionListener to the list of listeners for the code generation. 
public static void   addExternalLibraries(Generator generator, String origin, List libraries)
Adds a list of external libraries (a collections of velocity macros) to the given generator. 
public static void   addExternalPreparationClasses(Generator generator, String origin, Map preparationClasses)
Adds a map of external preparation classes (subclasses of PreparedElement) to the given generator. 
public static void   addMacroLibrary(String origin, String file)
Adds a new velocity macro library to the list of known macro libraries. 
public static void   addNewLanguage(String language, String languageKey, GeneratorController genControl)
 
public static void   addNewLanguage(String language, String languageKey, GeneratorController genControl, ResourceId resourceId)
 
public static void   addSettingsPanel(String language, JPanel panel, String panelName, ResourceId settingsTabResourceId)
Adds a new settings panel for a plugin. 
public static void   addValidElementClass(String origin, Class elementClass)
/** Adds a new class of elements to the list of valid element classes for code generation. 
public static CodeGenerationDialog   getGenerationDialog()
Returns null, or the currently running instance of the dialog. 
public static Generator   getGenerator(String pluginName)
Returns the generator used for code generation from the given plugin. 
public static String   getLowercaseLanguage(String language)
Returns the lower-cased language name, as it appears in the Services.getInstance().getConfiguration(). 
public static void   removeActionListener(ActionListener listener)
Removes a listener from the list of known listeners. 
public static void   removeExternalLibraries(Generator generator, String origin)
Removes all external libraries registered under their origin from the given generator. 
public static void   removeExternalPreparationClasses(Generator generator, String origin)
Removes the map of external preparation classes registered for the given origin from the generator. 
public static boolean   removeGeneratorController(String origin)
Removes the generator controller added under the given origin from the list of known generator controllers for the code generation. 
public static void   removeLanguage(String language)
/** Removes a language from the list of known and choosable languages for code generation. 
public static void   removeMacroLibrary(String origin, String file)
Removes a velocity macro library from the list of known macro libraries. 
public static void   removeSettingsPanel(ResourceId settingsTabResourceId)
 
public static void   removeSettingsPanel(String language, String pluginName)
Removes a settings panel from the list of known panels. 
public static void   removeSettingsPanel(String pluginName)
 
public static void   removeValidElementClass(String origin, Class elementClass)
Remove class of elements from the list of valid element classes for code generation. 
arrow_up
 

Tagged Values
static false
 

 Method Detail

addActionListener

public static void addActionListener(ActionListener listener)


Adds a new ActionListener to the list of listeners for the code generation.  
Parameters:
listener - The new listener to be added.
arrow_up


addExternalLibraries

public static void addExternalLibraries(Generator generator, String origin, List libraries)


Adds a list of external libraries (a collections of velocity macros) to the given generator. The new libraries are registered under their origin.  
Parameters:
generator - The Generator instance, the external library should be added to.
origin - A unique name for the plugin being the owner of the new libraries.
libraries - The list of macro libraries to be added.
arrow_up


addExternalPreparationClasses

public static void addExternalPreparationClasses(Generator generator, String origin, Map preparationClasses)


Adds a map of external preparation classes (subclasses of PreparedElement) to the given generator. The map contains instances of Class only.  
Parameters:
generator - The Generator instance, the external preparation classes should be added to.
origin - A unique name for the plugin being the owner of the new preparation classes.
preparationClasses - The map of preparation classes to be added.
arrow_up


addMacroLibrary

public static void addMacroLibrary(String origin, String file)


Adds a new velocity macro library to the list of known macro libraries.  
Parameters:
origin - Name of the plugin, the library should be added for.
file - Name of the macro library file to be added.
arrow_up


addNewLanguage

public static void addNewLanguage(String language, String languageKey, GeneratorController genControl)

Parameters:
language - ...
languageKey -
genControl -
Since:
2.1
arrow_up


addNewLanguage

public static void addNewLanguage(String language, String languageKey, GeneratorController genControl, ResourceId resourceId)

Parameters:
language -
languageKey -
genControl -
resourceId -
arrow_up


addSettingsPanel

public static void addSettingsPanel(String language, JPanel panel, String panelName, ResourceId settingsTabResourceId)


Adds a new settings panel for a plugin. The settings panel can either be general for the plugin or special for a language. The panel itself has to be created and layouted in advance. Later changes are currently not supported. The panel is displayed as part of the settings dialog for the code generation of a choosen language. There has to be a language specific plugin panel in order to have anything displayed at all. The general will then be displayed in the upper part of the resulting tab, while the language specific panel will be displayed in the lower part of it. No language parameter means the panel is meant to be general for the plugin.  
Parameters:
language - Displayname of the language the panel should be added to.
panel - The panel to be added.
panelName - Displayname of the panel
settingsTabResourceId -
arrow_up


addValidElementClass

public static void addValidElementClass(String origin, Class elementClass)


/** Adds a new class of elements to the list of valid element classes for code generation. Generating code works for elements of known element classes only.  
Parameters:
origin - Name of the plugin, the information should be added for.
elementClass - Class of elements to be added.
arrow_up


getGenerationDialog

public static CodeGenerationDialog getGenerationDialog()


Returns null, or the currently running instance of the dialog.  
Returns:
arrow_up


getGenerator

public static Generator getGenerator(String pluginName)


Returns the generator used for code generation from the given plugin.  
Parameters:
pluginName - The name of the plugin.
Returns:
The Generator instance used for code generation.
arrow_up


getLowercaseLanguage

public static String getLowercaseLanguage(String language)


Returns the lower-cased language name, as it appears in the Services.getInstance().getConfiguration().  
Parameters:
language - The language name (e.g. 'Java').
Returns:
The language name converted to lower case.
arrow_up


removeActionListener

public static void removeActionListener(ActionListener listener)


Removes a listener from the list of known listeners.  
Parameters:
listener - Listener to be removed.
arrow_up


removeExternalLibraries

public static void removeExternalLibraries(Generator generator, String origin)


Removes all external libraries registered under their origin from the given generator.  
Parameters:
generator - The Generator instance, the external library should be removed from.
origin - A unique name for the plugin being the owner of the new libraries.
arrow_up


removeExternalPreparationClasses

public static void removeExternalPreparationClasses(Generator generator, String origin)


Removes the map of external preparation classes registered for the given origin from the generator.  
Parameters:
generator - The Generator instance, the external preparation classes should be added to.
origin - A unique name for the plugin being the owner of the new preparation classes.
arrow_up


removeGeneratorController

public static boolean removeGeneratorController(String origin)


Removes the generator controller added under the given origin from the list of known generator controllers for the code generation.  
Parameters:
origin - A unique name for the plugin being the owner of the new generator controller.
Returns:
True, if removing the generator controller was successful, otherwise false.
arrow_up


removeLanguage

public static void removeLanguage(String language)


/** Removes a language from the list of known and choosable languages for code generation. If the language still has features, they will not be removed. The configuration entries are left unchanged, so that they can be reactivated once the plugin is reinstalled.  
Parameters:
language - Displayname of new language (e.g. Java).
arrow_up


removeMacroLibrary

public static void removeMacroLibrary(String origin, String file)


Removes a velocity macro library from the list of known macro libraries.  
Parameters:
origin - Name of the plugin, the library should be removed for.
file - Name of macro library file to be removed.
arrow_up


removeSettingsPanel

public static void removeSettingsPanel(ResourceId settingsTabResourceId)

Parameters:
settingsTabResourceId -
arrow_up


removeSettingsPanel

public static void removeSettingsPanel(String language, String pluginName)


Removes a settings panel from the list of known panels. The panel to be removed is identified by the language and plugin it is created for or by passing the instance of the panel itself. If only a plugin name is given, the general panel for this plugin will be removed. Each previously added panel has to be removed seperately.  
Parameters:
language - Displayname of the language the panel to be removed was created for.
pluginName - Displayname of the plugin the panel to be removed was created for.
arrow_up


removeSettingsPanel

public static void removeSettingsPanel(String pluginName)

Parameters:
pluginName -
arrow_up


removeValidElementClass

public static void removeValidElementClass(String origin, Class elementClass)


Remove class of elements from the list of valid element classes for code generation. Generating code works for elements of this class is no longer possible.  
Parameters:
origin - Name of the plugin, the information should be removed for.
elementClass - Class of elements to be removed.
arrow_up
Created  2004 - 10 - 21

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.