com.altair.hwm.toolkit.page
Class HWMModelInstance

java.lang.Object
  extended by com.altair.hwm.toolkit.page.HWMModelInstance
All Implemented Interfaces:
IHWMFrameWork
Direct Known Subclasses:
HWMAppModelInstance, HWMDsgnModelInstance

public abstract class HWMModelInstance
extends java.lang.Object
implements IHWMFrameWork

Title: HWMModelInstance

Description: The generic model instance. This will contain info about the project file. in design mode, it contains info about the def prj file. This also implements the framework interface

Company: Altair Engineering, Inc.


Field Summary
static int APPTYPE_APP
           
static int APPTYPE_TODO
           
static java.lang.String PROP_MODEL_PRJNAME
           
static java.lang.String PROP_MODEL_TPLNAME
          These statics represent the properties fired by the model instance
static java.lang.String PROP_TPLDISPLAY_NAME
           
static java.lang.String VERSION_PRJ
           
static java.lang.String VERSION_TPL
           
 
Constructor Summary
HWMModelInstance(java.awt.Component frameEPIC, IHWMFrame iHWMFrame)
          Constructor
 
Method Summary
 void AddHWMEventListener(HWMEventListener hwmEventListener)
          Add a bean as an HWMEventListener
 void addPropertyChangeListener(java.beans.PropertyChangeListener propListener)
          Add a property change listener
 void AddToolkitEventListener(HWMToolkitEventListener listenerEvent)
          Adds a HWMToolkitEventListener
 void AppendToTitle(java.lang.String strTitleSuffix)
          Append to the title of the application
 java.lang.String ApplyTemplateProperties(java.util.Properties propsParamVals)
          Apply the properties read.
 void BringToFront()
          This gets the application's view to the front
 void ClearAll()
          Clears al the models
 void CloseInstance()
          Close this instance
 java.lang.Object ExecuteJavaScript(java.lang.Object objScope, java.lang.String strScript)
          Execute a JavaScript ("this" modelinstance will be the scope) and return the result
 void Exit()
          This is invoked by a bean when the application should exit.
 void ExportPageTCL(java.lang.String strFilename)
          Export the current page onto the given filename as a TCL task.
static int GetAppTypeFromFile(java.io.File file)
          Get the app type for the template
 int GetAppTypeFromTplPrefs()
          Get the type of application
 java.util.Vector GetBeans(java.lang.String strBeanInstanceName)
          Get the bean instance by the given name
 HWMBindingInfoMgr GetBindingInfoMgr()
          Get the binding info mgr for this instance
 HWMCommMgr GetCommMgr()
          This gets the comm mgr class
 IHWMDataModel GetDataModel()
          This gets the data model for this framework.
 java.lang.String GetDefaultPrjName(java.lang.String strTplName)
          Given the template file name - get the default prj name
 java.awt.Component GetEPICFrame()
          Returns the parent component.
 IHWMFrame GetFrame()
          Returns the IHWMFrame interface.
 IHWInteraction GetHWPMInteraction()
          This returns the HWPMInteraction for this framework.
abstract  java.lang.String GetInstanceName()
          Implemented in the app & dsgn specific classes.
 HWPMInteraction GetInteraction()
          Get the PM interaction
 IMenuToolBarCustomizer GetMenuToolBarCustomizer()
          the menu/toolbar customizer
 HWMPageMgrModel GetPageMgrModel()
          Get the page mgr model for this instance
 java.io.File GetPmdFile(java.io.File fileTpl)
          Get pmd file given the pmt file
static java.lang.String GetPrjVersion(java.io.File file)
          Get the project version.
 java.lang.String GetProjectDir()
          Returns the complete path of the prj directory
 java.lang.String GetProjectFileName()
          Returns the complete path of the prj file
 java.lang.String GetProjectName()
          Returns the project name.
 java.lang.String GetProjectVersion()
          Get the project version.
 java.lang.String GetTemplateDir()
          Returns the complete path of the template directory
