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

Class PoseidonUIConnector


public final class PoseidonUIConnector

A facade class for manipulating the UI of Poseidon. This class was extracted from PoseidonCoreConnector.


 Method Summary
public static void   addDetailsTab(String tabName , Component newTab )
Adds a tab to the details pane. 
public static void   addDetailsTab(Component newTab )
Just calls addDetailsTab with the name of the given component. 
public static void   addEditorTab(String name , Component newTab )
Adds a tab under the given name to the main editor pane. 
public static boolean   addHiddenTagDefinition(String regex )
* Specifies that all tag definition tag types (names) that match the regular expression should not be shown * to the user (but have meaning to Poseidon (plug-ins) only). 
public static boolean   addMenuItem(String resource , String itemName , Action action , KeyStroke accelerator , char defMnemonic , String menuName )
Adds a menu item to Poseidon. 
public static void   addMenuSeparator(String menu )
Adds a separator line to the end of the given menu. 
public static void   addNavigatorPopupmenuAction( ArgoAction action )
Adds an action-object to the Navigators popupmenu. 
public static void   addSettingsTab( SettingsTabPanel tab )
Adds a tab to the Edit->Settings window. 
public static boolean   addSubMenu(String resource , String name , char defMnemonic , String menuName )
Inserts a submenu in the given menu. 
public static void   addToolbarEntry(Action action )
Adds a button to the main toolbar. 
public static void   addToolbarEntryAfterAnother(Action newAction , Action previous )
Adds a button to the main toolbar right after the putton of the previous action. 
public static JFrame   getApplicationWindow()
Returns the main window. 
public static Component   getDetailsTab(String tabName )
 
public static void   insertDetailsTab(int pos , Component newTab )
 
public static void   insertDetailsTab(int pos , String tabTitle , Component newTab )
 
public static boolean   insertMenuItem(String resource , String itemName , Action action , KeyStroke accelerator , char defMnemonic , String menuName , String before )
Inserts a menu item before the menu item given in 'before'. 
public static void   putPropertyPanel(Class baseClass , PropertyPanel panel )
Adds a property panel for another type of element. 
public static void   removeDetailsTab(Component tab )
Removes the tab from the details pane. 
public static void   removeEditorTab(Component newTab )
Removes the given tab from the main editor pane. 
public static boolean   removeHiddenTagDefinition(String name )
Removes a pattern from the list that specifies tag definition tag types (names) that should be hidden from the * user. 
public static boolean   removeMenuItem(String itemName , String menuName )
Removes the given menu item. 
public static void   removeNavigatorPopupmenuAction( ArgoAction action )
 
public static void   removePropertyPanel(Class baseClass )
Uninstalls the property panel for a base class. 
public static void   removeSettingsTab( SettingsTabPanel tab )
Removes a tab from the Edit->Settings window. 
public static void   removeToolbarEntry(Action action )
Removes a toolbar button. 
public static void   selectDetailsTab(String tabName )
 
public static void   showStatus(String message )
Shows a message in the status bar of the main window. 
arrow_up
 

 

 Method Detail

addDetailsTab

public static void addDetailsTab(String tabName , Component newTab )

Adds a tab to the details pane. The details pane is the area on the lower right. The common tabs are Properties, style, Tagged Values, and so on. Technically, the details pane is a JTabbedPane where you can add and remove your own tabs. You should use this way of displaying your plugin if it is useful for all or most of the objects in the project. You can disable your tab if it is not applicable to the current target of Poseidon. 
arrow_up
 
 

addDetailsTab

public static void addDetailsTab(Component newTab )

Just calls addDetailsTab with the name of the given component.  
arrow_up
 
 

addEditorTab

public static void addEditorTab(String name , Component newTab )

Adds a tab under the given name to the main editor pane. The editor pane is the place where you see diagrams (or tables). You can add another tab here, if your plugin requires it. You should use this way of displaying your plugin if it provides an alternative view of several model elements at the same time, and if they need a lot of space. 
arrow_up
 
 

addHiddenTagDefinition

public static boolean addHiddenTagDefinition(String regex )

* Specifies that all tag definition tag types (names) that match the regular expression should not be shown * to the user (but have meaning to Poseidon (plug-ins) only). * A plug-in will have to call this on install if it uses tag definitions internally.
Parameters:
regex - a regular expression describing tag types of a tag definitions that should not be displayed to the user
Returns:
true if the pattern was not already included in the list of patterns to hide *
See also:
java.util.regex.Pattern
 
arrow_up
 
 

addMenuItem

public static boolean addMenuItem(String resource , String itemName , Action action , KeyStroke accelerator , char defMnemonic , String menuName )

Adds a menu item to Poseidon. The standard menus of Poseidon (that is, the alternatives for the parameter menuName) are File, Edit, View, Create Diagram, Arrange, Generation, Critique, Help. All but the CE edition also have the menu Plugins.

The name of the menu item has to be given to the action. This is where the menu display name is taken from. If you give different values to the action and to this method, you will NOT see an entry based on internationalization of resource + itemName, but an entry based on the name of the Action. The itemName, however, is used as parameter to removeMenuItem. So for consistency, you should really internationalize the name you give to the action by Action.setName() with a call to PoseidonResourceConnector.localize(<resource>, <itemName>), too.

The definition of the mnemonic works as follows. The parameters resource, itemName, and defMnemonic are used to determine which character of the menu item name is underscored and can be used as mnemonic key for the menu item. To determine the mnemonic char, the resource bundle resource is inspected for an entry <itemName>_mnemonic. From this string, the first character is used as mnemonic. If this fails, the character given in defMnemonic is used as mnemonic.

