BrightSide Workbench Full Report + Source Code
org.turro.contacts.zul.control.ContactForm Class Reference
Inheritance diagram for org.turro.contacts.zul.control.ContactForm:
Collaboration diagram for org.turro.contacts.zul.control.ContactForm:

Public Member Functions

void setFields (ContactFieldList fields)
 
void setContact (Contact contact)
 
Contact getContact ()
 
void afterCompose ()
 
- Public Member Functions inherited from org.turro.zkoss.layout.GridLayout
 GridLayout ()
 
 GridLayout (int columns)
 
 GridLayout (String hflexs)
 
void setColumns (int columns)
 
void setColumns (String hflexs)
 
void setColCaptions (String captions)
 
void setColCaptions (String[] captions)
 
void clearRows ()
 
GridLayout addGroup (String title, boolean open)
 
GridLayout addRow ()
 
GridLayout insertBeforeRow (Row row)
 
GridLayout addCaption (String label)
 
GridLayout addValue (String value)
 
GridLayout addBoldValue (String value)
 
GridLayout addComponent (HtmlBasedComponent comp)
 
GridLayout addSpannedComponent (HtmlBasedComponent comp, int cols)
 
GridLayout addRowSpannedComponent (HtmlBasedComponent comp, int rows)
 
GridLayout addSpace ()
 
Row getCurrentRow ()
 
Rows getRows (boolean create)
 
Object getData ()
 
void setData (Object data)
 

Static Public Member Functions

static void newContact (ContactFieldList fields, final Command command)
 
static void editContact (ContactFieldList fields, Contact contact, final Command command)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.zkoss.layout.GridLayout
Row currentRow
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 57 of file ContactForm.java.

Member Function Documentation

◆ afterCompose()

void org.turro.contacts.zul.control.ContactForm.afterCompose ( )

Definition at line 145 of file ContactForm.java.

145  {
146  try {
147  getChildren().clear();
148  setHflex("true");
149  setColumns("min,1,min");
150  Properties properties = new Properties();
151  properties.load(FileUtil.getBufferedFile(
152  new File(ElephantContext.getRealPath("/WEB-INF/elephant/conf/vCard.properties"))));
153  addFields(properties);
154  } catch (IOException ex) {
155  Logger.getLogger(ContactForm.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
156  }
157  }
Here is the call graph for this function:

◆ editContact()

static void org.turro.contacts.zul.control.ContactForm.editContact ( ContactFieldList  fields,
Contact  contact,
final Command  command 
)
static

Definition at line 97 of file ContactForm.java.

97  {
98  final ContactForm cf = new ContactForm();
99  if(fields.isEmpty()) {
100  fields.createMinimumContact();
101  }
102  cf.setFields(fields);
103  cf.setContact(contact);
104  SelectionDialog.getComponent(Framework.getCurrent().getPage(),
105  I_.get("Contact"),
106  cf, "500px", "600px", new Command() {
107  @Override
108  public Object execute(Context context) {
109  if(cf != null) {
110  final Contact contact = cf.getContact();
111  if(!contact.isEmpty()) {
112  ContactWrapper.saveAnyway(contact, new Command() {
113  @Override
114  public Object execute(Context context) {
115  Contact newc = new ContactWrapper(contact).save();
116  if(context == null) {
117  context = new Context();
118  }
119  context.put("contact", newc);
120  if(command != null) command.execute(context);
121  return null;
122  }
123  });
124  }
125  }
126  return null;
127  }
128  });
129  }
Here is the call graph for this function:

◆ getContact()

Contact org.turro.contacts.zul.control.ContactForm.getContact ( )

Definition at line 139 of file ContactForm.java.

139  {
140  assignFields();
141  return contact;
142  }
Here is the caller graph for this function:

◆ newContact()

static void org.turro.contacts.zul.control.ContactForm.newContact ( ContactFieldList  fields,
final Command  command 
)
static

Definition at line 62 of file ContactForm.java.

62  {
63  final ContactForm cf = new ContactForm();
64  if(fields.isEmpty()) {
65  fields.createMinimumContact();
66  }
67  cf.setFields(fields);
68  cf.setContact(new Contact());
69  SelectionDialog.getComponent(Framework.getCurrent().getPage(),
70  I_.get("New contact"),
71  cf, "500px", "600px", new Command() {
72 
73  @Override
74  public Object execute(Context context) {
75  if(cf != null) {
76  final Contact contact = cf.getContact();
77  if(!contact.isEmpty()) {
78  ContactWrapper.saveAnyway(contact, new Command() {
79  @Override
80  public Object execute(Context context) {
81  Contact newc = new ContactWrapper(contact).save();
82  if(context == null) {
83  context = new Context();
84  }
85  context.put("contact", newc);
86  if(command != null) command.execute(context);
87  return null;
88  }
89  });
90  }
91  }
92  return null;
93  }
94  });
95  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setContact()

void org.turro.contacts.zul.control.ContactForm.setContact ( Contact  contact)

Definition at line 135 of file ContactForm.java.

135  {
136  this.contact = contact;
137  }
Here is the caller graph for this function:

◆ setFields()

void org.turro.contacts.zul.control.ContactForm.setFields ( ContactFieldList  fields)

Definition at line 131 of file ContactForm.java.

131  {
132  this.fields = fields;
133  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: