|
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.PvHelperGeneral
The PvHelperGeneral class provides general purpose helper methods for Java-based forms. SilverStream creates an instance of PvHelperGeneral for every form control created. The instance variable is called agGeneral.
Constructor Summary | |
PvHelperGeneral()
|
Method Summary | |
void |
beginWaitCursor()
Turns on the wait cursor. |
void |
endWaitCursor()
Turns off the wait cursor. |
String[] |
getArguments()
Returns any application-specific arguments that a user includes on the command line when starting a form with SilverJRunner. |
URL |
getDatabaseURL()
Returns an URL pointing to the database that contains the form. |
int |
getEnvironment()
Returns information about the environment in which the form is running. |
Image |
getIconImage()
Gets the icon image of the form's frame, if possible. |
AgrServerSession |
getServerSession()
Gets the server session associated with this form. |
String |
getTitle()
Obtains the title of the form's containing window, if possible. |
Object |
invokeAgent(String agentSpec)
Deprecated. use PvHelperGeneral.invokeBusinessObject(String) |
Object |
invokeAgent(String agentSpec,
Object param)
Deprecated. use PvHelperGeneral.invokeBusinessObject(String, Serializable) |
Serializable |
invokeBusinessObject(String agentSpec)
Invokes the named business object. |
Serializable |
invokeBusinessObject(String agentSpec,
Serializable param)
Invokes the named business object. |
void |
setIconImage(Image icon)
Sets the icon image of the form's frame, if possible. |
void |
setTitle(String title)
Sets the title of the form's window, if possible. |
void |
showConsole(boolean show)
Shows or hides the Java console, which displays printouts and exceptions. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public PvHelperGeneral()
Method Detail |
public int getEnvironment()
The return value is one of these values:
ENV_BROWSER
- the form is running in a browser.
ENV_APPLICATION
- the form is running in SilverJRunner.
ENV_DESIGNER
- the form is running in test mode in the SilverStream
Form Designer.
switch (agGeneral.getEnvironment()) { case agGeneral.ENV_BROWSER: //do something break; case agGeneral.ENV_APPLICATION: //do something else break; case agGeneral.ENV_DESIGNER: //do something different break; }
public String[] getArguments()
SilverJRunner -ss_proxy=myproxy myserver mydb myform -s aaa bbb
This passes these application arguments to the form:
-s aaa bbb
To access them, code the following in an appropriate form event (such as formActivate):
String[] passedArgs; passedArgs = agGeneral.getArguments();
public Serializable invokeBusinessObject(String agentSpec) throws Exception
agentSpec
- the name of the business object to invokeThe business object spec. can be:
You cannot specify the ip address of the server or the full server name.
The invokeBusinessObject()
method returns a result that the
writer of the business object sets by calling setResult()
on the
AgoInvokedEvent object passed to the invoked event.
Object retVal = agGeneral.invokeBusinessObject("mypackage.mysubpkg.MyBusObj");
This example uses invokeBusinessObject and invokes an object in another database.
try { agGeneral.invokeBusinessObject("WineDemo2:com.silverdemo.dso.general.Invoked"); } catch (Exception __exx) { agDialog.displayError(__exx); }
public Serializable invokeBusinessObject(String agentSpec, Serializable param) throws Exception
agentSpec
- the name of the business object to invoke.param
- any Serializable parameter you want to pass to the
business objectThe business object spec. can be:
You cannot specify the ip address of the server or the full server name.
The invokeBusinessObject()
method returns a result that the
writer of the business object sets by calling setResult()
on the
AgoInvokedEvent object passed to the invoked event.
Object retVal = agGeneral.invokeBusinessObject("mypackage.mysubpkg.MyBusObj", CustID.getIntegerValue());
public Object invokeAgent(String agentSpec) throws AgoUnrecoverableSystemException, IOException
PvHelperGeneral.invokeBusinessObject(String)
agentSpec
- This can be:public Object invokeAgent(String agentSpec, Object param) throws AgoUnrecoverableSystemException, IOException
PvHelperGeneral.invokeBusinessObject(String, Serializable)
agentSpec
- This can be:params
- a set of parameters to pass to the agent.public void beginWaitCursor()
Calls to beginWaitCursor()
can be nested. That is, if you
call beginWaitCursor()
twice and then call
endWaitCursor()
once, the wait cursor will still be displayed.
agGeneral.beginWaitCursor();
PvHelperGeneral.endWaitCursor()
public void endWaitCursor()
agGeneral.endWaitCursor();
PvHelperGeneral.beginWaitCursor()
public URL getDatabaseURL()
The database URL ends with a trailing slash and might look something like this:
http://MyServer/MyDatabase/
java.net.URL myURL; myURL = agGeneral.getDatabaseURL
public void setTitle(String title)
title
- the title to set for the windowThe title can only be set if the form is displayed in a dialog or frame, or if it is being run as a SilverJRunner application.
PvHelperGeneral.getTitle()
public String getTitle()
The getTitle()
method returns a title only if the form is being
displayed in a dialog or frame, or if it is being run as an application
(SilverJRunner).
PvHelperGeneral.setTitle(String)
public void setIconImage(Image icon)
The setIconImage()
method should be called from the
formActivate event (not from the formLoaded event), since it requires that
the form already have been added to its containing frame.
This method can be used only if the form is being displayed in a dialog or frame, or if it is being run as an application (SilverJRunner).
agGeneral.setIconImage(getImage("myIcon.gif");
PvHelperGeneral.getIconImage()
public Image getIconImage()
The getIconImage()
method should be called from the formActivate
event (not from the formLoaded event), since it requires that the form already
have been added to its containing frame.
This method can be used only if the form is being displayed in a dialog or frame, or if it is being run as an application (SilverJRunner).
Image currentIcon; currentIcon = agGeneral.getIconImage();
PvHelperGeneral.setIconImage(Image)
public void showConsole(boolean show)
show
- if true, the console is shown; if false, the console is hiddenpublic AgrServerSession getServerSession()
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |