|
|
|||||
| 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)
Creates a document manager. |
| CATDocumentManager(CATDialog iParent, String iName, CATSession iSession)
Creates a non-autokillable document manager. |
| CATDocumentManager(CATDialog iParent, String iName)
Creates a non-autokill document manager. |
| Method Summary |
| public CATDialog | activate(String iCommand, String iDocument)
This method controls commands life cycle. |
| public static boolean | allowsViews(CATDialog iFrom)
Helper method that determines whether the underlying document manager is able to handle multiple activate containers. |
| protected boolean | displayChild(CATDialog iChild)
Tries to display the given child component. |
| public void | errorBox(CATError iError, String iApplication, int iSeverity)
Displays the specified error in an appropriate dialog. |
| public synchronized CATDialog | getActiveCommand()
Returns the top component of the current active command. |
| public CATNotification | getActiveCommandChangedNotification()
The active command changed notification. |
| public CATDialog | getCommand()
Returns the top component of the current active command. |
| public static CATDialog | getCommand(CATDialog iDialog)
Helper method that returns the command component that contains the child iDialog. |
| protected String | getCommandDocument(CATDialog iCommandChild)
Returns the document associated to the command whose specified component is a child. |
| public static String | getCommandName(CATDialog iDialog)
Helper method that returns the command name (name of the XMLDlg file) of the given command component |
| protected CATDialog | getCommandRoot(CATDialog iCommandChild)
Returns the top component of the command whose specified component is a child. |
| public static String | getDocument(CATDialog iDialog)
Helper method that returns the document of the command that contains the child iDialog. |
| public static CATDocumentManager | getDocumentManager(CATDialog iDialog)
Helper method that returns the document manager for a component (it navigates in component hierarchy to find the DocumentManager). |
| public Reader | getResource(String iPath)
Gets a resource as a stream. |
| public CATSession | getSession()
Returns the user session object. |
| protected boolean | isChildDisplayed(CATDialog iChild)
Determines whether the child component is displayed by this component. |
| public boolean | isDisplayed()
Determines whether this component is displayed on screen or not. |
| public void | MessageBox(String iTitle, String iDetails, int iSeverity)
Displays the specified message in an appropriate dialog. |
| public static 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. |
| public CATDialog | stack(Class iClass, String iDocument)
This method controls commands life cycle. |
| public CATDialog | stack(String iCommand, String iDocument)
This method controls commands life cycle. |
| public CATDialog | stackReplace(String iCommand, String iDocument)
This method controls commands life cycle. |
| public void | unstack()
This method controls commands life cycle. |
| 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.
iParentiNameiSessioniAutoKill
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.
iParentiNameiSession
CATDocumentManager(CATDialog iParent, String iName)
Creates a non-autokill document manager.
This may be used by client applications only when overloading this class.
iParentiName| Method Detail |
public 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:
iCommandiDocument
public static 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
iFromtrue if a document managing multiple activate containers was found; false otherwise.
protected boolean displayChild(CATDialog iChild)
Tries to display the given child component.
iChild
public void errorBox(CATError iError, String iApplication, int iSeverity)
Displays the specified error in an appropriate dialog.
iErroriApplicationiSeverity
public synchronized CATDialog getActiveCommand()
Returns the top component of the current active command.
public CATNotification getActiveCommandChangedNotification()
The active command changed notification.
This notification is sent by the document manager each time the active command changes.
public CATDialog getCommand()
Returns the top component of the current active command.
public static CATDialog getCommand(CATDialog iDialog)
Helper method that returns the command component that contains the child iDialog.
iDialog
protected String getCommandDocument(CATDialog iCommandChild)
Returns the document associated to the command whose specified component is a child.
iCommandChild
public static String getCommandName(CATDialog iDialog)
Helper method that returns the command name (name of the XMLDlg file) of the given command component
iDialog
protected CATDialog getCommandRoot(CATDialog iCommandChild)
Returns the top component of the command whose specified component is a child.
iCommandChild
public static String getDocument(CATDialog iDialog)
Helper method that returns the document of the command that contains the child iDialog.
iDialog
public static CATDocumentManager getDocumentManager(CATDialog iDialog)
Helper method that returns the document manager for a component (it navigates in component hierarchy to find the DocumentManager).
iDialog
public Reader getResource(String iPath)
Gets a resource as a stream.
iPath
public CATSession getSession()
Returns the user session object.
protected boolean isChildDisplayed(CATDialog iChild)
Determines whether the child component is displayed by this component.
iChildtrue if the specified child component is displayed by this component; false otherwise.
public boolean isDisplayed()
Determines whether this component is displayed on screen or not.
true if this component is displayed on screen; false otherwise.
public void MessageBox(String iTitle, String iDetails, int iSeverity)
Displays the specified message in an appropriate dialog.
iTitleiDetailsiSeverity
public static 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.
iDialogiListeneriMethodiData
public 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:
iClassiDocument
public 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:
iCommandiDocument
public CATDialog stackReplace(String iCommand, String iDocument)
This method controls commands life cycle.
It replaces the last command in the stack with a new one:
iCommandiDocument
public void unstack()
This method controls commands life cycle.
It removes the last command from the document manager stack: