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.editor

Class TabJavaSource


public final class TabJavaSource

Uses the _editorPane provided in the imported example package to implement source code view. The _editorPane is by NetBeans, adapted from the example.


 Constructor Summary
public   TabJavaSource()
 
public   TabJavaSource(String title )
 
arrow_up
 

 Method Summary
public void   addAllowedClass(Class metamodelInterface )
Adds a new type of UML model element for which source code may be displayed. 
public void   changedUpdate(DocumentEvent e )
 
public void   clearAllowedClasses()
Resets the list of classes for which source code should be displayed. 
public void   componentHidden(ComponentEvent e )
 
public void   componentMoved(ComponentEvent e )
 
public void   componentResized(ComponentEvent e )
 
public void   componentShown(ComponentEvent e )
 
public JEditorPane   getEditorPane()
You can retrieve the EditorPane that renders the text, if you really think you need it. 
public Object   getTarget()
 
public void   insertUpdate(DocumentEvent e )
 
public void   refresh()
 
public void   removeUpdate(DocumentEvent e )
Paste fires insert, and then update. 
public void   resetContentType()
Resets the editor settings to process Java. 
public void   resetLanguage()
 
public void   setContentType(String newType )
Changes the content type to something else, including an update to everything else that is required. 
public void   setDisplayIndex(int index )
Resets language and allowed elements to factory defaults: Java and Classifier+Feature. 
public void   setGeneratedLanguage(String languageKey , String displayText )
Sets the language that will be generated to the display. 
public void   setTarget(Object t )
Re-generates the code if a class is set as target, clears otherwise. 
public boolean   shouldBeEnabled()
 
arrow_up
 

 

 Constructor Detail

TabJavaSource

public TabJavaSource TabJavaSource()

 
arrow_up
 
 

TabJavaSource

public TabJavaSource TabJavaSource(String title )

 
arrow_up
 

 Method Detail

addAllowedClass

public void addAllowedClass(Class metamodelInterface )

Adds a new type of UML model element for which source code may be displayed. If the selection does not fit the list of allowed classes, no attempt is made to generate code, and a placeholder text is displayed. If the selected element is allowed, code is generated using the Generator for the currently chosen language. The selected element is allowed iff the element is instanceof one of the interfaces that are currently registered. The default is Classifier and Feature for the language 'Java'.
Parameters:
metamodelInterface - A class of the UML JMI interface set. Note that this only specifies that the attempt is made to generate code for this type of element. This method cannot be used to create all-new sorts of code generation.
 
arrow_up
 
 

changedUpdate

public void changedUpdate(DocumentEvent e )

 
arrow_up
 
 

clearAllowedClasses

public void clearAllowedClasses()

Resets the list of classes for which source code should be displayed. 
arrow_up
 
 

componentHidden

public void componentHidden(ComponentEvent e )

 
arrow_up
 
 

componentMoved

public void componentMoved(ComponentEvent e )

 
arrow_up
 
 

componentResized

public void componentResized(ComponentEvent e )

 
arrow_up
 
 

componentShown

public void componentShown(ComponentEvent e )

 
arrow_up
 
 

getEditorPane

public JEditorPane getEditorPane()

You can retrieve the EditorPane that renders the text, if you really think you need it. This can be useful for eg setting another content type.
Returns:
The JEditorPane that renders the text.
 
arrow_up
 
 

getTarget

public Object getTarget()

 
arrow_up
 
 

insertUpdate

public void insertUpdate(DocumentEvent e )

 
arrow_up
 
 

refresh

public void refresh()

 
arrow_up
 
 

removeUpdate

public void removeUpdate(DocumentEvent e )

Paste fires insert, and then update. 
arrow_up
 
 

resetContentType

public void resetContentType()

Resets the editor settings to process Java. 
arrow_up
 
 

resetLanguage

public void resetLanguage()

 
arrow_up
 
 

setContentType

public void setContentType(String newType )

Changes the content type to something else, including an update to everything else that is required. If you change the content type on the editor directly, the update functionality according to the Target is lost.

After setting another content type, this panel does not update the model any more when the user has typed something, as the content is probably not Java and not suitable to the Java source processing. To enable the processing again, use resetContentType(). 

arrow_up
 
 

setDisplayIndex

public void setDisplayIndex(int index )

Resets language and allowed elements to factory defaults: Java and Classifier+Feature. 
arrow_up
 
 

setGeneratedLanguage

public void setGeneratedLanguage(String languageKey , String displayText )

Sets the language that will be generated to the display. Using this name, the GeneratorFactory is queried for the appropriate GeneratorController.
Parameters:
languageKey - The key under which the GeneratorController is registered. If nothing is registered for this key, nothing is changed.
 
arrow_up
 
 

setTarget

public void setTarget(Object t )

Re-generates the code if a class is set as target, clears otherwise. 
arrow_up
 
 

shouldBeEnabled

public boolean shouldBeEnabled()

 
arrow_up
 

Created  2003 - 3 - 4

    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 2001 Gentleware AG, Vogt-Kölln-Str.30, 22527 Hamburg, Germany. All Rights Reserved.

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