www.element4solution.com

e4s.html
Class E4EventHandlerBODY

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.E4JavaScriptIncludes
          extended by e4s.html.E4JavaScript
              extended by e4s.html.E4EventHandler
                  extended by e4s.html.E4EventHandlerBODY
All Implemented Interfaces:
E4EventHandler_Intf, E4JavaScript_Intf

public class E4EventHandlerBODY
extends E4EventHandler
implements E4EventHandler_Intf

Event handler for the <BODY>-tag for E4JavaScript based functions. A typical E4EventHandler is the <A onClick="myfunction();"> which calls the local E4JavaScript-function myfunction() when the user clicks on the items associated with this Anchor tag. An event handler is more than a E4JavaScript, because it also defines the point where it needs to be involved from viewpoint of calling it.

Since:
JDK 1.4
See Also:
BODY, {@tutorial Example_E4JavaScript}

Nested Class Summary
 
Nested classes/interfaces inherited from class e4s.html.E4JavaScript
E4JavaScript.E4JavaScriptException, E4JavaScript.JSBODY, E4JavaScript.JSIF, E4JavaScript.JSIFNOELSE, E4JavaScript.JSRETURN, E4JavaScript.JSTRY, E4JavaScript.JSVAR
 
Field Summary
static int _EVENT_ONDRAGSTART
           
static int _EVENT_ONLOAD
           
static int _EVENT_ONORIENTATIONCHANGE
           
static int _EVENT_ONRESIZE
           
static int _EVENT_ONSCROLL
           
static int _EVENT_ONUNLOAD
           
 
Fields inherited from class e4s.html.E4EventHandler
m_return
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Fields inherited from interface e4s.html.E4EventHandler_Intf
RETURN_FALSE, RETURN_NONE, RETURN_TRUE
 
Constructor Summary
E4EventHandlerBODY(int eventId)
          Create an unnamed event handler for the body tag.
E4EventHandlerBODY(int eventId, int timeout)
           
E4EventHandlerBODY(int eventId, java.lang.String name)
          Create a named event handler for the body tag.
E4EventHandlerBODY(int eventId, java.lang.String name, int timeout)
          Create a named event handler for the body tag that is executed after a specified period.
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
static E4EventHandlerBODY ehCloseWindow()
           
static E4EventHandlerBODY ehForward(E4Method mref, E4CgiParams params, E4ServletImplementation_Intf servlet)
          Construct a handler that redirects the document.location to the specified method.
static E4EventHandlerBODY ehForward(E4Method mref, E4FrameName framename, E4CgiParams params, E4ServletImplementation_Intf servlet)
          Construct a handler that redirects the document.location to the specified method.
static E4EventHandlerBODY ehForward(E4Method mref, E4FrameName framename, E4ServletImplementation_Intf servlet)
          Construct a handler that redirects the document.location to the specified method.
static E4EventHandlerBODY ehForward(E4Method mref, E4ServletImplementation_Intf servlet)
          Construct a handler that redirects the document.location to the specified method.
static E4EventHandlerBODY ehForward(E4String url)
          Construct a handler that redirects the document.location to the specified url address.
static E4EventHandlerBODY ehForward(E4String url, E4FrameName framename)
          Construct a handler that redirects the document.location to the specified url address.
static E4EventHandlerBODY ehForward(E4String url, E4FrameName framename, E4CgiParams params)
          Construct a handler that redirects the document.location to the specified url address.
static E4EventHandlerBODY ehForward(java.lang.String url)
          Construct a handler that redirects the document.location to the specified url address.
static E4EventHandlerBODY ehForward(java.lang.String url, E4FrameName framename)
          Construct a handler that redirects the document.location to the specified url address.
static E4EventHandlerBODY ehForward(java.lang.String url, E4FrameName framename, E4CgiParams params)
          Construct a handler that redirects the document.location to the specified url address.
static E4EventHandlerBODY ehPrint()
          Construct a handler that starts the browser's print dialog using window.print().
 java.lang.String getEventName()
          Get the name of the Event (e.g. onload, onblur, ..)
 java.lang.String getParam()
          Define a parameter (or parameter list) for the script.
 int getTimeout()
           
 void includedReturn(boolean mode)
          Does this event handler need a return statement?
 boolean isEvent(int id)
           
static E4EventHandlerBODY resizeFrame(E4FrameName frame_id, E4ServletImplementation_Intf servlet)
          Create an event handler for resizing of a Frame.
static E4EventHandlerBODY resizeFrame(java.lang.String frame_id, E4ServletImplementation_Intf servlet)
          Create an event handler for resizing of a Frame.
static E4JavaScript resizeWindow(java.lang.String windows_id, E4ServletImplementation_Intf servlet)
           
 void setParam(int param)
          Define a parameter (or parameter list) for the script.
 void setParam(java.lang.String param, boolean quote)
          Define a parameter (or parameter list) for the script.
 void setTimeout(int millisec)
           
 