static java.io.File GetTemplateFileBasedOn(java.io.File filePrj)
          Get the template file that this file is based on
 java.lang.String GetTemplateFileName()
          Returns the complete path of the template file
 java.lang.String GetTemplateName()
          Returns the template name.
 java.lang.Object GetTemplatePreferenceValue(java.lang.String strTemplatePrefKey)
          This method returns the template preference value associated with the template preference key specified.
 java.lang.String GetTemplateVersion()
          Get the template version.
 HWMTplProps GetTplProperties()
          Get the pmt props for the template to which this instance belomgs to
static java.lang.String GetTplVer(java.io.ObjectInputStream ois)
          Get the template version.
static java.lang.String GetTplVersion(java.io.File file)
          Get the template version.
 IHWMWorkflow GetWorkflow()
          Gets the workflow interface
 HWMWorkflowModel GetWorkflowModel()
          Get the workflow model for this instance
 void HandleSessionMessages(HWMClientComm hwmSession, boolean bStart)
          Request the framework to handle/stop handling the HWPM script messages received by the comm session.
 void HideView()
          This hides the application's view
 void Initialize()
          Initializes all the beans on all the pages.
abstract  void InitMenuBar(HWMMenuBarContainer barMenu)
          Customizes the menubar.
abstract  void InitToolBar(HWMToolBarContainer barTool)
          Adds a shortcut bar if required.
 void InvokeRun()
          Invoke "Run" on all the controls that implement "IHWMControl" interface This is invoked by OpenProject and OpenTemplate methods in app and designer mode respectively.
 boolean IsDesignMode()
          This is invoked by a bean when it needs to know if its being used in design mode or app mode.
 boolean IsHWPMMode()
          Returns true, if its in HWPM mode else false
 boolean IsProjectNew()
          Returns a flag indicating if the project is new
 void LogStatus(java.lang.String strMsg)
          This displays the given message in the status bar for the application
abstract  void OnCloseInstance()
          Close this instance
abstract  void OnSaveAsInstance(java.lang.String sSaveAsfilename)
          Saves the insatnce.
abstract  void OnSaveInstance()
          Saves the insatnce.
 void ReadBindingsFromTpl(java.io.File fileTpl)
          Reads the binding info from template This is used in the app mode to read bindings when the prj is of the old version
 void ReadPmdFile(java.io.File fileTpl, java.util.Properties propsParamVals)
          Read pmd file
 void ReadPrjVersion1_0(HWMObjectInputStream hwmStreamIn, boolean bForce)
          Reads the project file for version 1.0.
 void ReadPrjVersion6_0(org.jdom.Element elemRoot)
          Reads the project file for version 6.0.
 void ReadProject(java.io.File filePrj, boolean bForce)
          Reads the project file.
 void ReadTemplate(java.io.File fileTpl)
          Reads the pmt file.
static void ReadTemplatePreference(HWMTplProps hwmTplProps, java.io.File fileTpl)
          Reads the pmt preferences from the pmt file.
 void ReadTpl6_0(HWMObjectInputStream hwmStreamIn)
          Reads the template for version 6.0.
 void ReadTplPrjVersion2_0(HWMObjectInputStream hwmStreamIn, boolean bForce)
          Reads the template or project file for version 2.0.
 void ReadXMLProject(java.io.File filePrj)
          Reads the xml project file.
 void RemoveAllJavaScriptContexts()
          Removes all javascript context scopes
 void RemoveHWMEventListener(HWMEventListener hwmEventListener)
          Remove a bean as an HWMEventListener
 void removePropertyChangeListener(java.beans.PropertyChangeListener propListener)
          Remove a property change listener
 void RemoveToolkitEventListener(HWMToolkitEventListener listenerEvt)
          Removes a HWMToolkitEventListener
 void SaveAndCloseInstance(boolean bAskUser)
          Close this instance If bAskUser is true, then the user is asked if he/she wants to save the pmt/prj file.
 void SaveAndExit(boolean bAskUser)
          This is invoked by a bean when the application should exit.
 java.lang.String SendPmgrTclCommand(java.lang.String strTCLCmd)
          Invoke the required tcl command on PM tcl side
 java.lang.String SendPmgrTCLCommandWOException(java.lang.String strTCLCmd)
          Send pmgr tcl a command.
 void SendToBack()
          This sets the application's view to the back
 void SetAppTypeInTplPrefs(int nAppType)
          Set the type of application in the tpl preferences if it is not already present
 void SetInteraction(HWPMInteraction pmInteraction)
          Set the PM interaction
