]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/dialogs/ChooseNameDialog.java
1 package org
.argeo
.jcr
.ui
.explorer
.dialogs
;
3 import org
.eclipse
.jface
.dialogs
.IMessageProvider
;
4 import org
.eclipse
.jface
.dialogs
.TitleAreaDialog
;
5 import org
.eclipse
.swt
.SWT
;
6 import org
.eclipse
.swt
.graphics
.Point
;
7 import org
.eclipse
.swt
.layout
.GridData
;
8 import org
.eclipse
.swt
.layout
.GridLayout
;
9 import org
.eclipse
.swt
.widgets
.Composite
;
10 import org
.eclipse
.swt
.widgets
.Control
;
11 import org
.eclipse
.swt
.widgets
.Label
;
12 import org
.eclipse
.swt
.widgets
.Shell
;
13 import org
.eclipse
.swt
.widgets
.Text
;
15 /** Dialog to change the current user password */
16 public class ChooseNameDialog
extends TitleAreaDialog
{
19 public ChooseNameDialog(Shell parentShell
) {
21 setTitle("Choose name");
24 protected Point
getInitialSize() {
25 return new Point(300, 250);
28 protected Control
createDialogArea(Composite parent
) {
29 Composite dialogarea
= (Composite
) super.createDialogArea(parent
);
30 dialogarea
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, true));
31 Composite composite
= new Composite(dialogarea
, SWT
.NONE
);
32 composite
.setLayout(new GridLayout(2, false));
33 composite
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false));
34 nameT
= createLT(composite
, "Name");
36 setMessage("Choose name", IMessageProvider
.INFORMATION
);
41 /** Creates label and text. */
42 protected Text
createLT(Composite parent
, String label
) {
43 new Label(parent
, SWT
.NONE
).setText(label
);
44 Text text
= new Text(parent
, SWT
.SINGLE
| SWT
.LEAD
| SWT
.BORDER
);
45 text
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false));
49 public String
getName() {
50 return nameT
.getText();