Methods inherited from class e4s.html.E4EventHandler
needsReturn, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam
 
Methods inherited from class e4s.html.E4JavaScript
append_alert, append, appendln, appendln, body, clear, Escape, Escape, Escape, Escape, getFunctionBody, getName, hasFunctionBody, isInline, JSBODY, resetBuffer, resizeWindow, setName, toString
 
Methods inherited from class e4s.html.E4JavaScriptIncludes
addScript, getAdditionalScripts
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface e4s.html.E4EventHandler_Intf
getName, needsReturn
 
Methods inherited from interface e4s.html.E4JavaScript_Intf
getAdditionalScripts
 

Field Detail

_EVENT_ONLOAD

public static final int _EVENT_ONLOAD
See Also:
Constant Field Values

_EVENT_ONUNLOAD

public static final int _EVENT_ONUNLOAD
See Also:
Constant Field Values

_EVENT_ONRESIZE

public static final int _EVENT_ONRESIZE
See Also:
Constant Field Values

_EVENT_ONDRAGSTART

public static final int _EVENT_ONDRAGSTART
See Also:
Constant Field Values

_EVENT_ONSCROLL

public static final int _EVENT_ONSCROLL
See Also:
Constant Field Values

_EVENT_ONORIENTATIONCHANGE

public static final int _EVENT_ONORIENTATIONCHANGE
See Also:
Constant Field Values
Constructor Detail

E4EventHandlerBODY

public E4EventHandlerBODY(int eventId,
                          java.lang.String name)
Create a named event handler for the body tag.

Parameters:
eventId - an integer value, representing the type of event (e.g. _EVENT_ONLOAD).
name - the name of the event handler
See Also:
E4EventHandlerBODY(int,String,int), E4EventHandlerBODY(int)

E4EventHandlerBODY

public E4EventHandlerBODY(int eventId,
                          java.lang.String name,
                          int timeout)
Create a named event handler for the body tag that is executed after a specified period.

Parameters:
eventId - an integer value, representing the type of event (e.g. _EVENT_ONLOAD).
name - the name of the event handler
timeout - a timeout value in ms
See Also:
E4EventHandlerBODY(int), E4EventHandlerBODY(int,String)

E4EventHandlerBODY

public E4EventHandlerBODY(int eventId)
Create an unnamed event handler for the body tag.

Parameters:
eventId - an integer value, representing the type of event (e.g. _EVENT_ONLOAD).
See Also:
E4EventHandlerBODY(int,String,int), E4EventHandlerBODY(int,String)

E4EventHandlerBODY

public E4EventHandlerBODY(int eventId,
                          int timeout)
Method Detail

setTimeout

public void setTimeout(int millisec)

getTimeout

public int getTimeout()
Specified by:
getTimeout in interface E4EventHandler_Intf
Overrides:
getTimeout in class E4EventHandler
Returns:
0

setParam

public void setParam(java.lang.String param,
                     boolean quote)
Define a parameter (or parameter list) for the script. This is something different to the E4CgiParams class.

Specified by:
setParam in interface E4EventHandler_Intf
Overrides:
setParam in class E4EventHandler
Parameters:
param - a string representing the parameters for the script function
quote - put value between ' ' when calling the script
See Also:
getParam()

setParam

public void setParam(int param)
Define a parameter (or parameter list) for the script. This is something different to the E4CgiParams class.

Overrides:
setParam in class E4EventHandler
Parameters:
param - a string representing the parameters for the script function
See Also:
getParam()

getParam

public java.lang.String getParam()
Define a parameter (or parameter list) for the script. This is something different to the E4CgiParams class.

Specified by:
getParam in interface E4EventHandler_Intf
Overrides:
getParam in class E4EventHandler
Returns:
param a string representing the parameters for the script function
See Also:
getParam()

getEventName

public java.lang.String getEventName()
Get the name of the Event (e.g. onload, onblur, ..)

Specified by:
getEventName in interface E4EventHandler_Intf
Returns:
name of the event

resizeFrame

public static E4EventHandlerBODY resizeFrame(E4FrameName frame_id,
                                             E4ServletImplementation_Intf servlet)