So, to set up a menu item, define the action with the correct internationalized name. In your resource bundle, you have an entry for <itemName>, and another for <itemName>_mnemonic.

To internationalizationize the accelerator (the key combination like Ctrl-O for "Open File"), you can use PoseidonResourceConnector.getShortcut(name, key).

Please note also that adding a menu to Poseidon does NOT mean that the menu item is present when Poseidon is running als Netbeans/Forte module. This may be implemented in later versions.

Parameters:
resource - The resource name where the internationalization of the mnemonic resides.
itemName - The name of the menu item before internationalization.
action - What is to be done.
defMnemonic - The mnemonic for this menu item (before internationalization).
menuName - The menu title where the menuItem is to be added (before internationalization).
Returns:
True if the insertion worked.
See also:
PoseidonResourceConnector#getShortcut(String,String)
PoseidonResourceConnector#localize(String,String)
 
arrow_up
 
 

addMenuSeparator

public static void addMenuSeparator(String menu )

Adds a separator line to the end of the given menu.
Parameters:
menu - The menu name (before internationalization).
 
arrow_up
 
 

addNavigatorPopupmenuAction

public static void addNavigatorPopupmenuAction( ArgoAction action )

Adds an action-object to the Navigators popupmenu. The Popupmenu is displayed when the user right-clicks the treeview. For example, the refactoring-browser uses this method to add "Find Occurences" and "Guarded Rename" to the popup, so that the user does not have to open the Refactoring-Panel manually before renaming a method. 
arrow_up
 
 

addSettingsTab

public static void addSettingsTab( SettingsTabPanel tab )

Adds a tab to the Edit->Settings window.
See also:
org.argouml.ui.SettingsTabPanel
 
arrow_up
 
 

addSubMenu

public static boolean addSubMenu(String resource , String name , char defMnemonic , String menuName )

Inserts a submenu in the given menu.
Parameters:
resource - The name of the resource with the menu name.
name - The name of the submenu (before internationalization).
defMnemonic - The shortcut key.
menuName - The name of the menu where the subMenu is inserted (before internationalization).
Returns:
True if the insertion worked.
 
arrow_up
 
 

addToolbarEntry

public static void addToolbarEntry(Action action )

Adds a button to the main toolbar.
Parameters:
action - Contains the UI and action information on the button.
 
arrow_up
 
 

addToolbarEntryAfterAnother

public static void addToolbarEntryAfterAnother(Action newAction , Action previous )

Adds a button to the main toolbar right after the putton of the previous action. If the 'previous' action does not exist, the button is appended.
Parameters:
newAction - The action that is to be inserted.
previous - The action after which the new action should be located.
 
arrow_up
 
 

getApplicationWindow

public static JFrame getApplicationWindow()

Returns the main window. 
arrow_up
 
 

getDetailsTab

public static Component getDetailsTab(String tabName )

 
arrow_up
 
 

insertDetailsTab

public static void insertDetailsTab(int pos , Component newTab )

 
arrow_up
 
 

insertDetailsTab

public static void insertDetailsTab(int pos , String tabTitle , Component newTab )

 
arrow_up
 
 

insertMenuItem

public static boolean insertMenuItem(String resource , String itemName , Action action , KeyStroke accelerator , char defMnemonic , String menuName , String before )

Inserts a menu item before the menu item given in 'before'.
Returns:
True if the insertion worked.
See also:
#addMenuItem(String,String,Action,KeyStroke,char,String)
 
arrow_up
 
 

putPropertyPanel

public static void putPropertyPanel(Class baseClass , PropertyPanel panel )

Adds a property panel for another type of element. When displaying the properties of another element, the property panel is retrieved based on the type of element.  
arrow_up
 
 

removeDetailsTab

public static void removeDetailsTab(Component tab )

Removes the tab from the details pane. Should be called when a plugin is disabled. 
arrow_up
 
 

removeEditorTab

public static void removeEditorTab(Component newTab )

Removes the given tab from the main editor pane. Should be called when a plugin is disabled. 
arrow_up
 
 

removeHiddenTagDefinition

public static boolean removeHiddenTagDefinition(String name )

Removes a pattern from the list that specifies tag definition tag types (names) that should be hidden from the * user. * A plug-in will have to call this on uninstall if it uses tag definitions internally.
Parameters:
name - a regular expression that probably was previously added with addHiddenTagDefinition
Returns:
true if the pattern was previously included in the list of tag definition tag types to hide
 
arrow_up
 
 

removeMenuItem

public static boolean removeMenuItem(String itemName , String menuName )

Removes the given menu item. Should be called when a plugin is disabled.
Parameters:
itemName - The name of the entry to be removed (before internationalization).
menuName - The name of the menu (before internationalization).
 
arrow_up
 
 

removeNavigatorPopupmenuAction

public static void removeNavigatorPopupmenuAction( ArgoAction action )

 
arrow_up
 
 

removePropertyPanel

public static void removePropertyPanel(Class baseClass )

Uninstalls the property panel for a base class. Useful when uninstalling a plugin.  
arrow_up
 
 

removeSettingsTab

public static void removeSettingsTab( SettingsTabPanel tab )

Removes a tab from the Edit->Settings window. Should be called when a plugin is turned off. 
arrow_up
 
 

removeToolbarEntry

public static void removeToolbarEntry(Action action )

Removes a toolbar button. Should be called when a plugin is disabled. 
arrow_up
 
 

selectDetailsTab

public static void selectDetailsTab(String tabName )

 
arrow_up
 
 

showStatus

public static void showStatus(String message )

Shows a message in the status bar of the main window. 
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.