abstract  void SetMenuToolBarHandler(HWMMenuToolBarHandler handlerMenuTool)
          Sets a ref to the MenuToolBarHandler for customization.
 void SetProject(java.io.File filePrj)
          Sets the prj file name and the complete path name
 void SetTemplate(java.io.File fileTpl)
          Sets the template file name and the complete path name
 void SetTplProperties(HWMTplProps hwmTplProps)
          Set the pmt props for the template to which this instance belomgs to
 void ShowView()
          This shows the application's view
 void WritePmdFile(java.io.File fileTpl)
          Write pmd file
 void WriteTpl(java.io.File file)
          Saves the template file.
 void WriteXMLProject(java.io.File file)
          Saves the project file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPTYPE_TODO

public static final int APPTYPE_TODO
See Also:
Constant Field Values

APPTYPE_APP

public static final int APPTYPE_APP
See Also:
Constant Field Values

PROP_TPLDISPLAY_NAME

public static final java.lang.String PROP_TPLDISPLAY_NAME
See Also:
Constant Field Values

VERSION_TPL

public static final java.lang.String VERSION_TPL
See Also:
Constant Field Values

VERSION_PRJ

public static final java.lang.String VERSION_PRJ
See Also:
Constant Field Values

PROP_MODEL_TPLNAME

public static final java.lang.String PROP_MODEL_TPLNAME
These statics represent the properties fired by the model instance

See Also:
Constant Field Values

PROP_MODEL_PRJNAME

public static final java.lang.String PROP_MODEL_PRJNAME
See Also:
Constant Field Values
Constructor Detail

HWMModelInstance

public HWMModelInstance(java.awt.Component frameEPIC,
                        IHWMFrame iHWMFrame)
Constructor

Parameters:
frameEPIC - The main frame for EPIC
iHWMFrame - The frame interface allows to create/close/save etc. process instances with user exits.
Method Detail

IsHWPMMode

public boolean IsHWPMMode()
Returns true, if its in HWPM mode else false

Returns:
boolean true if PM mode else false

OnSaveInstance

public abstract void OnSaveInstance()
                             throws java.lang.Exception
Saves the insatnce. Save prj

Throws:
java.lang.Exception

OnSaveAsInstance

public abstract void OnSaveAsInstance(java.lang.String sSaveAsfilename)
                               throws java.lang.Exception
Saves the insatnce. Save prj

Throws:
java.lang.Exception

OnCloseInstance

public abstract void OnCloseInstance()
                              throws java.lang.Exception
Close this instance

Throws:
java.lang.Exception

SetInteraction

public void SetInteraction(HWPMInteraction pmInteraction)
Set the PM interaction

Parameters:
pmInteraction - The PM interaction class

GetInteraction

public HWPMInteraction GetInteraction()
Get the PM interaction

Returns:
HWPMInteraction The PM interaction class

GetHWPMInteraction

public IHWInteraction GetHWPMInteraction()
This returns the HWPMInteraction for this framework.

Specified by:
GetHWPMInteraction in interface IHWMFrameWork
Returns:
IHWInteraction The HWPMInteraction instance

SendPmgrTclCommand

public java.lang.String SendPmgrTclCommand(java.lang.String strTCLCmd)
                                    throws java.lang.Exception
Invoke the required tcl command on PM tcl side