Create an event handler for resizing of a Frame. When a frame resizes, the current X and Y dimensions are stored by a function call to {#link e4s.application.sysmodule.E4ModuleSystem#resizeFrame}. Note, that this script is bound to the BODY and not to the FRAME or FRAMESET object.

Parameters:
frame_id - ID of the frame (similar to the name)
servlet - the actual context
Returns:
the new created event handler
See Also:
resizeFrame( String, E4ServletImplementation_Intf )

resizeFrame

public static E4EventHandlerBODY resizeFrame(java.lang.String frame_id,
                                             E4ServletImplementation_Intf servlet)
Create an event handler for resizing of a Frame. When a frame resizes, the current X and Y dimensions are stored by a function call to {#link e4s.application.sysmodule.E4ModuleSystem#resizeFrame}. Note, that this script is bound to the BODY and not to the FRAME or FRAMESET object.

Parameters:
frame_id - name of the frame
servlet - the actual context
Returns:
the new created event handler
See Also:
resizeFrame( E4FrameName, E4ServletImplementation_Intf )

resizeWindow

public static E4JavaScript resizeWindow(java.lang.String windows_id,
                                        E4ServletImplementation_Intf servlet)

ehCloseWindow

public static E4EventHandlerBODY ehCloseWindow()

ehForward

public static E4EventHandlerBODY ehForward(java.lang.String url,
                                           E4FrameName framename)
Construct a handler that redirects the document.location to the specified url address.

Parameters:
url - a url outside the e4s environment, e.g. "http://www.google.com"
framename - might be null, or a valid frame name within the url shall be displayed
servlet - E4ModuleImplementation.getServlet()
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

ehForward

public static E4EventHandlerBODY ehForward(E4String url,
                                           E4FrameName framename)
Construct a handler that redirects the document.location to the specified url address.

Parameters:
url - a url outside the e4s environment, e.g. "http://www.google.com"
framename - might be null, or a valid frame name within the url shall be displayed
servlet - E4ModuleImplementation.getServlet()
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

ehForward

public static E4EventHandlerBODY ehForward(E4Method mref,
                                           E4FrameName framename,
                                           E4ServletImplementation_Intf servlet)
Construct a handler that redirects the document.location to the specified method.

Parameters:
mref - a method inside the e4s environment
framename - might be null, or a valid frame name within the url shall be displayed
servlet - E4ModuleImplementation.getServlet()
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

ehForward

public static E4EventHandlerBODY ehForward(E4Method mref,
                                           E4FrameName framename,
                                           E4CgiParams params,
                                           E4ServletImplementation_Intf servlet)
Construct a handler that redirects the document.location to the specified method.

Parameters:
mref - a method inside the e4s environment
framename - might be null, or a valid frame name within the url shall be displayed
params - additional parameters appended to the url in CGI notation
servlet - E4ModuleImplementation.getServlet()
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

ehForward

public static E4EventHandlerBODY ehForward(E4Method mref,
                                           E4CgiParams params,
                                           E4ServletImplementation_Intf servlet)
Construct a handler that redirects the document.location to the specified method.

Parameters:
mref - a method inside the e4s environment
params - additional parameters appended to the url in CGI notation
servlet - E4ModuleImplementation.getServlet()
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

ehForward

public static E4EventHandlerBODY ehForward(E4String url,
                                           E4FrameName framename,
                                           E4CgiParams params)
Construct a handler that redirects the document.location to the specified url address.

Parameters:
url - a url outside the e4s environment, e.g. "http://www.google.com"
framename - might be null, or a valid frame name within the url shall be displayed
params - additional parameters appended to the url in CGI notation
servlet - E4ModuleImplementation.getServlet()
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

ehForward

public static E4EventHandlerBODY ehForward(java.lang.String url,
                                           E4FrameName framename,
                                           E4CgiParams params)
Construct a handler that redirects the document.location to the specified url address. It is involked at _EVENT_ONLOAD.

Parameters:
url - a url outside the e4s environment, e.g. "http://www.google.com"
framename - might be null, or a valid frame name within the url shall be displayed
params - additional parameters appended to the url in CGI notation
servlet - E4ModuleImplementation.getServlet()
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

ehPrint

public static E4EventHandlerBODY ehPrint()
Construct a handler that starts the browser's print dialog using window.print(). It is involked at _EVENT_ONLOAD.

Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY), E4Images.print_1

ehForward

public static E4EventHandlerBODY ehForward(java.lang.String url)
Construct a handler that redirects the document.location to the specified url address.

Parameters:
url - a url outside the e4s environment, e.g. "http://www.google.com"
servlet - E4ModuleImplementation.getServlet()
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

ehForward

public static E4EventHandlerBODY ehForward(E4String url)
Construct a handler that redirects the document.location to the specified url address.

Parameters:
url - a url outside the e4s environment, e.g. "http://www.google.com"
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

ehForward

public static E4EventHandlerBODY ehForward(E4Method mref,
                                           E4ServletImplementation_Intf servlet)
Construct a handler that redirects the document.location to the specified method.

Parameters:
mref - a method inside the e4s environment
servlet - E4ModuleImplementation.getServlet()
Returns:
the new handler
See Also:
BODY.setEventHandler(e4s.html.E4EventHandlerBODY)

includedReturn

public void includedReturn(boolean mode)
Does this event handler need a return statement? Only possible, if only one event handler per type.

See Also:
E4EventHandler.needsReturn()

isEvent

public boolean isEvent(int id)
Specified by:
isEvent in interface E4EventHandler_Intf

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com