package e4s.tutorial; import e4s.application.CountryCode; import e4s.application.CountryCode.COUNTRY; import e4s.html.*; import e4s.servlet.E4ModuleImplementation; /** * Usage of Language-Codes. * * {@tutorial Example_CountryCode} * * @see e4s.application.Language */ public class Example_CountryCode extends E4ModuleImplementation { public static E4Method start = null; public void start( HTML html ) { BODY body = html.BODY(); body.Message(E4Message.CAPTION,"Country-Codes"); body.P(); TABLE table = body.TABLE(TABLE.E4S_DEFAULT_TABLE()); COUNTRY[] countries = CountryCode.getCountries(); for( int i = 0; i < countries.length; i++ ) { TR tr = table.TR(); tr.TD().print(countries[i].getCodeA2()); tr.TD().print(countries[i].getCodeA3()); tr.TD().print(countries[i].getName()); if (countries[i].getFlag() != null) tr.TD().IMG(countries[i].getFlag()); else tr.TD().NBSP(); } } }