|
Lines 24-29
Link Here
|
| 24 |
import org.eclipse.jface.preference.StringFieldEditor; |
24 |
import org.eclipse.jface.preference.StringFieldEditor; |
| 25 |
import org.eclipse.jface.wizard.WizardPage; |
25 |
import org.eclipse.jface.wizard.WizardPage; |
| 26 |
import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants; |
26 |
import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants; |
|
|
27 |
import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages; |
| 27 |
import org.eclipse.mylyn.monitor.core.StatusHandler; |
28 |
import org.eclipse.mylyn.monitor.core.StatusHandler; |
| 28 |
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; |
29 |
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; |
| 29 |
import org.eclipse.mylyn.tasks.core.TaskRepository; |
30 |
import org.eclipse.mylyn.tasks.core.TaskRepository; |
|
Lines 188-193
Link Here
|
| 188 |
|
189 |
|
| 189 |
private Hyperlink manageAccountHyperlink; |
190 |
private Hyperlink manageAccountHyperlink; |
| 190 |
|
191 |
|
|
|
192 |
private boolean onlyAuthenticationCredentials; |
| 193 |
|
| 194 |
protected Button savePasswordButton; |
| 195 |
|
| 196 |
protected Button saveHttpPasswordButton; |
| 197 |
|
| 198 |
protected Button saveProxyPasswordButton; |
| 199 |
|
| 200 |
private static AbstractRepositorySettingsPage single; |
| 201 |
|
| 191 |
public AbstractRepositorySettingsPage(String title, String description, AbstractRepositoryConnectorUi repositoryUi) { |
202 |
public AbstractRepositorySettingsPage(String title, String description, AbstractRepositoryConnectorUi repositoryUi) { |
| 192 |
super(title); |
203 |
super(title); |
| 193 |
super.setTitle(title); |
204 |
super.setTitle(title); |
|
Lines 202-207
Link Here
|
| 202 |
setNeedsProxy(true); |
213 |
setNeedsProxy(true); |
| 203 |
setNeedsValidation(true); |
214 |
setNeedsValidation(true); |
| 204 |
setNeedsAdvanced(true); |
215 |
setNeedsAdvanced(true); |
|
|
216 |
setOnlyAuthenticationCredentials(true); |
| 217 |
single = this; |
| 205 |
} |
218 |
} |
| 206 |
|
219 |
|
| 207 |
@Override |
220 |
@Override |
|
Lines 212-217
Link Here
|
| 212 |
toolkit.dispose(); |
225 |
toolkit.dispose(); |
| 213 |
} |
226 |
} |
| 214 |
} |
227 |
} |
|
|
228 |
single = null; |
| 215 |
} |
229 |
} |
| 216 |
|
230 |
|
| 217 |
public void createControl(Composite parent) { |
231 |
public void createControl(Composite parent) { |
|
Lines 254-259
Link Here
|
| 254 |
FillLayout layout = new FillLayout(); |
268 |
FillLayout layout = new FillLayout(); |
| 255 |
compositeContainer.setLayout(layout); |
269 |
compositeContainer.setLayout(layout); |
| 256 |
|
270 |
|
|
|
271 |
if (!onlyAuthenticationCredentials()) { |
| 272 |
Label infoLabel = new Label(compositeContainer, SWT.NONE); |
| 273 |
infoLabel.setImage(TasksUiImages.getImage(TasksUiImages.WARNING)); |
| 274 |
infoLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER)); |
| 275 |
infoLabel = new Label(compositeContainer, SWT.NONE); |
| 276 |
infoLabel.setText("\nIf you Cancel this Dialog this will disable the Repository!\n\n"); |
| 277 |
} |
| 278 |
|
| 257 |
new Label(compositeContainer, SWT.NONE).setText(LABEL_SERVER); |
279 |
new Label(compositeContainer, SWT.NONE).setText(LABEL_SERVER); |
| 258 |
serverUrlCombo = new Combo(compositeContainer, SWT.DROP_DOWN); |
280 |
serverUrlCombo = new Combo(compositeContainer, SWT.DROP_DOWN); |
| 259 |
serverUrlCombo.addModifyListener(new ModifyListener() { |
281 |
serverUrlCombo.addModifyListener(new ModifyListener() { |
|
Lines 304-309
Link Here
|
| 304 |
}; |
326 |
}; |
| 305 |
// repositoryLabelEditor.setErrorMessage("error"); |
327 |
// repositoryLabelEditor.setErrorMessage("error"); |
| 306 |
|
328 |
|
|
|
329 |
if (!onlyAuthenticationCredentials()) { |
| 330 |
serverUrlCombo.setEnabled(false); |
| 331 |
repositoryLabelEditor.setEnabled(false, compositeContainer); |
| 332 |
} |
| 333 |
|
| 307 |
if (needsAnonymousLogin()) { |
334 |
if (needsAnonymousLogin()) { |
| 308 |
anonymousButton = new Button(compositeContainer, SWT.CHECK); |
335 |
anonymousButton = new Button(compositeContainer, SWT.CHECK); |
| 309 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(anonymousButton); |
336 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(anonymousButton); |
|
Lines 354-359
Link Here
|
| 354 |
} |
381 |
} |
| 355 |
}; |
382 |
}; |
| 356 |
|
383 |
|
|
|
384 |
savePasswordButton = new Button(compositeContainer, SWT.CHECK); |
| 385 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(savePasswordButton); |
| 386 |
|
| 387 |
savePasswordButton.setText("Save Password"); |
| 388 |
savePasswordButton.addSelectionListener(new SelectionAdapter() { |
| 389 |
@Override |
| 390 |
public void widgetSelected(SelectionEvent e) { |
| 391 |
setSavePassword(savePasswordButton.getSelection()); |
| 392 |
isPageComplete(); |
| 393 |
} |
| 394 |
}); |
| 395 |
|
| 357 |
if (repository != null) { |
396 |
if (repository != null) { |
| 358 |
try { |
397 |
try { |
| 359 |
String repositoryLabel = repository.getProperty(IRepositoryConstants.PROPERTY_LABEL); |
398 |
String repositoryLabel = repository.getProperty(IRepositoryConstants.PROPERTY_LABEL); |
|
Lines 378-383
Link Here
|
| 378 |
} |
417 |
} |
| 379 |
} |
418 |
} |
| 380 |
|
419 |
|
|
|
420 |
if (repository != null) { |
| 421 |
savePasswordButton.setSelection(repository.isSavePassword()); |
| 422 |
} else { |
| 423 |
savePasswordButton.setSelection(false); |
| 424 |
} |
| 425 |
|
| 381 |
// TODO: put this back if we can't get the info from all connectors |
426 |
// TODO: put this back if we can't get the info from all connectors |
| 382 |
// if (needsTimeZone()) { |
427 |
// if (needsTimeZone()) { |
| 383 |
// Label timeZoneLabel = new Label(container, SWT.NONE); |
428 |
// Label timeZoneLabel = new Label(container, SWT.NONE); |
|
Lines 555-564
Link Here
|
| 555 |
httpAuthComp); |
600 |
httpAuthComp); |
| 556 |
((RepositoryStringFieldEditor) httpAuthPasswordEditor).getTextControl().setEchoChar('*'); |
601 |
((RepositoryStringFieldEditor) httpAuthPasswordEditor).getTextControl().setEchoChar('*'); |
| 557 |
|
602 |
|
|
|
603 |
saveHttpPasswordButton = new Button(httpAuthComp, SWT.CHECK); |
| 604 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(saveHttpPasswordButton); |
| 605 |
|
| 606 |
saveHttpPasswordButton.setText("Save Http Password"); |
| 607 |
saveHttpPasswordButton.addSelectionListener(new SelectionAdapter() { |
| 608 |
@Override |
| 609 |
public void widgetSelected(SelectionEvent e) { |
| 610 |
setSaveHttpPassword(saveHttpPasswordButton.getSelection()); |
| 611 |
isPageComplete(); |
| 612 |
} |
| 613 |
}); |
| 614 |
|
| 558 |
httpAuthUserNameEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); |
615 |
httpAuthUserNameEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); |
| 559 |
httpAuthPasswordEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); |
616 |
httpAuthPasswordEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); |
|
|
617 |
saveHttpPasswordButton.setEnabled(httpAuthButton.getSelection()); |
| 560 |
|
618 |
|
| 561 |
setHttpAuth(oldHttpAuthPassword != null && oldHttpAuthUserId != null && !oldHttpAuthPassword.equals("") |
619 |
if (repository != null) { |
|
|
620 |
saveHttpPasswordButton.setSelection(repository.isSaveHttpPassword()); |
| 621 |
} else { |
| 622 |
saveHttpPasswordButton.setSelection(false); |
| 623 |
} |
| 624 |
setHttpAuth(oldHttpAuthPassword != null && oldHttpAuthUserId != null |
| 562 |
&& !oldHttpAuthUserId.equals("")); |
625 |
&& !oldHttpAuthUserId.equals("")); |
| 563 |
|
626 |
|
| 564 |
httpAuthExpComposite.setExpanded(httpAuthButton.getSelection()); |
627 |
httpAuthExpComposite.setExpanded(httpAuthButton.getSelection()); |
|
Lines 640-645
Link Here
|
| 640 |
|
703 |
|
| 641 |
updateHyperlinks(); |
704 |
updateHyperlinks(); |
| 642 |
|
705 |
|
|
|
706 |
if (!onlyAuthenticationCredentials()) { |
| 707 |
httpAuthExpComposite.setExpanded(true); |
| 708 |
proxyExpComposite.setExpanded(true); |
| 709 |
} |
| 710 |
|
| 643 |
setControl(compositeContainer); |
711 |
setControl(compositeContainer); |
| 644 |
} |
712 |
} |
| 645 |
|
713 |
|
|
Lines 777-784
Link Here
|
| 777 |
// httpAuthPasswordEditor).setEnabled(httpAuthButton.getSelection(), |
845 |
// httpAuthPasswordEditor).setEnabled(httpAuthButton.getSelection(), |
| 778 |
// advancedComp); |
846 |
// advancedComp); |
| 779 |
|
847 |
|
| 780 |
setProxyAuth(oldProxyUsername != null && oldProxyPassword != null && !oldProxyUsername.equals("") |
848 |
saveProxyPasswordButton = new Button(proxyAuthComp, SWT.CHECK); |
| 781 |
&& !oldProxyPassword.equals("")); |
849 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(saveHttpPasswordButton); |
|
|
850 |
|
| 851 |
saveProxyPasswordButton.setText("Save Proxy Password"); |
| 852 |
saveProxyPasswordButton.addSelectionListener(new SelectionAdapter() { |
| 853 |
@Override |
| 854 |
public void widgetSelected(SelectionEvent e) { |
| 855 |
setSaveProxyPassword(saveProxyPasswordButton.getSelection()); |
| 856 |
isPageComplete(); |
| 857 |
} |
| 858 |
}); |
| 859 |
|
| 860 |
saveProxyPasswordButton.setEnabled(proxyAuthButton.getSelection()); |
| 861 |
|
| 862 |
if (repository != null) { |
| 863 |
saveProxyPasswordButton.setSelection(repository.isSaveProxyPassword()); |
| 864 |
} else { |
| 865 |
saveProxyPasswordButton.setSelection(false); |
| 866 |
} |
| 867 |
|
| 868 |
setProxyAuth(oldProxyUsername != null && oldProxyPassword != null && !oldProxyUsername.equals("")); |
| 782 |
|
869 |
|
| 783 |
setUseDefaultProxy(repository != null ? repository.isDefaultProxyEnabled() : true); |
870 |
setUseDefaultProxy(repository != null ? repository.isDefaultProxyEnabled() : true); |
| 784 |
proxyExpComposite.setExpanded(!systemProxyButton.getSelection()); |
871 |
proxyExpComposite.setExpanded(!systemProxyButton.getSelection()); |
|
Lines 819-828
Link Here
|
| 819 |
oldUsername = repositoryUserNameEditor.getStringValue(); |
906 |
oldUsername = repositoryUserNameEditor.getStringValue(); |
| 820 |
oldPassword = (repositoryPasswordEditor).getStringValue(); |
907 |
oldPassword = (repositoryPasswordEditor).getStringValue(); |
| 821 |
repositoryUserNameEditor.setStringValue(""); |
908 |
repositoryUserNameEditor.setStringValue(""); |
| 822 |
(repositoryPasswordEditor).setStringValue(""); |
909 |
repositoryPasswordEditor.setStringValue(""); |
| 823 |
} else { |
910 |
} else { |
| 824 |
repositoryUserNameEditor.setStringValue(oldUsername); |
911 |
repositoryUserNameEditor.setStringValue(oldUsername); |
| 825 |
(repositoryPasswordEditor).setStringValue(oldPassword); |
912 |
repositoryPasswordEditor.setStringValue(oldPassword); |
| 826 |
} |
913 |
} |
| 827 |
|
914 |
|
| 828 |
repositoryUserNameEditor.setEnabled(!selected, compositeContainer); |
915 |
repositoryUserNameEditor.setEnabled(!selected, compositeContainer); |
|
Lines 839-853
Link Here
|
| 839 |
httpAuthButton.setSelection(selected); |
926 |
httpAuthButton.setSelection(selected); |
| 840 |
if (!selected) { |
927 |
if (!selected) { |
| 841 |
oldHttpAuthUserId = httpAuthUserNameEditor.getStringValue(); |
928 |
oldHttpAuthUserId = httpAuthUserNameEditor.getStringValue(); |
| 842 |
oldHttpAuthPassword = (httpAuthPasswordEditor).getStringValue(); |
929 |
oldHttpAuthPassword = httpAuthPasswordEditor.getStringValue(); |
| 843 |
httpAuthUserNameEditor.setStringValue(null); |
930 |
httpAuthUserNameEditor.setStringValue(null); |
| 844 |
(httpAuthPasswordEditor).setStringValue(null); |
931 |
httpAuthPasswordEditor.setStringValue(null); |
| 845 |
} else { |
932 |
} else { |
| 846 |
httpAuthUserNameEditor.setStringValue(oldHttpAuthUserId); |
933 |
httpAuthUserNameEditor.setStringValue(oldHttpAuthUserId); |
| 847 |
(httpAuthPasswordEditor).setStringValue(oldHttpAuthPassword); |
934 |
httpAuthPasswordEditor.setStringValue(oldHttpAuthPassword); |
| 848 |
} |
935 |
} |
| 849 |
httpAuthUserNameEditor.setEnabled(selected, httpAuthComp); |
936 |
httpAuthUserNameEditor.setEnabled(selected, httpAuthComp); |
| 850 |
(httpAuthPasswordEditor).setEnabled(selected, httpAuthComp); |
937 |
httpAuthPasswordEditor.setEnabled(selected, httpAuthComp); |
|
|
938 |
saveHttpPasswordButton.setEnabled(selected); |
| 851 |
} |
939 |
} |
| 852 |
|
940 |
|
| 853 |
public void setUseDefaultProxy(boolean selected) { |
941 |
public void setUseDefaultProxy(boolean selected) { |
|
Lines 878-886
Link Here
|
| 878 |
proxyAuthButton.setEnabled(!systemProxyButton.getSelection()); |
966 |
proxyAuthButton.setEnabled(!systemProxyButton.getSelection()); |
| 879 |
if (!selected) { |
967 |
if (!selected) { |
| 880 |
oldProxyUsername = proxyUserNameEditor.getStringValue(); |
968 |
oldProxyUsername = proxyUserNameEditor.getStringValue(); |
| 881 |
oldProxyPassword = (proxyPasswordEditor).getStringValue(); |
969 |
oldProxyPassword = proxyPasswordEditor.getStringValue(); |
| 882 |
proxyUserNameEditor.setStringValue(null); |
970 |
proxyUserNameEditor.setStringValue(null); |
| 883 |
(proxyPasswordEditor).setStringValue(null); |
971 |
proxyPasswordEditor.setStringValue(null); |
| 884 |
} else { |
972 |
} else { |
| 885 |
proxyUserNameEditor.setStringValue(oldProxyUsername); |
973 |
proxyUserNameEditor.setStringValue(oldProxyUsername); |
| 886 |
proxyPasswordEditor.setStringValue(oldProxyPassword); |
974 |
proxyPasswordEditor.setStringValue(oldProxyPassword); |
|
Lines 888-893
Link Here
|
| 888 |
|
976 |
|
| 889 |
proxyUserNameEditor.setEnabled(selected && !systemProxyButton.getSelection(), proxyAuthComp); |
977 |
proxyUserNameEditor.setEnabled(selected && !systemProxyButton.getSelection(), proxyAuthComp); |
| 890 |
proxyPasswordEditor.setEnabled(selected && !systemProxyButton.getSelection(), proxyAuthComp); |
978 |
proxyPasswordEditor.setEnabled(selected && !systemProxyButton.getSelection(), proxyAuthComp); |
|
|
979 |
saveProxyPasswordButton.setEnabled(selected && !systemProxyButton.getSelection()); |
| 891 |
} |
980 |
} |
| 892 |
|
981 |
|
| 893 |
protected abstract void createAdditionalControls(Composite parent); |
982 |
protected abstract void createAdditionalControls(Composite parent); |
|
Lines 895-901
Link Here
|
| 895 |
protected abstract boolean isValidUrl(String name); |
984 |
protected abstract boolean isValidUrl(String name); |
| 896 |
|
985 |
|
| 897 |
void updateHyperlinks() { |
986 |
void updateHyperlinks() { |
| 898 |
if (getServerUrl() != null && getServerUrl().length() > 0) { |
987 |
if (onlyAuthenticationCredentials() && getServerUrl() != null && getServerUrl().length() > 0) { |
| 899 |
TaskRepository repository = createTaskRepository(); |
988 |
TaskRepository repository = createTaskRepository(); |
| 900 |
String accountCreationUrl = TasksUiPlugin.getConnectorUi(connector.getConnectorKind()) |
989 |
String accountCreationUrl = TasksUiPlugin.getConnectorUi(connector.getConnectorKind()) |
| 901 |
.getAccountCreationUrl(repository); |
990 |
.getAccountCreationUrl(repository); |
|
Lines 1027-1036
Link Here
|
| 1027 |
@Override |
1116 |
@Override |
| 1028 |
public boolean isPageComplete() { |
1117 |
public boolean isPageComplete() { |
| 1029 |
String errorMessage = null; |
1118 |
String errorMessage = null; |
| 1030 |
String url = getServerUrl(); |
1119 |
if (!onlyAuthenticationCredentials()) { |
| 1031 |
errorMessage = isUniqueUrl(url); |
1120 |
String url = getServerUrl(); |
| 1032 |
if (errorMessage == null && !isValidUrl(url)) { |
1121 |
errorMessage = isUniqueUrl(url); |
| 1033 |
errorMessage = "Enter a valid server url"; |
1122 |
if (errorMessage == null && !isValidUrl(url)) { |
|
|
1123 |
errorMessage = "Enter a valid server url"; |
| 1124 |
} |
| 1034 |
} |
1125 |
} |
| 1035 |
if (errorMessage == null) { |
1126 |
if (errorMessage == null) { |
| 1036 |
errorMessage = credentialsComplete(); |
1127 |
errorMessage = credentialsComplete(); |
|
Lines 1042-1050
Link Here
|
| 1042 |
|
1133 |
|
| 1043 |
private String credentialsComplete() { |
1134 |
private String credentialsComplete() { |
| 1044 |
if ((needsAnonymousLogin() && !anonymousButton.getSelection()) |
1135 |
if ((needsAnonymousLogin() && !anonymousButton.getSelection()) |
| 1045 |
&& (repositoryUserNameEditor.getStringValue().trim().equals("") || repositoryPasswordEditor.getStringValue() |
1136 |
&& (repositoryUserNameEditor.getStringValue().trim().equals("") || |
|
|
1137 |
(repositoryPasswordEditor.getStringValue() |
| 1046 |
.trim() |
1138 |
.trim() |
| 1047 |
.equals(""))) { |
1139 |
.equals("")) ) && savePasswordButton.getSelection()) { |
| 1048 |
return "Repository user name and password must not be blank"; |
1140 |
return "Repository user name and password must not be blank"; |
| 1049 |
} |
1141 |
} |
| 1050 |
return null; |
1142 |
return null; |
|
Lines 1122-1142
Link Here
|
| 1122 |
if (needsAnonymousLogin()) { |
1214 |
if (needsAnonymousLogin()) { |
| 1123 |
repository.setAnonymous(anonymousButton.getSelection()); |
1215 |
repository.setAnonymous(anonymousButton.getSelection()); |
| 1124 |
} |
1216 |
} |
|
|
1217 |
repository.setSavePassword(savePasswordButton.getSelection()); |
| 1125 |
// repository.setProperty(TaskRepository.AUTH_HTTP_USERNAME, |
1218 |
// repository.setProperty(TaskRepository.AUTH_HTTP_USERNAME, |
| 1126 |
// getHttpAuthUserId()); |
1219 |
// getHttpAuthUserId()); |
| 1127 |
// repository.setProperty(TaskRepository.AUTH_HTTP_PASSWORD, |
1220 |
// repository.setProperty(TaskRepository.AUTH_HTTP_PASSWORD, |
| 1128 |
// getHttpAuthPassword()); |
1221 |
// getHttpAuthPassword()); |
| 1129 |
if (getHttpAuthUserId().length() > 0 && getHttpAuthPassword().length() > 0) { |
1222 |
if (getHttpAuthUserId().length() > 0 ) { |
| 1130 |
repository.setHttpAuthenticationCredentials(getHttpAuthUserId(), getHttpAuthPassword()); |
1223 |
repository.setHttpAuthenticationCredentials(getHttpAuthUserId(), getHttpAuthPassword(), saveHttpPasswordButton.getSelection()); |
| 1131 |
} |
1224 |
} |
|
|
1225 |
repository.setSavePassword(saveHttpPasswordButton.getSelection()); |
| 1132 |
|
1226 |
|
| 1133 |
repository.setProperty(TaskRepository.PROXY_USEDEFAULT, String.valueOf(getUseDefaultProxy())); |
1227 |
repository.setProperty(TaskRepository.PROXY_USEDEFAULT, String.valueOf(getUseDefaultProxy())); |
| 1134 |
repository.setProperty(TaskRepository.PROXY_HOSTNAME, getProxyHostname()); |
1228 |
repository.setProperty(TaskRepository.PROXY_HOSTNAME, getProxyHostname()); |
| 1135 |
repository.setProperty(TaskRepository.PROXY_PORT, getProxyPort()); |
1229 |
repository.setProperty(TaskRepository.PROXY_PORT, getProxyPort()); |
| 1136 |
|
1230 |
|
| 1137 |
if (getProxyUserName().length() > 0 && getProxyPassword().length() > 0) { |
1231 |
if (getProxyUserName().length() > 0) { |
| 1138 |
repository.setProxyAuthenticationCredentials(getProxyUserName(), getProxyPassword()); |
1232 |
repository.setProxyAuthenticationCredentials(getProxyUserName(), getProxyPassword(), saveProxyPasswordButton.getSelection()); |
| 1139 |
} |
1233 |
} |
|
|
1234 |
repository.setSavePassword(saveProxyPasswordButton.getSelection()); |
| 1140 |
// repository.setProperty(TaskRepository.PROXY_USERNAME, |
1235 |
// repository.setProperty(TaskRepository.PROXY_USERNAME, |
| 1141 |
// getProxyUsername()); |
1236 |
// getProxyUsername()); |
| 1142 |
|
1237 |
|
|
Lines 1313-1317
Link Here
|
| 1313 |
} |
1408 |
} |
| 1314 |
|
1409 |
|
| 1315 |
} |
1410 |
} |
|
|
1411 |
public void setSavePassword(boolean selected) { |
| 1412 |
|
| 1413 |
savePasswordButton.setSelection(selected); |
| 1414 |
|
| 1415 |
if (selected) { |
| 1416 |
repositoryPasswordEditor.setStringValue(oldPassword); |
| 1417 |
} else { |
| 1418 |
oldPassword = repositoryPasswordEditor.getStringValue(); |
| 1419 |
repositoryPasswordEditor.setStringValue(""); |
| 1420 |
} |
| 1421 |
|
| 1422 |
repositoryPasswordEditor.setEnabled(selected, compositeContainer); |
| 1423 |
if (getWizard() != null) { |
| 1424 |
getWizard().getContainer().updateButtons(); |
| 1425 |
} |
| 1426 |
} |
| 1427 |
|
| 1428 |
public void setSaveHttpPassword(boolean selected) { |
| 1429 |
|
| 1430 |
saveHttpPasswordButton.setSelection(selected); |
| 1431 |
|
| 1432 |
if (selected) { |
| 1433 |
httpAuthPasswordEditor.setStringValue(oldHttpAuthPassword); |
| 1434 |
} else { |
| 1435 |
oldHttpAuthPassword = httpAuthPasswordEditor.getStringValue(); |
| 1436 |
httpAuthPasswordEditor.setStringValue(""); |
| 1437 |
} |
| 1438 |
|
| 1439 |
httpAuthPasswordEditor.setEnabled(selected, compositeContainer); |
| 1440 |
if (getWizard() != null) { |
| 1441 |
getWizard().getContainer().updateButtons(); |
| 1442 |
} |
| 1443 |
} |
| 1444 |
|
| 1445 |
public void setSaveProxyPassword(boolean selected) { |
| 1446 |
|
| 1447 |
saveProxyPasswordButton.setSelection(selected); |
| 1448 |
|
| 1449 |
if (selected) { |
| 1450 |
proxyPasswordEditor.setStringValue(oldHttpAuthPassword); |
| 1451 |
} else { |
| 1452 |
oldHttpAuthPassword = proxyPasswordEditor.getStringValue(); |
| 1453 |
proxyPasswordEditor.setStringValue(""); |
| 1454 |
} |
| 1455 |
|
| 1456 |
proxyPasswordEditor.setEnabled(selected, compositeContainer); |
| 1457 |
if (getWizard() != null) { |
| 1458 |
getWizard().getContainer().updateButtons(); |
| 1459 |
} |
| 1460 |
} |
| 1461 |
|
| 1462 |
public boolean onlyAuthenticationCredentials() { |
| 1463 |
return onlyAuthenticationCredentials; |
| 1464 |
} |
| 1465 |
|
| 1466 |
public void setOnlyAuthenticationCredentials(boolean onlyAuthenticationCredentials) { |
| 1467 |
this.onlyAuthenticationCredentials = onlyAuthenticationCredentials; |
| 1468 |
} |
| 1469 |
|
| 1470 |
public Boolean getSavePassword() { |
| 1471 |
return savePasswordButton.getSelection(); |
| 1472 |
} |
| 1473 |
|
| 1474 |
public Boolean getSaveProxyPassword() { |
| 1475 |
return saveProxyPasswordButton.getSelection(); |
| 1476 |
} |
| 1477 |
|
| 1478 |
public Boolean getSaveHttpPassword() { |
| 1479 |
return saveHttpPasswordButton.getSelection(); |
| 1480 |
} |
| 1481 |
|
| 1482 |
public static AbstractRepositorySettingsPage getSingle() { |
| 1483 |
return single; |
| 1484 |
} |
| 1316 |
|
1485 |
|
| 1317 |
} |
1486 |
} |