|
|
Package com.dassault_systemes.catjdialog |
Class CATDocumentManager
|
Class Hierarchy |
java.lang.Object | +-com.dassault_systemes.catjdialog.CATCallbackSource | +-com.dassault_systemes.catjdialog.CATDialog | +-com.dassault_systemes.catjdialog.CATDocumentManager
Class Location |
Class Description |
public class CATDocumentManager
The document manager graphical component.
From an application, it is possible to:
[...] CATDialog aComponent... boolean activate... boolean stack... boolean unstack... // --- retrieve the document manager CATDocumentManager docMgr = CATDocumentManager.getDocumentManager(aComponent); if(activate) { // --- activate 'MyCommand' with document '/the/brown/fox/jumps' docMgr.activate("MyCommand", "/the/brown/fox/jumps"); } else if(stack) { // --- stack 'MyModalCommand' with no document docMgr.stack("MyModalCommand", null); } else if(unstack) { // --- unstack the current command (most probably me!) docMgr.unstack(); }
Example:
Here is an example of a command controller that retreives its document on creation, and registers to 'document changed' notifications from the document manager:
[...] public class MyCommandControler { // --- the callback method associated to the 'Create' notification from the topmost command component public void onCreate(CATDialog iDialog, CATNotification iNotification, Object iData) { // --- retreive my document String mydocument = CATDocumentManager.getDocument(iDialog); if(mydocument != null && mydocument.equals("/the/brown/fox/jumps")) { [...] } // --- register to document change CATDocumentManager.registerToDocumentChanged(iDialog, this, "onDocumentChanged", null); } // --- the callback method associated to the 'document changed' notification from the document manager public void onDocumentChanged(CATDialog iDialog, CATNotification iNotification, Object iData) { // --- retreive my document String mydocument = CATDocumentManager.getDocument(iDialog); [...] } [...] }
All Implemented Interfaces: Serializable
Field Summary |
Constructor Summary |
CATDocumentManager(CATDialog iParent, String iName, CATSession iSession, boolean iAutoKill) |
CATDocumentManager(CATDialog iParent, String iName, CATSession iSession) |
CATDocumentManager(CATDialog iParent, String iName) |
Method Summary |
CATDocumentManager | getDocumentManager(CATDialog iDialog) |
CATDialog | getCommand(CATDialog iDialog) |
String | getCommandName(CATDialog iDialog) |
String | getDocument(CATDialog iDialog) |
void | registerToDocumentChanged(CATDialog iDialog, Object iListener, String iMethod, Object iData) |
boolean | allowsViews(CATDialog iFrom) |
CATDialog | activate(String iCommand, String iDocument) |
CATDialog | stack(String iCommand, String iDocument) |
CATDialog | stackReplace(String iCommand, String iDocument) |
CATDialog | stack(Class iClass, String iDocument) |
void | unstack() |
CATDialog | getActiveCommand() |
CATDialog | getCommand() |
String | getCommandDocument(CATDialog iCommandChild) |
CATDialog | getCommandRoot(CATDialog iCommandChild) |
CATNotification | getActiveCommandChangedNotification() |
void | MessageBox(String iTitle, String iDetails, int iSeverity) |
void | errorBox(CATError iError, String iApplication, int iSeverity) |
boolean | isDisplayed() |
boolean | isChildDisplayed(CATDialog iChild) |
boolean | displayChild(CATDialog iChild) |
Reader | getResource(String iPath) |
CATSession | getSession() |
Field Detail |
Constructor Detail |
CATDocumentManager(CATDialog iParent, String iName, CATSession iSession, boolean iAutoKill)Creates a document manager.
This may be used by client applications only when overloading this class.
iParent
iName
iSession
iAutoKill
CATDocumentManager(CATDialog iParent, String iName, CATSession iSession)Creates a non-autokillable document manager.
This may be used by client applications only when overloading this class.
iParent
iName
iSession
CATDocumentManager(CATDialog iParent, String iName)Creates a non-autokill document manager.
This may be used by client applications only when overloading this class.
iParent
iName
Method Detail |
CATDocumentManager getDocumentManager(CATDialog iDialog)Helper method that returns the document manager for a component (it navigates in component hierarchy to find the DocumentManager).
iDialog
CATDialog getCommand(CATDialog iDialog)Helper method that returns the command component that contains the child iDialog.
iDialog
String getCommandName(CATDialog iDialog)Helper method that returns the command name (name of the XMLDlg file) of the given command component
iDialog
String getDocument(CATDialog iDialog)Helper method that returns the document of the command that contains the child iDialog.
iDialog
void registerToDocumentChanged(CATDialog iDialog, Object iListener, String iMethod, Object iData)Helper method that registers to 'DocumentChanged' notification on the command that contains the child iDialog.
iDialog
iListener
iMethod
iData
boolean allowsViews(CATDialog iFrom)Helper method that determines whether the underlying document manager is able to handle multiple activate containers.
When activating a command in such a document manager, the command does not destroy current ones but is displayed into a new self container
iFrom
true
if a document managing multiple activate containers was found; false
otherwise.CATDialog activate(String iCommand, String iDocument)This method controls commands life cycle.
It first cleans up the stack, then instantiates and adds a new command (from its XMLDlg file) to the document manager stack:
iCommand
iDocument
CATDialog stack(String iCommand, String iDocument)This method controls commands life cycle.
It instantiates and adds a new command (from its XMLDlg file) to the document manager stack:
iCommand
iDocument
CATDialog stackReplace(String iCommand, String iDocument)This method controls commands life cycle.
It replaces the last command in the stack with a new one:
iCommand
iDocument
CATDialog stack(Class iClass, String iDocument)This method controls commands life cycle.
It instantiates and adds a new CATUserDialog command to the document manager stack:
iClass
iDocument
void unstack()This method controls commands life cycle.
It removes the last command from the document manager stack:
CATDialog getActiveCommand()Returns the top component of the current active command.
CATDialog getCommand()Returns the top component of the current active command.
String getCommandDocument(CATDialog iCommandChild)Returns the document associated to the command whose specified component is a child.
iCommandChild
CATDialog getCommandRoot(CATDialog iCommandChild)Returns the top component of the command whose specified component is a child.
iCommandChild
CATNotification getActiveCommandChangedNotification()The active command changed notification.
This notification is sent by the document manager each time the active command changes.
void MessageBox(String iTitle, String iDetails, int iSeverity)Displays the specified message in an appropriate dialog.
iTitle
iDetails
iSeverity
void errorBox(CATError iError, String iApplication, int iSeverity)Displays the specified error in an appropriate dialog.
iError
iApplication
iSeverity
boolean isDisplayed()Determines whether this component is displayed on screen or not.
true
if this component is displayed on screen; false
otherwise.boolean isChildDisplayed(CATDialog iChild)Determines whether the child component is displayed by this component.
iChild
true
if the specified child component is displayed by this component; false
otherwise.boolean displayChild(CATDialog iChild)Tries to display the given child component.
iChild
Reader getResource(String iPath)Gets a resource as a stream.
iPath
CATSession getSession()Returns the user session object.