async run(){

        let printerSelectSection = document.createElement('div'); 
        printerSelectSection.id = this.id;
        printerSelectSection.classList.add('dirSerlector');

        let printerSelectLabel = document.createElement('label');
        printerSelectLabel.id = this.id + 'Label';
        printerSelectLabel.setAttribute('for', this.id + 'Field');
        printerSelectLabel.innerHTML = 'Printer:';
        printerSelectSection.appendChild(printerSelectLabel);  

        let printerSelectField = document.createElement('select');
        printerSelectField.id = this.id + 'Field';
        for (var i = 0; i < this.contents.length; i++){
            let option = document.createElement('option');
            option.value = this.contents[i].path;
            option.text = this.contents[i].name;
            printerSelectField.appendChild(option);
        }
        printerSelectSection.appendChild(printerSelectField);

        let printerSelectButton = document.createElement('button');
        printerSelectButton.id = this.id + 'Button';
        printerSelectButton.innerHTML = 'Select';
        printerSelectSection.appendChild(printerSelectButton);

        document.getElementById(this.parentId).appendChild(printerSelectSection);

        // wait for the user to choose and lock stuff down
        await new Promise(r=>printerSelectButton.addEventListener('click', r, {once:true}));

        let selectedPrinterName = printerSelectField.options[printerSelectField.selectedIndex].text;
        let selectedPrinterPath = printerSelectField.value;

        printerSelectField.remove();
        printerSelectButton.remove();

        let printerSelectName = document.createElement('span');
        printerSelectName.id = this.id + 'Name';
        printerSelectName.innerHTML = selectedPrinterName;
        printerSelectSection.appendChild(printerSelectName);

        return this.dir + selectedPrinterPath; 
    }
/**
     * The method generates the interface for a user to select what printer they want to configure
     * 
     * @returns {string} the path to the printer to configure
     */
The method generates the interface for a user to select what printer they want to configure

@returns {string} the path to the printer to configure
The method generates the interface for a user to select what printer they want to configure @returns { string } the path to the printer to configure
async run(){
        let printerSelectSection = document.createElement('div'); 
        printerSelectSection.id = this.id;
        printerSelectSection.classList.add('dirSerlector');
        let printerSelectLabel = document.createElement('label');
        printerSelectLabel.id = this.id + 'Label';
        printerSelectLabel.setAttribute('for', this.id + 'Field');
        printerSelectLabel.innerHTML = 'Printer:';
        printerSelectSection.appendChild(printerSelectLabel);  
        let printerSelectField = document.createElement('select');
        printerSelectField.id = this.id + 'Field';
        for (var i = 0; i < this.contents.length; i++){
            let option = document.createElement('option');
            option.value = this.contents[i].path;
            option.text = this.contents[i].name;
            printerSelectField.appendChild(option);
        }
        printerSelectSection.appendChild(printerSelectField);
        let printerSelectButton = document.createElement('button');
        printerSelectButton.id = this.id + 'Button';
        printerSelectButton.innerHTML = 'Select';
        printerSelectSection.appendChild(printerSelectButton);
        document.getElementById(this.parentId).appendChild(printerSelectSection);
        await new Promise(r=>printerSelectButton.addEventListener('click', r, {once:true}));
        let selectedPrinterName = printerSelectField.options[printerSelectField.selectedIndex].text;
        let selectedPrinterPath = printerSelectField.value;
        printerSelectField.remove();
        printerSelectButton.remove();
        let printerSelectName = document.createElement('span');
        printerSelectName.id = this.id + 'Name';
        printerSelectName.innerHTML = selectedPrinterName;
        printerSelectSection.appendChild(printerSelectName);
        return this.dir + selectedPrinterPath; 
    }
async run ( ) { let printerSelectSection = document . createElement ( 'div' ) ; printerSelectSection . id = this . id ; printerSelectSection . classList . add ( 'dirSerlector' ) ; let printerSelectLabel = document . createElement ( 'label' ) ; printerSelectLabel . id = this . id + 'Label' ; printerSelectLabel . setAttribute ( 'for' , this . id + 'Field' ) ; printerSelectLabel . innerHTML = 'Printer:' ; printerSelectSection . appendChild ( printerSelectLabel ) ; let printerSelectField = document . createElement ( 'select' ) ; printerSelectField . id = this . id + 'Field' ; for ( var i = 0 ; i < this . contents . length ; i ++ ) { let option = document . createElement ( 'option' ) ; option . value = this . contents [ i ] . path ; option . text = this . contents [ i ] . name ; printerSelectField . appendChild ( option ) ; } printerSelectSection . appendChild ( printerSelectField ) ; let printerSelectButton = document . createElement ( 'button' ) ; printerSelectButton . id = this . id + 'Button' ; printerSelectButton . innerHTML = 'Select' ; printerSelectSection . appendChild ( printerSelectButton ) ; document . getElementById ( this . parentId ) . appendChild ( printerSelectSection ) ; await new Promise ( r => printerSelectButton . addEventListener ( 'click' , r , { once : true } ) ) ; let selectedPrinterName = printerSelectField . options [ printerSelectField . selectedIndex ] . text ; let selectedPrinterPath = printerSelectField . value ; printerSelectField . remove ( ) ; printerSelectButton . remove ( ) ; let printerSelectName = document . createElement ( 'span' ) ; printerSelectName . id = this . id + 'Name' ; printerSelectName . innerHTML = selectedPrinterName ; printerSelectSection . appendChild ( printerSelectName ) ; return this . dir + selectedPrinterPath ; }
The method generates the interface for a user to select what printer they want to configure
The method generates the interface for a user to select what printer they want to configure
// wait for the user to choose and lock stuff down