1 6 package com.nightlabs.ipanema.person; 7 8 14 22 public class SelectionPersonDataField extends AbstractPersonDataField { 23 24 25 28 public SelectionPersonDataField() { 29 super(); 30 } 31 35 public SelectionPersonDataField(PersonDataBlock _personDataBlock, 36 AbstractPersonStructField _personStructField) { 37 super(_personDataBlock, _personStructField); 38 } 39 42 protected PersonStructFieldValue selection = null; 43 44 public void setSelection(PersonStructFieldValue value) { 45 selection = value; 46 } 47 48 public PersonStructFieldValue getSelection() { 49 return selection; 50 } 51 52 58 public SelectionPersonStructField getSelectionStructField(PersonStruct structure) 59 throws ClassCastException 60 { 61 IllegalStateException ill = null; 62 AbstractPersonStructField field = null; 63 try { 64 field = structure.getPersonStructField( 65 getPersonStructBlockOrganisationID(), 66 getPersonStructBlockID(), 67 getPersonStructFieldOrganisationID(), 68 getPersonStructFieldID() 69 ); 70 } catch (Exception e) { 71 ill = new IllegalStateException ("Caught exception while accessing PersonStructFactory"); 72 ill.initCause(e); 73 } 74 if (ill != null) 75 throw ill; 76 return (SelectionPersonStructField)field; 77 } 78 81 public boolean isEmpty() { 82 return getSelection() == null; 83 } 84 87 public String localizedToString(String languageID) { 88 return getSelection().getValueName().getText(languageID); 89 } 90 91 } 92 | Popular Tags |