@Override protected GUIContainerComponent getDynamicContents(IElement el) { GUIPanelComponent rootPanel = GUIPanelComponent.createFlow(null); rootPanel.setStyle("person_details"); Person p = (Person) el; if (p == null) { GUILabelComponent.create(rootPanel, "No Persons selected."); return rootPanel; } GUIPanelComponent table = GUIPanelComponent.createTable(rootPanel); int row = 0; if (p instanceof BankAdviser) { GUILabelComponent.create(table, "Bank: ", row, 0); GUILabelComponent.create(table, Text.stringValue(((BankAdviser) p).bank), row++, 1); } GUILabelComponent.create(table, "Name: ", row, 0); GUILabelComponent.create(table, Text.stringValue(p.name), row++, 1); GUILabelComponent.create(table, "Is married? ", row, 0); GUILabelComponent.create(table, p.isMarried.val().toBoolean() ? "YES" : "NO", row++, 1); if (Gender.MALE.equals(p.gender.val())) { GUILabelComponent.create(table, "Age: ", row, 0); GUILabelComponent.create(table, p.age.val().toString(), row++, 1); table.setStyle("male"); } else { table.setStyle("female"); } return rootPanel; }