FoxitPDFSDKforWeb  8.4.0
Foxit PDF SDK for Web
StatefulController Class Reference

This Controller class encapsulates the implementation logic for IStateHandler registration and toggle event listening. A customization example:

class MyStateHandlerClass extends PDFViewCtrl.IStateHandler {
// ...
}
class MyStateController extends UIExtension.controllers.StatefulController {
constructor(component) {
super(component, MyStateHandlerClass);
}
}

. More...

Inheritance diagram for StatefulController:
CreateAreaController CreateAreaHighlightController CreateArrowController CreateCalloutController CreateCaretController CreateCircleAreaController CreateCircleController CreateDistanceController CreateFileAttachmentController CreateHighlightController CreateImageController CreateLineController CreateLinkController CreatePencilController CreatePerimeterController CreatePolygonCloudController CreatePolygonController CreatePolylineController CreateReplaceController CreateSquareController CreateSquigglyController CreateStrikeoutController CreateTextboxController CreateTextController CreateTypewriterController CreateUnderlineController HandController LoupeController MarqueeToolController SelectTextAnnotationController

Public Member Functions

 constructor (component, ExpectedStateHandlerClass)
 Classes inherit from StatefulController must override this contructor and passing a class inherit from IStateHandler into super() function. If that StateHandler class has been registed, you can also passing the state handler name instead of class into super() function. More...
 

Protected Member Functions

 stateIn ()
 Triggered when the viewer state switched into this 'ExpectedStateHandlerClass'. More...
 
 stateOut ()
 Triggered when the viewer state switched into another StateHandlerClass. More...
 

Detailed Description

This Controller class encapsulates the implementation logic for IStateHandler registration and toggle event listening. A customization example:

class MyStateHandlerClass extends PDFViewCtrl.IStateHandler {
// ...
}
class MyStateController extends UIExtension.controllers.StatefulController {
constructor(component) {
super(component, MyStateHandlerClass);
}
}

.

See also
PDFViewer::getStateHandlerManager()
StateHandlerManager
IStateHandler
Since
7.0.0

Member Function Documentation

◆ constructor()

constructor (   component,
  ExpectedStateHandlerClass 
)
inline

Classes inherit from StatefulController must override this contructor and passing a class inherit from IStateHandler into super() function. If that StateHandler class has been registed, you can also passing the state handler name instead of class into super() function.

Example 1, passing a MyStateHandlerClass into super():

class MyStateHandlerClass extends PDFViewCtrl.IStateHandler {
// ...
}
class MyStateController extends UIExtension.controllers.StatefulController {
constructor(component) {
super(component, MyStateHandlerClass);
}
}

Example 2, passing state handler name into super():

class MystateController extends UIExtension.controllers.StatefulController {
constructor(component) {
super(component, 'your-custom-state-name');
}
}
Parameters
componentComponent
ExpectedStateHandlerClassfunction(new:IStateHandler) | string
See also
IStateHandler

◆ stateIn()

StatefulController::stateIn ( )
inlineprotected

Triggered when the viewer state switched into this 'ExpectedStateHandlerClass'.

Returns
void

◆ stateOut()

StatefulController::stateOut ( )
inlineprotected

Triggered when the viewer state switched into another StateHandlerClass.

Returns
void

Foxit Software Corporation Logo
@2022 Foxit Software Incorporated. All rights reserved.