View | Details | Raw Unified | Return to bug 227293 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/equinox/internal/security/ui/storage/ChallengeResponseDialog.java (-8 / +9 lines)
Lines 60-84 Link Here
60
	}
60
	}
61
61
62
	protected Control createDialogArea(Composite parent) {
62
	protected Control createDialogArea(Composite parent) {
63
		Composite composite = (Composite) super.createDialogArea(parent);
63
		setTitle(SecUIMessages.passwordRecoveryTitleMsg);
64
		Composite compositeTop = (Composite) super.createDialogArea(parent);
65
66
		Composite composite = new Composite(compositeTop, SWT.NONE);
64
67
65
		setMessage(SecUIMessages.passwordMsg, IMessageProvider.INFORMATION);
68
		setMessage(SecUIMessages.passwordMsg, IMessageProvider.INFORMATION);
66
69
67
		Label storyLabel = new Label(composite, SWT.LEFT);
70
		Label storyLabel = new Label(composite, SWT.LEFT);
68
		storyLabel.setText(SecUIMessages.passwordRecoveryLabel);
71
		storyLabel.setText(SecUIMessages.passwordRecoveryLabel);
69
		GridData storyData = new GridData(GridData.FILL, GridData.BEGINNING, true, false);
72
		storyLabel.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
70
		storyData.horizontalIndent = 10;
71
		storyLabel.setLayoutData(storyData);
72
73
73
		for (int i = 0; i < size; i++) {
74
		for (int i = 0; i < size; i++) {
74
			Group group = new Group(composite, SWT.NONE);
75
			Group group = new Group(composite, SWT.NONE);
75
			group.setText(NLS.bind(SecUIMessages.passwordGroup, Integer.toString(i + 1)));
76
			group.setText(NLS.bind(SecUIMessages.passwordGroup, Integer.toString(i + 1)));
76
			group.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
77
			group.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
77
			group.setLayout(new GridLayout());
78
			group.setLayout(new GridLayout(2, false));
78
79
79
			new Label(group, SWT.LEFT).setText(SecUIMessages.passwordQuestion);
80
			new Label(group, SWT.LEFT).setText(SecUIMessages.passwordQuestion);
80
			questions[i] = new Text(group, SWT.LEFT | SWT.BORDER);
81
			questions[i] = new Text(group, SWT.LEFT | SWT.BORDER);
81
			questions[i].setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
82
			questions[i].setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
82
			questions[i].addModifyListener(new ModifyListener() {
83
			questions[i].addModifyListener(new ModifyListener() {
83
				public void modifyText(ModifyEvent event) {
84
				public void modifyText(ModifyEvent event) {
84
					validateOK();
85
					validateOK();
Lines 87-93 Link Here
87
88
88
			new Label(group, SWT.LEFT).setText(SecUIMessages.passwordAnswer);
89
			new Label(group, SWT.LEFT).setText(SecUIMessages.passwordAnswer);
89
			answers[i] = new Text(group, SWT.LEFT | SWT.BORDER);
90
			answers[i] = new Text(group, SWT.LEFT | SWT.BORDER);
90
			answers[i].setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
91
			answers[i].setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
91
			answers[i].addModifyListener(new ModifyListener() {
92
			answers[i].addModifyListener(new ModifyListener() {
92
				public void modifyText(ModifyEvent event) {
93
				public void modifyText(ModifyEvent event) {
93
					validateOK();
94
					validateOK();
(-)src/org/eclipse/equinox/internal/security/ui/storage/StorageLoginDialog.java (-14 / +38 lines)
Lines 24-35 Link Here
24
import org.eclipse.swt.events.*;
24
import org.eclipse.swt.events.*;
25
import org.eclipse.swt.graphics.Image;
25
import org.eclipse.swt.graphics.Image;
26
import org.eclipse.swt.layout.GridData;
26
import org.eclipse.swt.layout.GridData;
27
import org.eclipse.swt.layout.GridLayout;
27
import org.eclipse.swt.widgets.*;
28
import org.eclipse.swt.widgets.*;
28
import org.eclipse.ui.PlatformUI;
29
import org.eclipse.ui.PlatformUI;
29
30
30
public class StorageLoginDialog extends TitleAreaDialog {
31
public class StorageLoginDialog extends TitleAreaDialog {
31
32
32
	private static final String DIALOG_SETTINGS_SECTION = "StorageLoginDialog"; //$NON-NLS-1$
33
	private static final String DIALOG_SETTINGS_SECTION_NEW = "StorageLoginDialogNew"; //$NON-NLS-1$
34
	private static final String DIALOG_SETTINGS_SECTION_OLD = "StorageLoginDialogOld"; //$NON-NLS-1$
35
33
	private static final String HELP_ID = Activator.PLUGIN_ID + ".StorageLoginDialog"; //$NON-NLS-1$
36
	private static final String HELP_ID = Activator.PLUGIN_ID + ".StorageLoginDialog"; //$NON-NLS-1$
34
37
35
	private static final ImageDescriptor dlgImageDescriptor = ImageDescriptor.createFromFile(StorageLoginDialog.class, "/icons/storage/login_wiz.png"); //$NON-NLS-1$
38
	private static final ImageDescriptor dlgImageDescriptor = ImageDescriptor.createFromFile(StorageLoginDialog.class, "/icons/storage/login_wiz.png"); //$NON-NLS-1$
Lines 69-77 Link Here
69
72
70
	protected IDialogSettings getDialogBoundsSettings() {
73
	protected IDialogSettings getDialogBoundsSettings() {
71
		IDialogSettings settings = Activator.getDefault().getDialogSettings();
74
		IDialogSettings settings = Activator.getDefault().getDialogSettings();
72
		IDialogSettings section = settings.getSection(DIALOG_SETTINGS_SECTION);
75
		String settingsID = (confirmPassword) ? DIALOG_SETTINGS_SECTION_NEW : DIALOG_SETTINGS_SECTION_OLD;
76
		IDialogSettings section = settings.getSection(settingsID);
73
		if (section == null)
77
		if (section == null)
74
			section = settings.addNewSection(DIALOG_SETTINGS_SECTION);
78
			section = settings.addNewSection(settingsID);
75
		return section;
79
		return section;
76
	}
80
	}
77
81
Lines 81-104 Link Here
81
85
82
	protected void configureShell(Shell shell) {
86
	protected void configureShell(Shell shell) {
83
		super.configureShell(shell);
87
		super.configureShell(shell);
84
		if (location == null)
88
		shell.setText(SecUIMessages.generalDialogTitle);
85
			shell.setText(passwordChange ? SecUIMessages.passwordChangeTitle : SecUIMessages.dialogTitle);
86
		else
87
			shell.setText(location);
88
89
		PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, HELP_ID);
89
		PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, HELP_ID);
90
	}
90
	}
91
91
92
	protected Control createContents(Composite parent) {
92
	protected Control createContents(Composite parent) {
93
		Control contents = super.createContents(parent);
93
		Control contents = super.createContents(parent);
94
		setMessage(passwordChange ? SecUIMessages.messageLoginChange : SecUIMessages.messageLogin);
95
		dlgTitleImage = dlgImageDescriptor.createImage();
94
		dlgTitleImage = dlgImageDescriptor.createImage();
96
		setTitleImage(dlgTitleImage);
95
		setTitleImage(dlgTitleImage);
97
		return contents;
96
		return contents;
98
	}
97
	}
99
98
100
	protected Control createDialogArea(Composite parent) {
99
	protected Control createDialogArea(Composite parent) {
101
		Composite composite = (Composite) super.createDialogArea(parent);
100
		Composite compositeTop = (Composite) super.createDialogArea(parent);
101
102
		String titleMsg;
103
		if (confirmPassword)
104
			titleMsg = SecUIMessages.passwordChangeTitle;
105
		else if (passwordChange)
106
			titleMsg = SecUIMessages.messageLoginChange;
107
		else
108
			titleMsg = SecUIMessages.dialogTitle;
109
		setTitle(titleMsg);
110
111
		Composite composite = new Composite(compositeTop, SWT.NONE);
102
112
103
		new Label(composite, SWT.LEFT).setText(SecUIMessages.labelPassword);
113
		new Label(composite, SWT.LEFT).setText(SecUIMessages.labelPassword);
104
		password = new Text(composite, SWT.LEFT | SWT.BORDER);
114
		password = new Text(composite, SWT.LEFT | SWT.BORDER);
Lines 119-125 Link Here
119
		} else
129
		} else
120
			confirm = null;
130
			confirm = null;
121
131
122
		showPassword = new Button(composite, SWT.CHECK);
132
		new Label(composite, SWT.LEFT); // filler
133
		showPassword = new Button(composite, SWT.CHECK | SWT.RIGHT);
123
		showPassword.setText(SecUIMessages.showPassword);
134
		showPassword.setText(SecUIMessages.showPassword);
124
		showPassword.addSelectionListener(new SelectionListener() {
135
		showPassword.addSelectionListener(new SelectionListener() {
125
			public void widgetSelected(SelectionEvent e) {
136
			public void widgetSelected(SelectionEvent e) {
Lines 130-144 Link Here
130
				passwordVisibility();
141
				passwordVisibility();
131
			}
142
			}
132
		});
143
		});
144
		showPassword.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
133
145
134
		// by default don't display password as clear text
146
		// by default don't display password as clear text
135
		showPassword.setSelection(false);
147
		showPassword.setSelection(false);
136
		passwordVisibility();
148
		passwordVisibility();
137
149
150
		if (location != null) {
151
			Group locationGroup = new Group(composite, SWT.NONE);
152
			locationGroup.setText(SecUIMessages.locationGroup);
153
			GridData groupData = new GridData(SWT.FILL, SWT.FILL, true, true);
154
			groupData.horizontalSpan = 2;
155
			locationGroup.setLayoutData(groupData);
156
			locationGroup.setLayout(new GridLayout());
157
158
			Label locationLabel = new Label(locationGroup, SWT.WRAP);
159
			locationLabel.setText(location);
160
		}
161
138
		composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
162
		composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
139
		GridLayoutFactory.swtDefaults().generateLayout(composite);
163
		GridLayoutFactory.swtDefaults().numColumns(2).generateLayout(composite);
140
164
141
		return composite;
165
		return compositeTop;
142
	}
166
	}
143
167
144
	protected void passwordVisibility() {
168
	protected void passwordVisibility() {
Lines 167-173 Link Here
167
				return false;
191
				return false;
168
			}
192
			}
169
		}
193
		}
170
		setMessage(passwordChange ? SecUIMessages.messageLoginChange : SecUIMessages.messageLogin, IMessageProvider.NONE);
194
		setMessage("", IMessageProvider.NONE); //$NON-NLS-1$
171
		return true;
195
		return true;
172
	}
196
	}
173
197
(-)src/org/eclipse/equinox/internal/security/ui/nls/SecUIMessages.java (+2 lines)
Lines 38-43 Link Here
38
	public static String passwordChangeTitle;
38
	public static String passwordChangeTitle;
39
	public static String showPassword;
39
	public static String showPassword;
40
	public static String noDigestPassword;
40
	public static String noDigestPassword;
41
	public static String locationGroup;
41
42
42
	// exception handling
43
	// exception handling
43
	public static String exceptionTitle;
44
	public static String exceptionTitle;
Lines 144-149 Link Here
144
	public static String pswdRecoveryOptionTitle;
145
	public static String pswdRecoveryOptionTitle;
145
	public static String pswdRecoveryOptionMsg;
146
	public static String pswdRecoveryOptionMsg;
146
	public static String passwordRecoveryTitle;
147
	public static String passwordRecoveryTitle;
148
	public static String passwordRecoveryTitleMsg;
147
	public static String passwordMsg;
149
	public static String passwordMsg;
148
	public static String passwordRecoveryLabel;
150
	public static String passwordRecoveryLabel;
149
	public static String passwordErrMsg;
151
	public static String passwordErrMsg;
(-)src/org/eclipse/equinox/internal/security/ui/nls/messages.properties (-7 / +9 lines)
Lines 20-37 Link Here
20
generalDialogTitle = Secure Storage
20
generalDialogTitle = Secure Storage
21
21
22
## Login dialog
22
## Login dialog
23
messageLogin = Please enter the secure storage password
23
messageLogin = Please enter the secure storage password.
24
messageLoginChange = Password change: please enter the NEW secure storage password
24
messageLoginChange = Password change: please enter a NEW secure storage password.
25
messageEmptyPassword = Password can not be empty
25
messageEmptyPassword = Password can not be empty
26
messageNoMatch = Password and confirmation characters did not match
26
messageNoMatch = Password and confirmation characters did not match
27
labelPassword = &Password:
27
labelPassword = &Password:
28
labelConfirm = &Confirm password:
28
labelConfirm = &Confirm password:
29
buttonLogin = Login
29
buttonLogin = Login
30
buttonExit = Exit
30
buttonExit = Cancel
31
dialogTitle = Secure storage login
31
dialogTitle = Please enter the secure storage password.
32
passwordChangeTitle = Enter new password for the secure storage
32
passwordChangeTitle = Please enter a new password for the secure storage.
33
showPassword = &Show password
33
showPassword = &Show password
34
noDigestPassword = The message digest algorithm \"{0}\" is not available.
34
noDigestPassword = The message digest algorithm \"{0}\" is not available.
35
locationGroup = Storage location
35
36
36
## exception handling
37
## exception handling
37
exceptionTitle = Secure storage
38
exceptionTitle = Secure storage
Lines 138-147 Link Here
138
pswdRecoveryOptionTitle = Secure Storage
139
pswdRecoveryOptionTitle = Secure Storage
139
pswdRecoveryOptionMsg = New password has been created. Would you like to enable password recovery?   
140
pswdRecoveryOptionMsg = New password has been created. Would you like to enable password recovery?   
140
passwordRecoveryTitle = Password Recovery
141
passwordRecoveryTitle = Password Recovery
142
passwordRecoveryTitleMsg = Please enter Question/Answer pairs.
141
passwordMsg = Lost passwords can be recovered using \"Recover\" option on the Secure Storage preferences page. 
143
passwordMsg = Lost passwords can be recovered using \"Recover\" option on the Secure Storage preferences page. 
142
passwordRecoveryLabel = To be able to recover lost password in future, enter questions and answers below.\nAnswers are case-sensitive; treat answers as secondary passwords.\n  
144
passwordRecoveryLabel = To be able to recover lost password in future, enter questions and answers below.\nAnswers are case-sensitive; treat answers as secondary passwords.\n
143
passwordErrMsg = Questions and answers can not be empty.
145
passwordErrMsg = Questions and answers can not be empty.
144
passwordGroup = Part {0}
146
passwordGroup = Question {0}
145
passwordQuestion = &Question:
147
passwordQuestion = &Question:
146
passwordAnswer = &Answer:
148
passwordAnswer = &Answer:
147
passwordButtonOK = OK
149
passwordButtonOK = OK
(-)META-INF/MANIFEST.MF (-1 / +2 lines)
Lines 22-32 Link Here
22
 org.eclipse.equinox.preferences;bundle-version="[3.2.200,4.0.0)",
22
 org.eclipse.equinox.preferences;bundle-version="[3.2.200,4.0.0)",
23
 org.eclipse.ui;bundle-version="[3.4.0,4.0.0)"
23
 org.eclipse.ui;bundle-version="[3.4.0,4.0.0)"
24
Bundle-Activator: org.eclipse.equinox.internal.security.ui.Activator
24
Bundle-Activator: org.eclipse.equinox.internal.security.ui.Activator
25
Export-Package: org.eclipse.equinox.internal.provisional.security.ui;version="1.0.0";x-internal:=true, 
25
Export-Package: org.eclipse.equinox.internal.provisional.security.ui;version="1.0.0";x-internal:=true,
26
 org.eclipse.equinox.internal.security.ui;x-internal:=true,
26
 org.eclipse.equinox.internal.security.ui;x-internal:=true,
27
 org.eclipse.equinox.internal.security.ui.nls;x-internal:=true,
27
 org.eclipse.equinox.internal.security.ui.nls;x-internal:=true,
28
 org.eclipse.equinox.internal.security.ui.preferences;x-internal:=true,
28
 org.eclipse.equinox.internal.security.ui.preferences;x-internal:=true,
29
 org.eclipse.equinox.internal.security.ui.storage;x-internal:=true,
29
 org.eclipse.equinox.internal.security.ui.storage;x-internal:=true,
30
 org.eclipse.equinox.internal.security.ui.storage.view;x-internal:=true,
30
 org.eclipse.equinox.internal.security.ui.wizard;x-internal:=true
31
 org.eclipse.equinox.internal.security.ui.wizard;x-internal:=true
31
Bundle-RequiredExecutionEnvironment: J2SE-1.4
32
Bundle-RequiredExecutionEnvironment: J2SE-1.4
32
Bundle-ActivationPolicy: lazy
33
Bundle-ActivationPolicy: lazy

Return to bug 227293