com.altair.hwm.toolkit.frame
Class HWMMenuToolBarHandler

java.lang.Object
  extended by com.altair.hwm.toolkit.frame.HWMMenuToolBarHandler
Direct Known Subclasses:
HWMDsgnMenuToolBarHandler

public class HWMMenuToolBarHandler
extends java.lang.Object

Title: HWMMenuToolBarHandler

Description: This class handles the enabling/disabling of menu items as and when events occur

Company: Altair Engineering, Inc.


Constructor Summary
HWMMenuToolBarHandler(java.util.EventListener evtListener, boolean bPMMode)
          Constructor
 
Method Summary
 HWMMenuBarContainer CreateMenuBar()
          Create the default menubar for app mode
 HWMToolBarContainer CreateToolBar()
          Create the default toolbars for app mode
 HWMMenuBarContainer GetMenuBar()
          Get the current menubar, if null creates a new one
 HWMToolBarContainer GetToolBar()
          Gets the current toolbar.
 HWMTplProps GetTplProps()
          Returns the pmt props to use
 boolean IsMenuBarItemVisible(java.lang.String strMenu, java.lang.String strMenuItem)
          Returns a flag signifying if the menu item is visible
 boolean IsToolBarItemVisible(java.lang.String strToolBar, java.lang.String strItemName)
          Returns a flag signifying if the toolbar button is visible.
 boolean IsViewWorkflowSelected()
          Returns the show worklflow value of the current menubar
 void OnInstanceActivated(HWMModelInstance hwmModelInstOld, HWMModelInstance hwmModelInstNew)
          This is invoked by the frame when an instance is made active.
 void OnInstanceClosed(java.lang.String strName)
          This is invoked by the frame when an instance is closed
 void SetMenuBar(HWMMenuBarContainer hwmMenuBarContainer)
          Set the current menubar
 void SetToolBar(HWMToolBarContainer hwmToolBarContainer)
          Set the current toolbar
 void SetTplProps(HWMTplProps propsTpl)
          Sets the pmt props to use
 void ShowToolBar(java.lang.String strToolBarName, boolean bShow)
          Show or hide the toolbars
 void UpdateMRUMenu(boolean bShowTpls, java.lang.String[] arrszMRU)
          Updates the mru sub menu
 void UpdateWindowsMenu(java.lang.String strModelInst)
          This is invoked by the OnInstanceActivated function.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HWMMenuToolBarHandler

public HWMMenuToolBarHandler(java.util.EventListener evtListener,
                             boolean bPMMode)
Constructor

Parameters:
evtListener - The listener that needs to receive all the events for toolbar and menubar
bPMMode - If true, then PM has started EPIC else it is in stand-alone mode
Method Detail

CreateMenuBar

public HWMMenuBarContainer CreateMenuBar()
                                  throws java.lang.Exception
Create the default menubar for app mode

Returns:
HWMMenuBarContainer the menubar containing the default menus
Throws:
throws - Exception
java.lang.Exception

CreateToolBar

public HWMToolBarContainer CreateToolBar()
                                  throws java.lang.Exception
Create the default toolbars for app mode

Returns:
HWMToolBarContainer the toolbar containing sub toolbars
Throws:
throws - Exception
java.lang.Exception

SetToolBar

public void SetToolBar(HWMToolBarContainer hwmToolBarContainer)
Set the current toolbar

Parameters:
hwmToolBar - the current toolbar to use

GetToolBar

public HWMToolBarContainer GetToolBar()
                               throws java.lang.Exception
Gets the current toolbar. If null, creates a new one

Returns:
HWMToolBarContainer the current toolbar
Throws:
java.lang.Exception

SetMenuBar

public void SetMenuBar(HWMMenuBarContainer hwmMenuBarContainer)
Set the current menubar

Parameters:
hwmMenuBarContainer - the current menubar to use

GetMenuBar

public HWMMenuBarContainer GetMenuBar()
                               throws java.lang.Exception
Get the current menubar, if null creates a new one

Returns:
HWMMenuBarContainer the current menubar
Throws:
java.lang.Exception

ShowToolBar

public void ShowToolBar(java.lang.String strToolBarName,
                        boolean bShow)
                 throws java.lang.Exception
Show or hide the toolbars

Parameters:
strToolBarName - The name for the toolbar
bShow - If true, the toolbar is shown else hidden
Throws:
java.lang.Exception

IsMenuBarItemVisible

public boolean IsMenuBarItemVisible(java.lang.String strMenu,
                                    java.lang.String strMenuItem)
Returns a flag signifying if the menu item is visible

Parameters:
strMenu - The menu in which the menu item is present
strMenuItem - The menu item name
Returns:
boolean A flag indicating if the menu item is visible or not. If not found returns false.
Throws:
java.lang.Exception

IsToolBarItemVisible

public boolean IsToolBarItemVisible(java.lang.String strToolBar,
                                    java.lang.String strItemName)
Returns a flag signifying if the toolbar button is visible. It returns true if the property - "visible" is set to true or if it is visible. It will return false if the property - "visible" is set to false and if btn is not visible.

Parameters:
strToolBar - The toolbar in which the button is present
strItemName - The item name for the button
Returns:
boolean A flag indicating if the toolbar item is visible or not. If not found returns false.
Throws:
java.lang.Exception

OnInstanceActivated

public void OnInstanceActivated(HWMModelInstance hwmModelInstOld,
                                HWMModelInstance hwmModelInstNew)
                         throws java.lang.Exception
This is invoked by the frame when an instance is made active. This is over ridden by the dsgn sub class and this fn is not called by the subclass

Parameters:
hwmModelInstOld - The old model instance
hwmModelInstNew - The new model instance
Throws:
java.lang.Exception

OnInstanceClosed

public void OnInstanceClosed(java.lang.String strName)
                      throws java.lang.Exception
This is invoked by the frame when an instance is closed

Parameters:
strName - The name of the model instance closed
Throws:
java.lang.Exception

UpdateWindowsMenu

public void UpdateWindowsMenu(java.lang.String strModelInst)
                       throws java.lang.Exception
This is invoked by the OnInstanceActivated function. This will update the windows menu item with all the open instances and select the appropriate one. If the instance is not present (will happen when an inst is created) this will add the inst to the popup menu and vector

Parameters:
strModelInst - The current model instance
Throws:
java.lang.Exception

SetTplProps

public void SetTplProps(HWMTplProps propsTpl)
Sets the pmt props to use

Parameters:
propTpl - The props to use to create menubars and toolbars

GetTplProps

public HWMTplProps GetTplProps()
Returns the pmt props to use

Returns:
HWMTplProps The props to use to create menubars and toolbars

IsViewWorkflowSelected

public boolean IsViewWorkflowSelected()
Returns the show worklflow value of the current menubar

Returns:
True If workflow should be shown, false if not

UpdateMRUMenu

public void UpdateMRUMenu(boolean bShowTpls,
                          java.lang.String[] arrszMRU)
Updates the mru sub menu

Parameters:
bShowTpls - If false, the templates should not be shown.
arrszMRU - The new entries for the mru sub enu