Parameters:
strTCLCmd - The command to be executed
bEncloseInCatch - If true, enclose the command in a catch statement
Returns:
String The return value
Throws:
java.lang.Exception

ClearAll

public void ClearAll()
Clears al the models


RemoveAllJavaScriptContexts

public void RemoveAllJavaScriptContexts()
Removes all javascript context scopes


SetTemplate

public void SetTemplate(java.io.File fileTpl)
Sets the template file name and the complete path name

Parameters:
fileTpl - The template file object

SetProject

public void SetProject(java.io.File filePrj)
Sets the prj file name and the complete path name

Parameters:
fileTpl - The prj file object

GetTemplateName

public java.lang.String GetTemplateName()
Returns the template name. Does not return the path info

Parameters:
String - The template name

GetTemplateDir

public java.lang.String GetTemplateDir()
Returns the complete path of the template directory

Specified by:
GetTemplateDir in interface IHWMFrameWork
Parameters:
String - The complete path of the template directory
Returns:
String The template directory name

GetTemplateFileName

public java.lang.String GetTemplateFileName()
Returns the complete path of the template file

Specified by:
GetTemplateFileName in interface IHWMFrameWork
Parameters:
String - The complete path of the template file
Returns:
String The template file name

GetProjectName

public java.lang.String GetProjectName()
Returns the project name. Does not return the path info

Parameters:
String - The project name

GetProjectDir

public java.lang.String GetProjectDir()
Returns the complete path of the prj directory

Specified by:
GetProjectDir in interface IHWMFrameWork
Parameters:
String - The complete path of the prj directory
Returns:
String The project directory name

GetProjectFileName

public java.lang.String GetProjectFileName()
Returns the complete path of the prj file

Specified by:
GetProjectFileName in interface IHWMFrameWork
Parameters:
String - The complete path of the prj file
Returns:
String The project file name

GetDefaultPrjName

public java.lang.String GetDefaultPrjName(java.lang.String strTplName)
Given the template file name - get the default prj name

Parameters:
strTplName - The template name

GetInstanceName

public abstract java.lang.String GetInstanceName()
Implemented in the app & dsgn specific classes. Will return the complete path of the prj file in app mode and the complete path of the pmt file in dsgn mode

Parameters:
String - The complete path of the prj/pmt file

SetTplProperties

public void SetTplProperties(HWMTplProps hwmTplProps)
Set the pmt props for the template to which this instance belomgs to

Parameters:
hwmTplProps - The template properties for this instance

GetTplProperties

public HWMTplProps GetTplProperties()
Get the pmt props for the template to which this instance belomgs to

Returns:
HWMTplProps The template properties for this instance

GetWorkflowModel

public HWMWorkflowModel GetWorkflowModel()
Get the workflow model for this instance

Returns:
HWMWorkflowModel The workflow model for this instance

GetPageMgrModel

public HWMPageMgrModel GetPageMgrModel()
Get the page mgr model for this instance

Returns:
HWMPageMgrModel The page mgr model for this instance

GetBindingInfoMgr

public HWMBindingInfoMgr GetBindingInfoMgr()
Get the binding info mgr for this instance

Returns:
HWMBindingInfoMgr The binding info mgr for this instance

InitMenuBar

public abstract void InitMenuBar(HWMMenuBarContainer barMenu)
Customizes the menubar.

Parameters:
barMenu -

InitToolBar

public abstract void InitToolBar(HWMToolBarContainer barTool)
Adds a shortcut bar if required.

Parameters:
barTool - The toolbar container to customize

SetMenuToolBarHandler

public abstract void SetMenuToolBarHandler(HWMMenuToolBarHandler handlerMenuTool)
Sets a ref to the MenuToolBarHandler for customization.

Parameters:
handlerMenuTool -

Initialize

public void Initialize()
                throws java.lang.Exception
Initializes all the beans on all the pages. This will set the framework if the bean is of type IHWMControl and will call Start on applets. It will also initialize the workflow model

