'use strict' ; import * as path from 'path' ; import { ProjectItemWizardPage } from './projectItemWizardPage' ; import { ALEnumWizardData } from './alEnumWizardData' ; import { ALEnumSyntaxBuilder } from '../syntaxbuilders/alEnumSyntaxBuilder' ; import { DevToolsExtensionContext } from '../../devToolsExtensionContext' ; import { ALObjectWizardSettings } from './alObjectWizardSettings' ; export class ALEnumWizardPage extends ProjectItemWizardPage { private _enumWizardData : ALEnumWizardData ; constructor ( toolsExtensionContext , settings , data ) { super ( toolsExtensionContext , "AL Enum Wizard" , settings ) ; this . _enumWizardData = data ; } protected onDocumentLoaded ( ) { this . sendMessage ( { command : 'setData' , data : this . _enumWizardData } ) ; } protected getHtmlContentPath ( ) { return path . join ( 'htmlresources' , 'alenumwizard' , 'alenumwizard.html' ) ; } protected getViewType ( ) { return "azALDevTools.ALEnumWizard" ; } protected async finishWizard ( data ) { this . _enumWizardData . objectId = data . objectId ; this . _enumWizardData . objectName = data . objectName ; this . _enumWizardData . valueList = data . valueList ; this . _enumWizardData . captionList = data . captionList ; this . _enumWizardData . extensible = data . extensible ; var builder = new ALEnumSyntaxBuilder ( ) ; var source = builder . buildFromEnumWizardData ( this . _settings . getDestDirectoryUri ( ) , this . _enumWizardData ) ; this . createObjectFile ( 'Enum' , this . _enumWizardData . objectId , this . _enumWizardData . objectName , source ) ; return true ; } }