|
|
||||
| Package com.dassault_systemes.catjdialog |
Class CATUserDialog
|
| Class Hierarchy |
java.lang.Object
|
+-com.dassault_systemes.catjdialog.CATCallbackSource
|
+-com.dassault_systemes.catjdialog.CATDialog
|
+-com.dassault_systemes.catjdialog.CATUserDialog
| Class Location |
| Class Description |
public class CATUserDialog
The base user dialog graphical component class.
<Constructor>(CATDialog iParent, String iName)resources/widget directory of the runtime view.
Sample: turning the MyEditor command (MyEditor.XMLDlg file + MyEditor.java controller class) into a user dialog
1- Have the controller extend CATUserDialog
[...]
public class MyEditor extends CATUserDialog
{
// --- this is the CATDialog constructor
public MyEditor(CATDialog iParent, String iName)
{
// --- call the CATUserDialog constructor with command filename (MyEditor.XMLDlg)
super(iParent, iName, "MyEditor");
[...]
}
[...]
}
2- Deliver the resources/widget/MyEditor.XMLWidget file:
<?xml version="1.0"?>
<Widget
Description="My editor component"
Class="com.mypackage.MyEditor"
Icon="TimeEditor_Icon.gif"
Preview="TimeEditor_Preview.gif" />
(Icon and Preview attributes are used by the the CAA UI Builder)
Caution with UserDialog usage:
In a UserDialog, public CATDialog class members initialization is forbidden.
Ex:
public class MyEditor public class CATUserDialog
{
public CATTable _mytable;
public CATTextField _myfield = null; <-- NO
[...]
Due to a (very) complex calling stack when constructing a user dialog,
this would overwrite the field with a null value.
Sample: reusing MyEditor as a standard JDialog component in an XMLDlg file
<?xml version="1.0"?>
<Frame Name="Test" onCreate="onCreate" [...] >
<TextField Name="Field" Attribute="_field" Text="please enter text" [...] />
<MyEditor Name="Editor" MyValue="hello world" onMyEvent="onMyEditorEvent"/>
[...]
All Implemented Interfaces: CATIContainerDialog CATICmdButtons CATIToolbarHolder
| Field Summary |
| Constructor Summary |
| CATUserDialog(CATDialog iParent, String iName, String iXMLDlgFile) |
| CATUserDialog() |
| Method Summary |
| boolean | isUserDialog() |
| CATDialog | getFirstChild() |
| Field Detail |
| Constructor Detail |
CATUserDialog(CATDialog iParent, String iName, String iXMLDlgFile)
Creates a user dialog object and instantiates the command from the specified XMLDlg filename.
iParentiNameiXMLDlgFile
CATUserDialog()
Default constructor to be able to use as a standard controller.
| Method Detail |
boolean isUserDialog()
Returns whether this is used as UserDialog (behaves as a Dialog), or as a simple controller
true if it is a UserDialog, false if it is a simple controller.
CATDialog getFirstChild()
Returns the first child component.
This method has only a meaning if this is really used as a UserDialog.