演習 12 終了後の MainHandler.egl のコード

以下のコードは、演習 12 終了時の MainHandler.egl ファイルのテキストです。

package handlers;

import com.ibm.egl.rui.infobus.InfoBus;
import egl.ui.columns;
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{};
	
    historyPortlet Portlet{children =[historyHandler.historyResults_ui
            ], title = "History", canMove = true, canMinimize = true};
    calculatorPortlet Portlet{children =[calculatorHandler.ui
            ], title = "Calculator"};
    resultsPortlet Portlet{children =[resultsHandler.ui
            ], title = "Results", canMove = true, canMinimize = true};
	mapPortlet Portlet{children = [mapHandler.ui], 
			title = "Map", canMove = FALSE, canMinimize = TRUE};
			
    function start()
        mortgagePortal.addPortlet(calculatorPortlet, 1);
        mortgagePortal.addPortlet(resultsPortlet, 1);
        mortgagePortal.addPortlet(historyPortlet, 1);
		mortgagePortal.addPortlet(mapPortlet, 2);
		
        historyPortlet.minimize();

        // 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
        if(historyPortlet.isMinimized())
            historyPortlet.restore();
        end
    end
end

フィードバック