Throws:
java.lang.Exception

SetAppTypeInTplPrefs

public void SetAppTypeInTplPrefs(int nAppType)
Set the type of application in the tpl preferences if it is not already present

Parameters:
nAppType - should be one of the HWMModelInstance.APPTYPE_XXX

GetAppTypeFromTplPrefs

public int GetAppTypeFromTplPrefs()
Get the type of application

Returns:
int Will be one of the HWMModelInstance.APPTYPE_XXX

InvokeRun

public void InvokeRun()
Invoke "Run" on all the controls that implement "IHWMControl" interface This is invoked by OpenProject and OpenTemplate methods in app and designer mode respectively. This is called only when the complete prj/pmt is loaded.


ExportPageTCL

public void ExportPageTCL(java.lang.String strFilename)
                   throws java.lang.Exception
Export the current page onto the given filename as a TCL task.

Parameters:
strFilename - The file to export the current page
Throws:
java.lang.Exception

GetTemplateFileBasedOn

public static java.io.File GetTemplateFileBasedOn(java.io.File filePrj)
                                           throws java.lang.Exception
Get the template file that this file is based on

Parameters:
filePrj - The file whose template should be recovered
Returns:
File The template file that this file is based on
Throws:
java.lang.Exception - if any error occurs

GetAppTypeFromFile

public static int GetAppTypeFromFile(java.io.File file)
                              throws java.lang.Exception
Get the app type for the template

Parameters:
file - The file whose app type should be recovered
Returns:
int One of the HWMModelInstance.APPTYPE_XXX constants
Throws:
java.lang.Exception - if any error occurs

GetTemplateVersion

public java.lang.String GetTemplateVersion()
                                    throws java.lang.Exception
Get the template version.

Returns:
String The template version
Throws:
java.lang.Exception - - If any error occurs

GetProjectVersion

public java.lang.String GetProjectVersion()
                                   throws java.lang.Exception
Get the project version.

Returns:
String The project version
Throws:
java.lang.Exception - - If any error occurs

GetTplVersion

public static java.lang.String GetTplVersion(java.io.File file)
                                      throws java.lang.Exception
Get the template version.

Parameters:
file - The template file
Returns:
String The version
Throws:
java.lang.Exception - - If any error occurs

GetPrjVersion

public static java.lang.String GetPrjVersion(java.io.File file)
                                      throws java.lang.Exception
Get the project version.

Parameters:
file - The project file
Returns:
String The version
Throws:
java.lang.Exception - - If any error occurs

GetTplVer

public static java.lang.String GetTplVer(java.io.ObjectInputStream ois)
                                  throws java.lang.Exception
Get the template version.

Parameters:
ois - The input stream for the template
Returns:
String The template version
Throws:
java.lang.Exception - - If any error occurs

ReadPrjVersion1_0

public void ReadPrjVersion1_0(HWMObjectInputStream hwmStreamIn,
                              boolean bForce)
                       throws java.io.FileNotFoundException,
                              java.lang.Exception
Reads the project file for version 1.0. The project file has all the information regarding the properties of the individual beans.The frame will read the version and the template name and then asks the pg mgr to read from there on

Parameters:
hwmStreamIn - -- The input stream to read from
bForce - If true, the prj is opened using the def pmt even if the pmt file name in prj does not match with the def pmt name
Throws:
java.io.FileNotFoundException - - Thrown when the pmt file cannot be found. Occurs in App mode only Exception - when any other error occurs
java.lang.Exception

ReadTplPrjVersion2_0

public void ReadTplPrjVersion2_0(HWMObjectInputStream hwmStreamIn,
                                 boolean bForce)
                          throws java.io.FileNotFoundException,
                                 java.lang.Exception
Reads the template or project file for version 2.0. The pmt/prj file has all the information regarding the properties of the individual beans. This will read the template name, pmt prefs, menu/toolbar prefs and then asks the pg mgr to read from there on. In version 2.0, the db data model is not present but the datamodel is saved.

