Abstract Class: ViewService
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:20
A service to manage views.
Extended by
Constructors
Constructor
new ViewService(
bus
):ViewService
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:50
Constructs the view service.
Parameters
Parameter | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
Returns
ViewService
Properties
activeView
readonly
activeView:Subscribable
<null
|UiView
<UiViewProps
,any
,any
>>
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:36
The currently active view.
activeViewKey
readonly
activeViewKey:Subscribable
<string
>
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:34
The key of the currently active view.
bus
protected
readonly
bus:EventBus
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:50
The event bus.
fmsEventMap
protected
readonly
fmsEventMap:Map
<string
,FmsHEvent
>
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:42
override in child class
ignorePageHistory
protected
ignorePageHistory:boolean
=false
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:39
openPage
readonly
openPage:Subscribable
<null
|UiPage
<UiPageProps
>>
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:30
The currently open page.
openPageKey
readonly
openPageKey:Subscribable
<string
>
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:28
The key of the currently open page.
pageHistory
protected
readonly
pageHistory:ViewEntry
<UiView
<UiViewProps
,any
,any
>>[] =[]
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:38
Methods
clearPageHistory()
clearPageHistory():
void
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:231
Clears this view service's page history.
Returns
void
clearStack()
protected
clearStack(closePage
):void
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:253
Closes all open views and clears the stack.
Parameters
Parameter | Type | Description |
---|---|---|
closePage | boolean | Whether to close the currently open page, if one exists. |
Returns
void
closeActiveView()
closeActiveView():
void
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:238
Closes the currently active view.
Returns
void
closeAllViews()
closeAllViews():
void
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:245
Closes all open views except for the currently open page, if one exists.
Returns
void
getOpenViews()
getOpenViews(): readonly
UiView
<UiViewProps
,any
,any
>[]
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:93
Gets an array of all currently open views.
Returns
readonly UiView
<UiViewProps
, any
, any
>[]
an array of all currently open views.
onInteractionEvent()
protected
onInteractionEvent(hEvent
):boolean
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:64
Routes the HEvents to the views.
Parameters
Parameter | Type | Description |
---|---|---|
hEvent | string | The event identifier. |
Returns
boolean
whether the event was handled
open()
open<
T
>(type
,isSubView
):T
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:117
Opens a view. The opened view can be a page, regular view, or subview. Opening a page will close all other views, including the currently open page. Opening a regular view will close all other views except the currently open page. Opening a subview does not close any other views. The opened view will immediately become the active view, and the previously active view (if one exists) will be paused.
Type Parameters
Type Parameter | Default type |
---|---|
T extends UiView <UiViewProps , any , any > | UiView <UiViewProps , any , any > |
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
type | string | undefined | The type of the view to open. |
isSubView | boolean | false | A boolean indicating if the view to be opened is a subview. |
Returns
T
The view that was opened.
Throws
Error if the view type is not registered with this service.
openLastPage()
openLastPage():
null
|UiPage
<UiPageProps
>
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:217
Opens the page that was most recently closed.
Returns
null
| UiPage
<UiPageProps
>
The page that was opened.
registerView()
registerView(
type?
,vnodeFn?
):void
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:102
Registers a view with the service.
Parameters
Parameter | Type | Description |
---|---|---|
type? | string | The type of the view. |
vnodeFn? | () => VNode | A function creating the VNode. |
Returns
void
routeInteractionEventToViews()
protected
routeInteractionEventToViews(evt
):boolean
Defined in: workingtitle-instruments-g1000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG1000/Shared/UI/ViewService.ts:81
Routes an interaction to the active view, and if it is not handled, re-routes the interaction to the currently open page if it exists and is not the active view.
Parameters
Parameter | Type | Description |
---|---|---|
evt | FmsHEvent | An interaction event. |
Returns
boolean
Whether the event was handled.