Codice terminato per MainHandler.egl dopo la Lezione 12

Il codice riportato di seguito è il testo del file MainHandler.egl al termine della Lezione 12.
package handlers;

import com.ibm.egl.rui.infobus.InfoBus;
import utils.portal.Portal;
import utils.portal.Portlet;

handler MainHandler type RUIhandler{initialUI =[mortgagePortal ],
   onConstructionFunction = start, 
   cssFile = "css/MortgageUIProject.css", 
   title = "MainHandler"}

   mortgagePortal Portal{columns = 2, columnWidths =[350, 650]};

   calculatorHandler MortgageCalculatorHandler{};
   resultsHandler CalculationResultsHandler{};
   historyHandler CalculationHistoryHandler{};
   mapHandler MapLocatorHandler{};

   calculatorPortlet Portlet{children =[calculatorHandler.ui ], 
                             title = "Calcolatore"};

   resultsPortlet Portlet{children =[resultsHandler.ui ],
      title = "Risultati", canMove = true, canMinimize = true};
   historyPortlet Portlet{children = [historyHandler.historyResults_ui],
      title = "Cronologia", canMove = TRUE, canMinimize = TRUE};
   mapPortlet Portlet{children = [mapHandler.ui],
      title = "Mappa", canMove = FALSE, canMinimize = TRUE};

   function start()
      mortgagePortal.addPortlet(calculatorPortlet, 1);
      mortgagePortal.addPortlet(resultsPortlet, 1);
      mortgagePortal.addPortlet(historyPortlet, 1);
      mortgagePortal.addPortlet(mapPortlet, 2);

      // Esegue la sottoscrizione agli eventi di calcolo
      InfoBus.subscribe("mortgageApplication.mortgageCalculated",
               restorePortlets);

      // Lo stato iniziale è ridotto a icona
      resultsPortlet.minimize();
      historyPortlet.minimize();
   end

   function restorePortlets(eventName string in, dataObject any in)
      if(resultsPortlet.isMinimized())
         resultsPortlet.restore();
      end
      if(historyPortlet.isMinimized())
         historyPortlet.restore();
      end
   end
end

Feedback