第 9 課結束之後所完成之 MainHandler.egl 的程式碼

下列程式碼是第 9 課結束之後 MainHandler.egl 檔的文字,此課程還對 CalculationResultsHandler.egl 檔做了細微但非常重要的變更。
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{};

   calculatorPortlet Portlet{children =[calculatorHandler.ui ], title = "Calculator"};
   resultsPortlet Portlet{children =[resultsHandler.ui ],
      title = "Results", canMove = true, canMinimize = true};
   historyPortlet Portlet{children = [historyHandler.historyResults_ui],
      title = "History", canMove = TRUE, canMinimize = TRUE};                         

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

      // Subscribe to calculation events 
      InfoBus.subscribe("mortgageApplication.mortgageCalculated", restorePortlets);

      // Initial state is minimized
      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

意見