]> git.argeo.org Git - gpl/argeo-suite.git/blob - NewPersonPage.java
54c94f8abf538be0c5586944ee4c4c153b621021
[gpl/argeo-suite.git] / NewPersonPage.java
1 package org.argeo.app.ui.dialogs;
2
3 import org.argeo.app.ui.SuiteUiUtils;
4 import org.argeo.app.ux.SuiteMsg;
5 import org.eclipse.jface.wizard.WizardPage;
6 import org.eclipse.swt.SWT;
7 import org.eclipse.swt.events.ModifyEvent;
8 import org.eclipse.swt.events.ModifyListener;
9 import org.eclipse.swt.layout.GridData;
10 import org.eclipse.swt.layout.GridLayout;
11 import org.eclipse.swt.widgets.Composite;
12 import org.eclipse.swt.widgets.Text;
13
14 public class NewPersonPage extends WizardPage {
15 private static final long serialVersionUID = -944349994177526468L;
16 protected Text lastNameTxt;
17 protected Text firstNameTxt;
18 protected Text emailTxt;
19
20 protected NewPersonPage(String pageName) {
21 super(pageName);
22 setTitle(SuiteMsg.personWizardPageTitle.lead());
23 }
24
25 @Override
26 public void createControl(Composite parent) {
27 parent.setLayout(new GridLayout(2, false));
28
29 // FirstName
30 SuiteUiUtils.createBoldLabel(parent, SuiteMsg.firstName);
31 firstNameTxt = new Text(parent, SWT.BORDER);
32 firstNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
33
34 // LastName
35 SuiteUiUtils.createBoldLabel(parent, SuiteMsg.lastName);
36 lastNameTxt = new Text(parent, SWT.BORDER);
37 lastNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
38
39 SuiteUiUtils.createBoldLabel(parent, SuiteMsg.email);
40 emailTxt = new Text(parent, SWT.BORDER);
41 emailTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
42
43 ModifyListener ml = new ModifyListener() {
44 private static final long serialVersionUID = -1628130380128946886L;
45
46 @Override
47 public void modifyText(ModifyEvent event) {
48 getContainer().updateButtons();
49 }
50 };
51
52 firstNameTxt.addModifyListener(ml);
53 lastNameTxt.addModifyListener(ml);
54 emailTxt.addModifyListener(ml);
55
56 // Don't forget this.
57 setControl(firstNameTxt);
58 firstNameTxt.setFocus();
59
60 }
61
62 // public void updateNode(Node node, PeopleService peopleService, ResourcesService resourcesService) {
63 // ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_LAST_NAME, PropertyType.STRING, lastNameTxt.getText());
64 // ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_FIRST_NAME, PropertyType.STRING,
65 // firstNameTxt.getText());
66 // ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_DISPLAY_NAME, PropertyType.STRING,
67 // firstNameTxt.getText() + " " + lastNameTxt.getText());
68 // String email = emailTxt.getText();
69 // ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_PRIMARY_EMAIL, PropertyType.STRING, email);
70 // PeopleJcrUtils.createEmail(resourcesService, peopleService, node, email, true, null, null);
71 // }
72 }