Parameters:
hwmStreamIn - -- The input stream to read from
bForce - If true, the prj is opened using the def pmt even if the pmt file name in prj does not match with the def pmt name
Throws:
java.io.FileNotFoundException - - Thrown when the pmt file cannot be found. Occurs in App mode only Exception - when any other error occurs
java.lang.Exception

ReadTpl6_0

public void ReadTpl6_0(HWMObjectInputStream hwmStreamIn)
                throws java.lang.Exception
Reads the template for version 6.0. The pmt file has all the information regarding the properties of the individual beans. This will read the template name, pmt prefs, menu/toolbar prefs and then asks the pg mgr to read from there on. In version 6.0, the db data model is not present but the datamodel is saved in XML format

Parameters:
hwmStreamIn - -- The input stream to read from
Throws:
java.lang.Exception - - when any other error occurs

ReadPrjVersion6_0

public void ReadPrjVersion6_0(org.jdom.Element elemRoot)
                       throws java.lang.Exception
Reads the project file for version 6.0. This is is XML format The prj file will just read the workflow model and data model

Parameters:
elemRoot - -- The root element
Throws:
java.lang.Exception - -- when any error occurs

ReadProject

public void ReadProject(java.io.File filePrj,
                        boolean bForce)
                 throws java.io.FileNotFoundException,
                        java.lang.Exception
Reads the project file. The project file has all the information regarding the properties of the individual beans.The frame will read the version's data and then asks the pg mgr to read from there on

Parameters:
filePrj - -- The project file to read
bForce - If true, the prj is opened using the def pmt even if the pmt file name in prj does not match with the def pmt name
Throws:
java.io.FileNotFoundException - - Thrown when the pmt file cannot be found. Occurs in App mode only Exception - when any other error occurs
java.lang.Exception

ReadXMLProject

public void ReadXMLProject(java.io.File filePrj)
                    throws java.io.FileNotFoundException,
                           java.lang.Exception
Reads the xml project file. The project file has all the information regarding the properties of the individual beans. If its not xml file - or invalid file - It will throw an exception

Parameters:
filePrj - -- The project file to read
Throws:
java.io.FileNotFoundException - - Thrown when the pmt file cannot be found. Occurs in App mode only
DataFormatException - - Thrown when the prj file is not xml
java.lang.Exception - - when any other error occurs

ReadTemplate

public void ReadTemplate(java.io.File fileTpl)
                  throws java.io.FileNotFoundException,
                         java.lang.Exception
Reads the pmt file. The pmt file has all the information about binding

Parameters:
fileTpl - -- The pmt file to read
Throws:
java.io.FileNotFoundException - - Thrown when the pmt file cannot be found. Occurs in App mode only Exception - when any other error occurs
java.lang.Exception

ReadBindingsFromTpl

public void ReadBindingsFromTpl(java.io.File fileTpl)
                         throws java.io.FileNotFoundException,
                                java.lang.Exception
Reads the binding info from template This is used in the app mode to read bindings when the prj is of the old version

Parameters:
fileTpl - -- The pmt file to read
Throws:
java.io.FileNotFoundException - - Thrown when the pmt file cannot be found. Occurs in App mode only Exception - when any other error occurs
java.lang.Exception

ReadTemplatePreference

public static void ReadTemplatePreference(HWMTplProps hwmTplProps,
                                          java.io.File fileTpl)
                                   throws java.lang.Exception
Reads the pmt preferences from the pmt file. The pmt file has all the information about binding/pmt prefs and menu/toolbar prefs This is used in the app mode to read the template prefs at the start so that the splash screen may be shown

Parameters:
hwmTplProps - The template properties whose preferences should be read
fileTpl - -- The pmt file to read
Throws:
java.lang.Exception - - when any error occurs

WriteXMLProject

public void WriteXMLProject(java.io.File file)
                     throws java.lang.Exception
Saves the project file.

Parameters:
file - The file to save
Throws:
java.lang.Exception

