1 package net.suberic.pooka.gui.propedit; 2 import net.suberic.pooka.*; 3 import net.suberic.util.*; 4 import net.suberic.util.gui.*; 5 import net.suberic.util.gui.propedit.*; 6 import javax.swing.*; 7 import java.awt.event.*; 8 import java.awt.Cursor ; 9 import java.util.Properties ; 10 11 14 public class AddressEntryEditor extends CompositeEditorPane { 15 AddressBookEntry entry; 16 17 21 public AddressEntryEditor(PropertyEditorManager newManager, AddressBookEntry newEntry) { 22 entry = newEntry; 23 24 Properties props = entry.getProperties(); 25 VariableBundle wrappedBundle = new VariableBundle(props, newManager.getFactory().getSourceBundle()); 26 PropertyEditorManager wrappedManager = new PropertyEditorManager(wrappedBundle, newManager.getFactory(), newManager.getIconManager()); 27 configureEditor("currentAddress", "currentAddress", wrappedManager); 28 } 29 30 33 public void setValue() throws PropertyValueVetoException { 34 if (isEditorEnabled()) { 35 for (int i = 0; i < editors.size(); i++) { 36 ((SwingPropertyEditor)(editors.get(i))).setValue(); 37 } 38 } 39 40 try { 41 entry.setAddresses(javax.mail.internet.InternetAddress.parse(manager.getProperty("currentAddress.address", ""))); 42 } catch (javax.mail.internet.AddressException ae) { 43 ae.printStackTrace(); 44 45 } 46 entry.setPersonalName(manager.getProperty("currentAddress.personalName", "")); 47 entry.setFirstName(manager.getProperty("currentAddress.firstName", "")); 48 entry.setLastName(manager.getProperty("currentAddress.lastName", "")); 49 } 50 51 } 52 | Popular Tags |