]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - internal/parts/ChooseNameDialog.java
2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.eclipse
.ui
.workbench
.jcr
.internal
.parts
;
18 import org
.eclipse
.jface
.dialogs
.IMessageProvider
;
19 import org
.eclipse
.jface
.dialogs
.TitleAreaDialog
;
20 import org
.eclipse
.swt
.SWT
;
21 import org
.eclipse
.swt
.graphics
.Point
;
22 import org
.eclipse
.swt
.layout
.GridData
;
23 import org
.eclipse
.swt
.layout
.GridLayout
;
24 import org
.eclipse
.swt
.widgets
.Composite
;
25 import org
.eclipse
.swt
.widgets
.Control
;
26 import org
.eclipse
.swt
.widgets
.Label
;
27 import org
.eclipse
.swt
.widgets
.Shell
;
28 import org
.eclipse
.swt
.widgets
.Text
;
30 /** Dialog to change the current user password */
31 public class ChooseNameDialog
extends TitleAreaDialog
{
32 private static final long serialVersionUID
= 280139710002698692L;
35 public ChooseNameDialog(Shell parentShell
) {
37 setTitle("Choose name");
40 protected Point
getInitialSize() {
41 return new Point(300, 250);
44 protected Control
createDialogArea(Composite parent
) {
45 Composite dialogarea
= (Composite
) super.createDialogArea(parent
);
46 dialogarea
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, true));
47 Composite composite
= new Composite(dialogarea
, SWT
.NONE
);
48 composite
.setLayout(new GridLayout(2, false));
49 composite
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false));
50 nameTxt
= createLT(composite
, "Name");
52 setMessage("Choose name", IMessageProvider
.INFORMATION
);
57 /** Creates label and text. */
58 protected Text
createLT(Composite parent
, String label
) {
59 new Label(parent
, SWT
.NONE
).setText(label
);
60 Text text
= new Text(parent
, SWT
.SINGLE
| SWT
.LEAD
| SWT
.BORDER
);
61 text
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false));
65 public String
getName() {
66 return nameTxt
.getText();