import { Toolbar } from '@jupyterlab/apputils' ; import { Signal , ISignal } from '@phosphor/signaling' ; import { ToolbarItems } from '../components' ; export class DatabaseSummaryToolbar extends Toolbar { constructor ( connectionUrl ) { super ( ) ; this . _onBackButtonClicked = this . _onBackButtonClicked . bind ( this ) ; this . _onRefreshButtonClicked = this . _onRefreshButtonClicked . bind ( this ) ; this . addItem ( 'back' , new ToolbarItems . BackButton ( { onClick : this . _onBackButtonClicked } ) ) ; this . addItem ( 'refresh' , new ToolbarItems . RefreshButton ( { onClick : this . _onRefreshButtonClicked } ) ) ; this . addItem ( 'spacer' , Toolbar . createSpacerItem ( ) ) ; this . addItem ( 'url' , new ToolbarItems . ConnectionUrlItem ( connectionUrl ) ) ; this . addItem ( 'loading' , this . _loadingIcon ) ; } get backButtonClicked ( ) : ISignal < this , void > { return this . _backButtonClicked ; } get refreshButtonClicked ( ) : ISignal < this , void > { return this . _refreshButtonClicked ; } setLoading ( isLoading ) { this . _loadingIcon . setLoading ( isLoading ) ; } private _onBackButtonClicked ( ) { this . _backButtonClicked . emit ( void 0 ) ; } private _onRefreshButtonClicked ( ) { this . _refreshButtonClicked . emit ( void 0 ) ; } private readonly _loadingIcon : ToolbarItems . LoadingIcon = new ToolbarItems . LoadingIcon ( ) ; private readonly _backButtonClicked : Signal < this , void > = new Signal ( this ) ; private readonly _refreshButtonClicked : Signal < this , void > = new Signal ( this ) ; }