1 4 package org.oddjob.designer.elements; 5 6 import org.oddjob.designer.elements.simple.SimpleTextAttribute; 7 import org.oddjob.designer.model.DesignDefinition; 8 import org.oddjob.designer.model.DesignElementAttribute; 9 import org.oddjob.designer.model.ElementField; 10 import org.oddjob.designer.model.FieldGroup; 11 12 15 public class ConnectionDE extends DesignElementAttribute { 16 17 private SimpleTextAttribute driver; 18 private SimpleTextAttribute url; 19 private SimpleTextAttribute username; 20 private SimpleTextAttribute password; 21 22 public ConnectionDE() { 23 setDriver(new SimpleTextAttribute()); 24 setUrl(new SimpleTextAttribute()); 25 setUsername(new SimpleTextAttribute()); 26 setPassword(new SimpleTextAttribute()); 27 } 28 29 public DesignDefinition detail() { 30 return new FieldGroup("Connection Details") 31 .add(new ElementField("Driver", driver)) 32 .add(new ElementField("Url", url)) 33 .add(new ElementField("Username", username)) 34 .add(new ElementField("Password", password)); 35 } 36 37 public SimpleTextAttribute getDriver() { 38 return driver; 39 } 40 41 public void setDriver(SimpleTextAttribute driver) { 42 driver.addObserver(detailObserver); 43 this.driver = driver; 44 } 45 46 public SimpleTextAttribute getUrl() { 47 return url; 48 } 49 50 public void setUrl(SimpleTextAttribute url) { 51 url.addObserver(detailObserver); 52 this.url = url; 53 } 54 55 public void clear() { 56 driver.clear(); 57 url.clear(); 58 username.clear(); 59 password.clear(); 60 super.clear(); 61 } 62 63 public SimpleTextAttribute getPassword() { 64 return password; 65 } 66 67 public void setPassword(SimpleTextAttribute password) { 68 this.password = password; 69 } 70 71 public SimpleTextAttribute getUsername() { 72 return username; 73 } 74 75 public void setUsername(SimpleTextAttribute username) { 76 this.username = username; 77 } 78 79 } 80 | Popular Tags |