WriteTpl

public void WriteTpl(java.io.File file)
              throws java.lang.Exception
Saves the template file.

Parameters:
file - The file to save
Throws:
java.lang.Exception

GetPmdFile

public java.io.File GetPmdFile(java.io.File fileTpl)
                        throws java.lang.Exception
Get pmd file given the pmt file

Returns:
File The pmd file
Throws:
java.lang.Exception

ApplyTemplateProperties

public java.lang.String ApplyTemplateProperties(java.util.Properties propsParamVals)
Apply the properties read. But make sure that the user name for the template is stripped off. This user friendly name is then returned

Parameters:
propsParamVals - The properties read from the pmd file
Returns:
String The user friendly name which is also read from the pmd file

ReadPmdFile

public void ReadPmdFile(java.io.File fileTpl,
                        java.util.Properties propsParamVals)
                 throws java.lang.Exception
Read pmd file

Parameters:
fileTpl - The tpl file being read
propsParamVals - the properties for the template
Throws:
java.lang.Exception

WritePmdFile

public void WritePmdFile(java.io.File fileTpl)
                  throws java.lang.Exception
Write pmd file

Throws:
java.lang.Exception

AddToolkitEventListener

public void AddToolkitEventListener(HWMToolkitEventListener listenerEvent)
Adds a HWMToolkitEventListener

Parameters:
listenerEvent - The listener to add

RemoveToolkitEventListener

public void RemoveToolkitEventListener(HWMToolkitEventListener listenerEvt)
Removes a HWMToolkitEventListener

Parameters:
listenerEvent - The listener to remove

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener propListener)
Add a property change listener

Parameters:
propListener - The property change listener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener propListener)
Remove a property change listener

Parameters:
propListener - The property change listener to be removed

LogStatus

public void LogStatus(java.lang.String strMsg)
This displays the given message in the status bar for the application

Specified by:
LogStatus in interface IHWMFrameWork
Parameters:
strMsg - The message to show

IsDesignMode

public boolean IsDesignMode()
This is invoked by a bean when it needs to know if its being used in design mode or app mode. Implemented by derived classes

Specified by:
IsDesignMode in interface IHWMFrameWork
Returns:
boolean If design mode, then true else false

HideView

public void HideView()
This hides the application's view

Specified by:
HideView in interface IHWMFrameWork

ShowView

public void ShowView()
This shows the application's view

Specified by:
ShowView in interface IHWMFrameWork

BringToFront

public void BringToFront()
This gets the application's view to the front

Specified by:
BringToFront in interface IHWMFrameWork

SendToBack

public void SendToBack()
This sets the application's view to the back

Specified by:
SendToBack in interface IHWMFrameWork

GetCommMgr

public HWMCommMgr GetCommMgr()
This gets the comm mgr class

Specified by:
GetCommMgr in interface IHWMFrameWork
Returns:
HWMCommMgr The communication manager for the instance

GetDataModel

public IHWMDataModel GetDataModel()
This gets the data model for this framework.

Specified by:
GetDataModel in interface IHWMFrameWork
Returns:
IHWMDataModel The data model for the instance

AppendToTitle

public void AppendToTitle(java.lang.String strTitleSuffix)
Append to the title of the application

Specified by:
AppendToTitle in interface IHWMFrameWork
Parameters:
strTitleSuffix - The suffix to append to the title

SendPmgrTCLCommandWOException

public java.lang.String SendPmgrTCLCommandWOException(java.lang.String strTCLCmd)
Send pmgr tcl a command. This is used to disable/enable the GUI. This method will not throw any exceptions

Parameters:
strTCLCmd - The TCL command to send to pmgr

CloseInstance

public void CloseInstance()
Close this instance

Specified by:
CloseInstance in interface IHWMFrameWork

SaveAndCloseInstance

public void SaveAndCloseInstance(boolean bAskUser)
Close this instance If bAskUser is true, then the user is asked if he/she wants to save the pmt/prj file.

