Package com.saperion.ngc.ngapplet
Class NgApplet
- java.lang.Object
-
- org.zkoss.zk.ui.AbstractComponent
-
- org.zkoss.zk.ui.HtmlBasedComponent
-
- com.saperion.ngc.ngapplet.NgApplet
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,org.zkoss.zk.ui.Component
,org.zkoss.zk.ui.ext.Scope
,org.zkoss.zk.ui.sys.ComponentCtrl
- Direct Known Subclasses:
MailAppletImpl
public class NgApplet extends org.zkoss.zk.ui.HtmlBasedComponent
The NgApplet embeds an applet by using the OBJECT tag instead of the deprecated APPLET tag.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NgApplet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getArchive()
java.lang.String
getCode()
java.lang.String
getCodebase()
java.util.Properties
getParameters()
void
invoke(java.lang.String function)
Invokes the function of the applet running at the client.void
invoke(java.lang.String function, java.lang.String argument)
Invokes the function of the applet running at the client with one argument.void
invoke(java.lang.String function, java.lang.String[] arguments)
Invokes the function of the applet running at the client with variable number argument.boolean
isIgnoreInvokeErrors()
Checks if invoke errors will be ignored.void
notifyWhenReady(int timeout, int attempts)
This method can be called after the applet was attached to a page.protected void
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
void
setArchive(java.lang.String archive)
Sets the archive parameter.void
setCode(java.lang.String code)
Sets the code parameter.void
setCodebase(java.lang.String codebase)
Sets the codebase.void
setIgnoreInvokeErrors(boolean ignoreInvokeErrors)
If set to true, all errors that occur when a method of the applet is called by JavaScript will be ignored.void
setJsonParameters(java.lang.String jsonParameters)
Sets the json parameters.java.lang.String
setParam(java.lang.String name, java.lang.String value)
Sets the parameter with the specified name.void
setParameters(java.util.Map<java.lang.String,java.lang.String> params)
Sets the parameters.void
setParameters(java.util.Properties params)
Sets the parameters.-
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, clone, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getPropertyAccess, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
-
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
-
-
-
Method Detail
-
getCodebase
public java.lang.String getCodebase()
- Returns:
- the applet's codebase parameter
-
setCodebase
public void setCodebase(java.lang.String codebase)
Sets the codebase.- Parameters:
codebase
- the new codebase
-
getCode
public java.lang.String getCode()
- Returns:
- the code parameter
-
setCode
public void setCode(java.lang.String code)
Sets the code parameter.- Parameters:
code
- the new code
-
getArchive
public java.lang.String getArchive()
- Returns:
- the applet's archive parameter
-
setArchive
public void setArchive(java.lang.String archive)
Sets the archive parameter.- Parameters:
archive
- the new archive
-
getParameters
public java.util.Properties getParameters()
- Returns:
- the parameters
-
setParameters
public void setParameters(java.util.Map<java.lang.String,java.lang.String> params)
Sets the parameters.- Parameters:
params
- the params
-
setParameters
public void setParameters(java.util.Properties params)
Sets the parameters.- Parameters:
params
- the new parameters
-
setJsonParameters
public void setJsonParameters(java.lang.String jsonParameters)
Sets the json parameters.- Parameters:
jsonParameters
- a json string containing the parameters
-
setParam
public java.lang.String setParam(java.lang.String name, java.lang.String value)
Sets the parameter with the specified name.- Parameters:
name
- the namevalue
- the value- Returns:
- the previous value of the parameter or null if it did not yet exist
-
isIgnoreInvokeErrors
public boolean isIgnoreInvokeErrors()
Checks if invoke errors will be ignored.- Returns:
- true, if invoke errors will be ignored
-
setIgnoreInvokeErrors
public void setIgnoreInvokeErrors(boolean ignoreInvokeErrors)
If set to true, all errors that occur when a method of the applet is called by JavaScript will be ignored.- Parameters:
ignoreInvokeErrors
- whether to ignore invoke errors or not
-
renderProperties
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException
- Overrides:
renderProperties
in classorg.zkoss.zk.ui.HtmlBasedComponent
- Throws:
java.io.IOException
- See Also:
HtmlBasedComponent.renderProperties(org.zkoss.zk.ui.sys.ContentRenderer)
-
invoke
public void invoke(java.lang.String function)
Invokes the function of the applet running at the client.- Parameters:
function
- name of the function
-
invoke
public void invoke(java.lang.String function, java.lang.String argument)
Invokes the function of the applet running at the client with one argument.- Parameters:
function
- name of the functionargument
- the argument
-
invoke
public void invoke(java.lang.String function, java.lang.String[] arguments)
Invokes the function of the applet running at the client with variable number argument.- Parameters:
function
- name of the functionarguments
- the arguments
-
notifyWhenReady
public void notifyWhenReady(int timeout, int attempts)
This method can be called after the applet was attached to a page. If called, a JavaScript method is invoked that will try forattempts
times to check if the applet is ready. A delay oftimeout
milliseconds will be used between two attempts. If the applet is ready, an onAppletReady event will be fired.- Parameters:
timeout
- timeout between attemptsattempts
- number of attempts
-
-