]>
git.argeo.org Git - gpl/argeo-suite.git/blob - org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java
1 package org
.argeo
.app
.ui
.dialogs
;
3 import org
.argeo
.app
.ui
.SuiteMsg
;
4 import org
.argeo
.app
.ui
.SuiteUiUtils
;
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
;
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
;
20 protected NewPersonPage(String pageName
) {
22 setTitle(SuiteMsg
.personWizardPageTitle
.lead());
26 public void createControl(Composite parent
) {
27 parent
.setLayout(new GridLayout(2, false));
30 SuiteUiUtils
.createBoldLabel(parent
, SuiteMsg
.firstName
);
31 firstNameTxt
= new Text(parent
, SWT
.BORDER
);
32 firstNameTxt
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, true, false));
35 SuiteUiUtils
.createBoldLabel(parent
, SuiteMsg
.lastName
);
36 lastNameTxt
= new Text(parent
, SWT
.BORDER
);
37 lastNameTxt
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, true, false));
39 SuiteUiUtils
.createBoldLabel(parent
, SuiteMsg
.email
);
40 emailTxt
= new Text(parent
, SWT
.BORDER
);
41 emailTxt
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, true, false));
43 ModifyListener ml
= new ModifyListener() {
44 private static final long serialVersionUID
= -1628130380128946886L;
47 public void modifyText(ModifyEvent event
) {
48 getContainer().updateButtons();
52 firstNameTxt
.addModifyListener(ml
);
53 lastNameTxt
.addModifyListener(ml
);
54 emailTxt
.addModifyListener(ml
);
57 setControl(firstNameTxt
);
58 firstNameTxt
.setFocus();
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);