Specified by:
SaveAndCloseInstance in interface IHWMFrameWork

Exit

public void Exit()
This is invoked by a bean when the application should exit. The template/prj is not saved

Specified by:
Exit in interface IHWMFrameWork

SaveAndExit

public void SaveAndExit(boolean bAskUser)
This is invoked by a bean when the application should exit. If bAskUser is true, then the user is asked if he/she wants to save the pmt/prj file. If bAskUser is false, then the template/prj is saved without prompting the user

Specified by:
SaveAndExit in interface IHWMFrameWork

GetMenuToolBarCustomizer

public IMenuToolBarCustomizer GetMenuToolBarCustomizer()
the menu/toolbar customizer

Specified by:
GetMenuToolBarCustomizer in interface IHWMFrameWork
Returns:
IMenuToolBarCustomizer

GetWorkflow

public IHWMWorkflow GetWorkflow()
Gets the workflow interface

Specified by:
GetWorkflow in interface IHWMFrameWork
Returns:
IHWMWorkflow The workflow interface. It may be null

GetEPICFrame

public java.awt.Component GetEPICFrame()
Returns the parent component. Use this as the parent for displaying any dialogs so that it will acquire the icon from this component.

Specified by:
GetEPICFrame in interface IHWMFrameWork
Returns:
Component The parent component. This can be any of the top level containers like frame, window etc. It can be null, if view has not been created at all.

GetFrame

public IHWMFrame GetFrame()
Returns the IHWMFrame interface.

Specified by:
GetFrame in interface IHWMFrameWork
Returns:
IHWMFrame The IHWMFrame interface which allows closing/opening/ creation of instances, changing defailt template and exiting application.

ExecuteJavaScript

public java.lang.Object ExecuteJavaScript(java.lang.Object objScope,
                                          java.lang.String strScript)
                                   throws java.lang.Exception
Execute a JavaScript ("this" modelinstance will be the scope) and return the result

Specified by:
ExecuteJavaScript in interface IHWMFrameWork
Parameters:
strScript - The Java script to execute
Returns:
The result of executing the script
Throws:
java.lang.Exception

AddHWMEventListener

public void AddHWMEventListener(HWMEventListener hwmEventListener)
Add a bean as an HWMEventListener

Specified by:
AddHWMEventListener in interface IHWMFrameWork
Parameters:
hwmEventListener - The listener object

RemoveHWMEventListener

public void RemoveHWMEventListener(HWMEventListener hwmEventListener)
Remove a bean as an HWMEventListener

Specified by:
RemoveHWMEventListener in interface IHWMFrameWork
Parameters:
hwmEventListener - The listener object

GetBeans

public java.util.Vector GetBeans(java.lang.String strBeanInstanceName)
Get the bean instance by the given name

Parameters:
strBeanInstanceName - The (unique) bean instance name
Returns:
Object The bean

GetTemplatePreferenceValue

public java.lang.Object GetTemplatePreferenceValue(java.lang.String strTemplatePrefKey)
                                            throws java.lang.Exception
This method returns the template preference value associated with the template preference key specified.

Specified by:
GetTemplatePreferenceValue in interface IHWMFrameWork
Parameters:
strTemplatePrefKey - The template preference key.
Returns:
The template preference value or null if none found. NOTE: The different templete preference keys are defined as constants in HWMTplPreferences.
Throws:
java.lang.Exception

HandleSessionMessages

public void HandleSessionMessages(HWMClientComm hwmSession,
                                  boolean bStart)
Request the framework to handle/stop handling the HWPM script messages received by the comm session. Do nothing in the base class. The derived classes will override this if required.

Specified by:
HandleSessionMessages in interface IHWMFrameWork
Parameters:
hwmSession - The session for which the framework should start or stop handling the incoming messages
bStart - If true, it starts handling else stops handling

IsProjectNew

public boolean IsProjectNew()
Returns a flag indicating if the project is new

Returns: