Class CancellationController
- All Implemented Interfaces:
HasHandlers
-
Field Summary
Fields inherited from class com.smartgwt.client.core.BaseClass
config, configOnly, factoryCreated, factoryProperties, id, scClassName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncancel()
Requests cancellation of all asynchronous operations that are pollingcanceled
or observing this method.Requests cancellation of all asynchronous operations that are pollingcanceled
or observing this method.create()
Creates a newCancellationController
which is canceled whenever thisCancellationController
is canceled.Whethercancel()
has been called.The reason, if any, passed to the first call tocancel()
.getJsObj()
static CancellationController
getOrCreateRef
(JavaScriptObject jsObj) boolean
void
Methods inherited from class com.smartgwt.client.core.BaseClass
addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setID, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName
-
Constructor Details
-
CancellationController
public CancellationController() -
CancellationController
-
-
Method Details
-
getOrCreateRef
-
setJavaScriptObject
- Overrides:
setJavaScriptObject
in classBaseClass
-
create
-
isCreated
public boolean isCreated() -
getJsObj
-
getOrCreateJsObj
- Overrides:
getOrCreateJsObj
in classBaseClass
-
getCanceled
Whethercancel()
has been called.Note : This method should be called only after the underlying component has been created.
- Returns:
- Current canceled value. Default value is false
- Throws:
IllegalStateException
- if the underlying component has not yet been created.
-
getCancellationReason
The reason, if any, passed to the first call tocancel()
.Note : This method should be called only after the underlying component has been created.
- Returns:
- Current cancellationReason value. Default value is null
- Throws:
IllegalStateException
- if the underlying component has not yet been created.- See Also:
-
cancel
Requests cancellation of all asynchronous operations that are pollingcanceled
or observing this method. Also cancels anysub-
s of thisCancellationController
CancellationController
that are not already canceled.this.cancellationReason
is set to the providedreason
only on the first call to cancel().For observers of this method, the recommended practice is to capture the
returnVal
and only perform the cancellation steps if thereturnVal
wastrue
. This is because it could happen that cancel() is called a second time before the observers finish.- Returns:
true
if this was the first call to cancel();false
otherwise.
-
cancel
Requests cancellation of all asynchronous operations that are pollingcanceled
or observing this method. Also cancels anysub-
s of thisCancellationController
CancellationController
that are not already canceled.this.cancellationReason
is set to the providedreason
only on the first call to cancel().For observers of this method, the recommended practice is to capture the
returnVal
and only perform the cancellation steps if thereturnVal
wastrue
. This is because it could happen that cancel() is called a second time before the observers finish.- Parameters:
reason
- A reason for cancellation. SeeHTMLString
- Returns:
true
if this was the first call to cancel();false
otherwise.
-
createSubController
Creates a newCancellationController
which is canceled whenever thisCancellationController
is canceled.Note that the sub-
CancellationController
may be independently canceled before this parentCancellationController
is canceled.- Returns:
- a new
CancellationController
that is canceled whenever thisCancellationController
is canceled.
-