在第 7 课之后已为 MainHandler.egl 完成的代码

以下代码是完成第 7 课之后 MainHandler.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{};
	
   calculatorPortlet Portlet
      {children = [calculatorHandler.ui], title = "Calculator"};
   resultsPortlet Portlet{children = [resultsHandler.ui],
      title = "Results", canMove = TRUE, canMinimize = TRUE};
	
   function start()
      mortgagePortal.addPortlet(calculatorPortlet, 1);
      mortgagePortal.addPortlet(resultsPortlet, 1);

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

      // Initial state is minimized
      resultsPortlet.minimize();
   end
	
   function restorePortlets(eventName STRING in, dataObject ANY in)
		   if(resultsPortlet.isMinimized())
         resultsPortlet.restore();
      end
   end
end

反馈