|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.rt.form.PvHelperDialog
The PvHelperDialog class provides methods to display dialog boxes. SilverStream automatically creates an instance of PvHelperDialog on every form called agDialog.
Field Summary | |
static int |
FORM_FRAME
|
static int |
FORM_MODAL
|
static int |
FORM_MODELESS
|
Constructor Summary | |
PvHelperDialog()
|
Method Summary | |
void |
displayError(String caption,
Throwable e)
Displays an exception in a dialog box. |
void |
displayError(Throwable e)
Displays an exception in a dialog box. |
AgfForm |
getForm(String formspec)
Creates and returns a pre-defined form. |
AgfForm |
getForm(String formspec,
Hashtable params)
Creates and returns a pre-defined form. |
AgfForm |
getForm(String formspec,
String query,
String orderby,
Hashtable params)
Creates and returns a pre-defined form. |
Object |
showForm(String caption,
AgfForm form,
int type,
boolean resizable,
int x,
int y)
Shows a form in a window. |
Object |
showForm(String caption,
String formspec,
String query,
String orderby,
Hashtable params,
int type,
boolean resizable,
int x,
int y)
Shows a form in a window. |
Object |
showFormDialog(String caption,
AgfForm dialog)
Displays a form in a modal dialog box. |
Object |
showFormDialog(String caption,
String formspec)
Displays a form in a modal dialog box. |
Object |
showFormDialog(String caption,
String formspec,
Hashtable params)
Displays a form in a modal dialog box. |
Object |
showFormDialog(String caption,
String formspec,
String query,
String orderby,
Hashtable params)
Displays a form in a modal dialog box. |
void |
showMessage(String message)
Show a message Displays a dialog box with a message and an OK button. |
void |
showMessage(String caption,
String message)
Displays a dialog box with a message and an OK button. |
boolean |
showMessageOKCancel(String caption,
String message)
Displays a dialog with an OK button and a Cancel button. |
String |
showMessageYesAllNoCancel(String caption,
String message)
Show an alert with a Yes button (the default button), a No button, a Yes to All button and a Cancel button. |
boolean |
showMessageYesNo(String caption,
String message)
Displays a dialog with a Yes button and a No button. |
Boolean |
showMessageYesNoCancel(String caption,
String message)
Displays a dialog with a Yes button, a No button, and a Cancel button. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int FORM_MODAL
public static final int FORM_MODELESS
public static final int FORM_FRAME
Constructor Detail |
public PvHelperDialog()
Method Detail |
public void showMessage(String message)
message
- the message to displayThe dialog displays 'Note' as its title.
agDialog.showMessage("This is the Message");
public void showMessage(String caption, String message)
caption
- the title of the dialog boxmessage
- the message to displayIf null is passed for the caption text, the dialog displays 'Note' as its title.
agDialog.showMessage("Caption","This is the Message");
public boolean showMessageOKCancel(String caption, String message)
caption
- the title of the dialog boxmessage
- the message to displayboolean response; response = agDialog.showMessageOKCancel("Title", "This is the message, OK?");
public boolean showMessageYesNo(String caption, String message)
caption
- the title of the dialog boxmessage
- the message to displayboolean response; response = agDialog.showMessageYesNo("Title","Can you read this message?");
public Boolean showMessageYesNoCancel(String caption, String message)
caption
- the title of the dialog box.message
- the message to display.Boolean result; result=AgDialog.showMessageYesNoCancel("Title", "Save changes to this record?"); if (result == null) // Abort the quit operation... else if (result.booleanValue() == true) // Save changes... else if (result.booleanValue() == false) // Abandon changes..
public String showMessageYesAllNoCancel(String caption, String message)
String result = agDialog.showMessageYesAllNoCancel( "Title", "Delete this file?");
public void displayError(Throwable e)
e
- the exception to displaytry { // Some processing that can throw an exception } catch (Exception e) { agDialog.displayError(e); }
public void displayError(String caption, Throwable e)
caption
- the title of the dialog boxe
- the exception to displaytry { // Some processing that can throw an exception } catch (Exception e) { agDialog.displayError("MyApplication Error", e); }
public Object showForm(String caption, String formspec, String query, String orderby, Hashtable params, int type, boolean resizable, int x, int y) throws AgoUnrecoverableSystemException, AgoSecurityException, IOException
caption
- the title of the windowformspec
- the name of the form to showquery
- a query to select records for the formorderby
- an orderby clause for record selection for the formparameters
- parameters to pass to the formwindowType
- the type of window to show. This parameter must
be one of the constants agDialog.FORM_MODAL
, agDialog.FORM_MODELESS
, or
agDialog.FORM_FRAME
resizable
- specifies whether the window is resizable or notx
- the horizontal location of the window in pixels.
Specify -1 for both x and y to center the window on the screen.y
- the the vertical location of the window in pixels.
Specify -1 for both x and y to center the window on the screen.
If the windowType is FORM_MODAL
, the showForm()
method returns the value passed to the form's call to closeDialog()
,
otherwise it returns the form object.
The formspec can be:
A window type of agDialog.FORM_MODAL
results in a modal dialog.
This restricts all user input to the new window until it is dismissed.
A window type of agDialog.FORM_MODELESS
results in a modeless
dialog. This allows input to the new window as well as to any other windows,
but the new window always remains on top of the window containing the form
that created it.
A window type of agDialog.FORM_FRAME
results in a new frame
window. This window has no restrictions on input or position.
Hashtable params = new Hashtable(); // put appropriate data into hashtable here AgfForm f; try { f = agDialog.showForm("Employees", "EmployeeForm", "Employees.salary > 35000", "Employees.lastname asc", params, agDialog.FORM_MODAL, false, -1, -1); } catch (Exception e) { agDialog.displayError(e); return; }
public Object showFormDialog(String caption, String formspec, String query, String orderby, Hashtable params) throws AgoUnrecoverableSystemException, AgoSecurityException, IOException
caption
- the title of the windowformspec
- the name of the form to showquery
- a query to select records for the formorderby
- an orderby clause for record selection for the formparameters
- parameters to pass to the form
Returns the value passed to the form's call to closeDialog()
.
The formspec can be:
Hashtable params = new Hashtable(); // put appropriate data into hashtable here Object returnValue; try { returnValue = agDialog.showFormDialog("Employees", "EmployeeForm", "Employees.salary > 35000", "Employees.lastname asc", params); } catch (Exception e) { agDialog.displayError(e); return; }
public Object showFormDialog(String caption, String formspec, Hashtable params) throws AgoUnrecoverableSystemException, AgoSecurityException, IOException
caption
- the title of the dialog boxformspec
- the name of the form to showparams
- parameters to pass to the form
Returns the value passed to the form's call to closeDialog()
.
The formspec can be:
Hashtable params = new Hashtable(); // put appropriate data into hashtable here Object returnValue; try { returnValue = agDialog.showFormDialog("Update", "UpdateForm", params); } catch (Exception e) { agDialog.displayError(e); }
PvHelperDialog.getForm(String, Hashtable)
,
AgoUnrecoverableSystemException
public Object showFormDialog(String caption, String formspec) throws AgoUnrecoverableSystemException, AgoSecurityException, IOException
caption
- the title of the windowformspec
- the name of the form to show
Returns the value passed to the form's call to closeDialog()
.
The formspec can be:
Object returnValue; try { returnValue = agDialog.showFormDialog("Options", "OptionsForm"); } catch (Exception e) { agDialog.displayError(e); return; }
public Object showForm(String caption, AgfForm form, int type, boolean resizable, int x, int y)
caption
- the title of the windowform
- the form to showwindowType
- the type of window to show. This parameter must
be one of the constants agDialog.FORM_MODAL
, agDialog.FORM_MODELESS
, or
agDialog.FORM_FRAME
.resizable
- specifies whether the window is resizable or notx
- the horizontal location of the window in pixels.
Specify -1 for both x and y to center the window on the screen.y
- the the vertical location of the window in pixels.
Specify -1 for both x and y to center the window on the screen.
Use the getForm()
method to get a form object.
If the windowType is FORM_MODAL
, the showForm()
method returns the value passed to the form's call to closeDialog()
,
otherwise it returns the form object.
A window type of agDialog.FORM_MODAL
results in a modal dialog.
This restricts all user input to the new window until it is dismissed.
A window type of agDialog.FORM_MODELESS
results in a modeless
dialog. This allows input to the new window as well as to any other windows,
but the new window always remains on top of the window containing the form
that created it.
A window type of agDialog.FORM_FRAME
results in a new frame
window. This window can be has no restrictions on input or position.
AgfForm f; // Get a form using getForm() agDialog.showForm("Employees", f, agDialog.FORM_MODAL, false, -1, -1);
public Object showFormDialog(String caption, AgfForm dialog)
caption
- the title of the dialog boxform
- the form to display
Use the getForm()
method to get a form object.
Returns the value passed to the form's call to closeDialog()
.
AgfForm f; // Get a form using getForm() Object returnValue = agDialog.showForm("Title", f);
AgfForm
public AgfForm getForm(String formspec, String query, String orderby, Hashtable params) throws AgoUnrecoverableSystemException, AgoSecurityException, IOException
formspec
- the name of the form. A formspec is one of: query
- a query restringing the form's set of recordsorderby
- an Order By clause for the form's set of recordsparams
- parameters to pass to the form
Use the showFormDialog()
method to display the form in a dialog box.
Use the add()
method to add the form to the current form as a subform.
Hashtable params = new Hashtable(); // put appropriate data into hashtable here AgfForm f; try { f = agDialog.getForm("EmployeeForm", "Employees.salary > 35000", "Employees.lastname asc", params); } catch (Exception e) { agDialog.displayError(e); return; }
public AgfForm getForm(String formspec, Hashtable params) throws AgoUnrecoverableSystemException, AgoSecurityException, IOException
formspec
- the name of the form. A formspec is one of: params
- parameters to pass to the form
Use the showFormDialog()
method to display the form in a dialog box.
Use the add()
method to add the form to the current form as a subform.
Hashtable params = new Hashtable(); // put appropriate data into hashtable here AgfForm f; try { f = agDialog.getForm("PopupForm1", params); } catch (Exception e) { agDialog.displayError(e); return; }
AgfForm
public AgfForm getForm(String formspec) throws AgoUnrecoverableSystemException, AgoSecurityException, IOException
formspec
- the name of the form. A formspec is one of:
Use the showFormDialog()
method to display the form in a dialog box.
Use the add()
method to add the form to the current form as a subform.
AgfForm f; try { f = agDialog.getForm("PopupForm1"); } catch (Exception e) { agDialog.displayError(e); return; }
AgfForm
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |