|
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 141-147
Link Here
|
| 141 |
private boolean needsHttpAuth; |
142 |
private boolean needsHttpAuth; |
| 142 |
|
143 |
|
| 143 |
private boolean needsValidation; |
144 |
private boolean needsValidation; |
| 144 |
|
145 |
|
| 145 |
private boolean needsAdvanced; |
146 |
private boolean needsAdvanced; |
| 146 |
|
147 |
|
| 147 |
protected Composite compositeContainer; |
148 |
protected Composite compositeContainer; |
|
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(false); |
| 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 400-409
Link Here
|
| 400 |
// } |
445 |
// } |
| 401 |
// } |
446 |
// } |
| 402 |
|
447 |
|
| 403 |
if(needsAdvanced() || needsEncoding()){ |
448 |
if (needsAdvanced() || needsEncoding()) { |
| 404 |
|
449 |
|
| 405 |
advancedExpComposite = toolkit.createExpandableComposite(compositeContainer, Section.COMPACT | Section.TWISTIE |
450 |
advancedExpComposite = toolkit.createExpandableComposite(compositeContainer, Section.COMPACT |
| 406 |
| Section.TITLE_BAR); |
451 |
| Section.TWISTIE | Section.TITLE_BAR); |
| 407 |
advancedExpComposite.clientVerticalSpacing = 0; |
452 |
advancedExpComposite.clientVerticalSpacing = 0; |
| 408 |
GridData gridData_2 = new GridData(SWT.FILL, SWT.FILL, true, false); |
453 |
GridData gridData_2 = new GridData(SWT.FILL, SWT.FILL, true, false); |
| 409 |
gridData_2.horizontalIndent = -5; |
454 |
gridData_2.horizontalIndent = -5; |
|
Lines 417-425
Link Here
|
| 417 |
getControl().getShell().pack(); |
462 |
getControl().getShell().pack(); |
| 418 |
} |
463 |
} |
| 419 |
}); |
464 |
}); |
| 420 |
|
465 |
|
| 421 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(advancedExpComposite); |
466 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(advancedExpComposite); |
| 422 |
|
467 |
|
| 423 |
advancedComp = toolkit.createComposite(advancedExpComposite, SWT.NONE); |
468 |
advancedComp = toolkit.createComposite(advancedExpComposite, SWT.NONE); |
| 424 |
GridLayout gridLayout2 = new GridLayout(); |
469 |
GridLayout gridLayout2 = new GridLayout(); |
| 425 |
gridLayout2.numColumns = 2; |
470 |
gridLayout2.numColumns = 2; |
|
Lines 427-451
Link Here
|
| 427 |
advancedComp.setLayout(gridLayout2); |
472 |
advancedComp.setLayout(gridLayout2); |
| 428 |
advancedComp.setBackground(compositeContainer.getBackground()); |
473 |
advancedComp.setBackground(compositeContainer.getBackground()); |
| 429 |
advancedExpComposite.setClient(advancedComp); |
474 |
advancedExpComposite.setClient(advancedComp); |
| 430 |
|
475 |
|
| 431 |
createAdditionalControls(advancedComp); |
476 |
createAdditionalControls(advancedComp); |
| 432 |
|
477 |
|
| 433 |
if (needsEncoding()) { |
478 |
if (needsEncoding()) { |
| 434 |
Label encodingLabel = new Label(advancedComp, SWT.HORIZONTAL); |
479 |
Label encodingLabel = new Label(advancedComp, SWT.HORIZONTAL); |
| 435 |
encodingLabel.setText("Character encoding:"); |
480 |
encodingLabel.setText("Character encoding:"); |
| 436 |
GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.TOP).applyTo(encodingLabel); |
481 |
GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.TOP).applyTo(encodingLabel); |
| 437 |
|
482 |
|
| 438 |
Composite encodingContainer = new Composite(advancedComp, SWT.NONE); |
483 |
Composite encodingContainer = new Composite(advancedComp, SWT.NONE); |
| 439 |
GridLayout gridLayout = new GridLayout(2, false); |
484 |
GridLayout gridLayout = new GridLayout(2, false); |
| 440 |
gridLayout.marginWidth = 0; |
485 |
gridLayout.marginWidth = 0; |
| 441 |
gridLayout.marginHeight = 0; |
486 |
gridLayout.marginHeight = 0; |
| 442 |
encodingContainer.setLayout(gridLayout); |
487 |
encodingContainer.setLayout(gridLayout); |
| 443 |
|
488 |
|
| 444 |
defaultEncoding = new Button(encodingContainer, SWT.RADIO); |
489 |
defaultEncoding = new Button(encodingContainer, SWT.RADIO); |
| 445 |
defaultEncoding.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
490 |
defaultEncoding.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
| 446 |
defaultEncoding.setText("Default (" + TaskRepository.DEFAULT_CHARACTER_ENCODING + ")"); |
491 |
defaultEncoding.setText("Default (" + TaskRepository.DEFAULT_CHARACTER_ENCODING + ")"); |
| 447 |
defaultEncoding.setSelection(true); |
492 |
defaultEncoding.setSelection(true); |
| 448 |
|
493 |
|
| 449 |
otherEncoding = new Button(encodingContainer, SWT.RADIO); |
494 |
otherEncoding = new Button(encodingContainer, SWT.RADIO); |
| 450 |
otherEncoding.setText("Other:"); |
495 |
otherEncoding.setText("Other:"); |
| 451 |
otherEncodingCombo = new Combo(encodingContainer, SWT.READ_ONLY); |
496 |
otherEncodingCombo = new Combo(encodingContainer, SWT.READ_ONLY); |
|
Lines 454-464
Link Here
|
| 454 |
otherEncodingCombo.add(encoding); |
499 |
otherEncodingCombo.add(encoding); |
| 455 |
} |
500 |
} |
| 456 |
} |
501 |
} |
| 457 |
|
502 |
|
| 458 |
setDefaultEncoding(); |
503 |
setDefaultEncoding(); |
| 459 |
|
504 |
|
| 460 |
otherEncoding.addSelectionListener(new SelectionAdapter() { |
505 |
otherEncoding.addSelectionListener(new SelectionAdapter() { |
| 461 |
|
506 |
|
| 462 |
@Override |
507 |
@Override |
| 463 |
public void widgetSelected(SelectionEvent e) { |
508 |
public void widgetSelected(SelectionEvent e) { |
| 464 |
if (otherEncoding.getSelection()) { |
509 |
if (otherEncoding.getSelection()) { |
|
Lines 470-476
Link Here
|
| 470 |
} |
515 |
} |
| 471 |
} |
516 |
} |
| 472 |
}); |
517 |
}); |
| 473 |
|
518 |
|
| 474 |
if (repository != null) { |
519 |
if (repository != null) { |
| 475 |
try { |
520 |
try { |
| 476 |
String repositoryEncoding = repository.getCharacterEncoding(); |
521 |
String repositoryEncoding = repository.getCharacterEncoding(); |
|
Lines 555-565
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) { |
| 562 |
&& !oldHttpAuthUserId.equals("")); |
620 |
saveHttpPasswordButton.setSelection(repository.isSaveHttpPassword()); |
|
|
621 |
} else { |
| 622 |
saveHttpPasswordButton.setSelection(false); |
| 623 |
} |
| 624 |
setHttpAuth(oldHttpAuthPassword != null && oldHttpAuthUserId != null && !oldHttpAuthUserId.equals("")); |
| 563 |
|
625 |
|
| 564 |
httpAuthExpComposite.setExpanded(httpAuthButton.getSelection()); |
626 |
httpAuthExpComposite.setExpanded(httpAuthButton.getSelection()); |
| 565 |
} |
627 |
} |
|
Lines 640-645
Link Here
|
| 640 |
|
702 |
|
| 641 |
updateHyperlinks(); |
703 |
updateHyperlinks(); |
| 642 |
|
704 |
|
|
|
705 |
if (onlyAuthenticationCredentials()) { |
| 706 |
httpAuthExpComposite.setExpanded(true); |
| 707 |
proxyExpComposite.setExpanded(true); |
| 708 |
} |
| 709 |
|
| 643 |
setControl(compositeContainer); |
710 |
setControl(compositeContainer); |
| 644 |
} |
711 |
} |
| 645 |
|
712 |
|
|
Lines 777-784
Link Here
|
| 777 |
// httpAuthPasswordEditor).setEnabled(httpAuthButton.getSelection(), |
844 |
// httpAuthPasswordEditor).setEnabled(httpAuthButton.getSelection(), |
| 778 |
// advancedComp); |
845 |
// advancedComp); |
| 779 |
|
846 |
|
| 780 |
setProxyAuth(oldProxyUsername != null && oldProxyPassword != null && !oldProxyUsername.equals("") |
847 |
saveProxyPasswordButton = new Button(proxyAuthComp, SWT.CHECK); |
| 781 |
&& !oldProxyPassword.equals("")); |
848 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(saveProxyPasswordButton); |
|
|
849 |
|
| 850 |
saveProxyPasswordButton.setText("Save Proxy Password"); |
| 851 |
saveProxyPasswordButton.addSelectionListener(new SelectionAdapter() { |
| 852 |
@Override |
| 853 |
public void widgetSelected(SelectionEvent e) { |
| 854 |
setSaveProxyPassword(saveProxyPasswordButton.getSelection()); |
| 855 |
isPageComplete(); |
| 856 |
} |
| 857 |
}); |
| 858 |
|
| 859 |
saveProxyPasswordButton.setEnabled(proxyAuthButton.getSelection()); |
| 860 |
|
| 861 |
if (repository != null) { |
| 862 |
saveProxyPasswordButton.setSelection(repository.isSaveProxyPassword()); |
| 863 |
} else { |
| 864 |
saveProxyPasswordButton.setSelection(false); |
| 865 |
} |
| 866 |
|
| 867 |
setProxyAuth(oldProxyUsername != null && oldProxyPassword != null && !oldProxyUsername.equals("")); |
| 782 |
|
868 |
|
| 783 |
setUseDefaultProxy(repository != null ? repository.isDefaultProxyEnabled() : true); |
869 |
setUseDefaultProxy(repository != null ? repository.isDefaultProxyEnabled() : true); |
| 784 |
proxyExpComposite.setExpanded(!systemProxyButton.getSelection()); |
870 |
proxyExpComposite.setExpanded(!systemProxyButton.getSelection()); |
|
Lines 819-828
Link Here
|
| 819 |
oldUsername = repositoryUserNameEditor.getStringValue(); |
905 |
oldUsername = repositoryUserNameEditor.getStringValue(); |
| 820 |
oldPassword = (repositoryPasswordEditor).getStringValue(); |
906 |
oldPassword = (repositoryPasswordEditor).getStringValue(); |
| 821 |
repositoryUserNameEditor.setStringValue(""); |
907 |
repositoryUserNameEditor.setStringValue(""); |
| 822 |
(repositoryPasswordEditor).setStringValue(""); |
908 |
repositoryPasswordEditor.setStringValue(""); |
| 823 |
} else { |
909 |
} else { |
| 824 |
repositoryUserNameEditor.setStringValue(oldUsername); |
910 |
repositoryUserNameEditor.setStringValue(oldUsername); |
| 825 |
(repositoryPasswordEditor).setStringValue(oldPassword); |
911 |
repositoryPasswordEditor.setStringValue(oldPassword); |
| 826 |
} |
912 |
} |
| 827 |
|
913 |
|
| 828 |
repositoryUserNameEditor.setEnabled(!selected, compositeContainer); |
914 |
repositoryUserNameEditor.setEnabled(!selected, compositeContainer); |
|
Lines 839-853
Link Here
|
| 839 |
httpAuthButton.setSelection(selected); |
925 |
httpAuthButton.setSelection(selected); |
| 840 |
if (!selected) { |
926 |
if (!selected) { |
| 841 |
oldHttpAuthUserId = httpAuthUserNameEditor.getStringValue(); |
927 |
oldHttpAuthUserId = httpAuthUserNameEditor.getStringValue(); |
| 842 |
oldHttpAuthPassword = (httpAuthPasswordEditor).getStringValue(); |
928 |
oldHttpAuthPassword = httpAuthPasswordEditor.getStringValue(); |
| 843 |
httpAuthUserNameEditor.setStringValue(null); |
929 |
httpAuthUserNameEditor.setStringValue(null); |
| 844 |
(httpAuthPasswordEditor).setStringValue(null); |
930 |
httpAuthPasswordEditor.setStringValue(null); |
| 845 |
} else { |
931 |
} else { |
| 846 |
httpAuthUserNameEditor.setStringValue(oldHttpAuthUserId); |
932 |
httpAuthUserNameEditor.setStringValue(oldHttpAuthUserId); |
| 847 |
(httpAuthPasswordEditor).setStringValue(oldHttpAuthPassword); |
933 |
httpAuthPasswordEditor.setStringValue(oldHttpAuthPassword); |
| 848 |
} |
934 |
} |
| 849 |
httpAuthUserNameEditor.setEnabled(selected, httpAuthComp); |
935 |
httpAuthUserNameEditor.setEnabled(selected, httpAuthComp); |
| 850 |
(httpAuthPasswordEditor).setEnabled(selected, httpAuthComp); |
936 |
httpAuthPasswordEditor.setEnabled(selected, httpAuthComp); |
|
|
937 |
saveHttpPasswordButton.setEnabled(selected); |
| 851 |
} |
938 |
} |
| 852 |
|
939 |
|
| 853 |
public void setUseDefaultProxy(boolean selected) { |
940 |
public void setUseDefaultProxy(boolean selected) { |
|
Lines 878-886
Link Here
|
| 878 |
proxyAuthButton.setEnabled(!systemProxyButton.getSelection()); |
965 |
proxyAuthButton.setEnabled(!systemProxyButton.getSelection()); |
| 879 |
if (!selected) { |
966 |
if (!selected) { |
| 880 |
oldProxyUsername = proxyUserNameEditor.getStringValue(); |
967 |
oldProxyUsername = proxyUserNameEditor.getStringValue(); |
| 881 |
oldProxyPassword = (proxyPasswordEditor).getStringValue(); |
968 |
oldProxyPassword = proxyPasswordEditor.getStringValue(); |
| 882 |
proxyUserNameEditor.setStringValue(null); |
969 |
proxyUserNameEditor.setStringValue(null); |
| 883 |
(proxyPasswordEditor).setStringValue(null); |
970 |
proxyPasswordEditor.setStringValue(null); |
| 884 |
} else { |
971 |
} else { |
| 885 |
proxyUserNameEditor.setStringValue(oldProxyUsername); |
972 |
proxyUserNameEditor.setStringValue(oldProxyUsername); |
| 886 |
proxyPasswordEditor.setStringValue(oldProxyPassword); |
973 |
proxyPasswordEditor.setStringValue(oldProxyPassword); |
|
Lines 888-893
Link Here
|
| 888 |
|
975 |
|
| 889 |
proxyUserNameEditor.setEnabled(selected && !systemProxyButton.getSelection(), proxyAuthComp); |
976 |
proxyUserNameEditor.setEnabled(selected && !systemProxyButton.getSelection(), proxyAuthComp); |
| 890 |
proxyPasswordEditor.setEnabled(selected && !systemProxyButton.getSelection(), proxyAuthComp); |
977 |
proxyPasswordEditor.setEnabled(selected && !systemProxyButton.getSelection(), proxyAuthComp); |
|
|
978 |
saveProxyPasswordButton.setEnabled(selected && !systemProxyButton.getSelection()); |
| 891 |
} |
979 |
} |
| 892 |
|
980 |
|
| 893 |
protected abstract void createAdditionalControls(Composite parent); |
981 |
protected abstract void createAdditionalControls(Composite parent); |
|
Lines 895-901
Link Here
|
| 895 |
protected abstract boolean isValidUrl(String name); |
983 |
protected abstract boolean isValidUrl(String name); |
| 896 |
|
984 |
|
| 897 |
void updateHyperlinks() { |
985 |
void updateHyperlinks() { |
| 898 |
if (getServerUrl() != null && getServerUrl().length() > 0) { |
986 |
if (!onlyAuthenticationCredentials() && getServerUrl() != null && getServerUrl().length() > 0) { |
| 899 |
TaskRepository repository = createTaskRepository(); |
987 |
TaskRepository repository = createTaskRepository(); |
| 900 |
String accountCreationUrl = TasksUiPlugin.getConnectorUi(connector.getConnectorKind()) |
988 |
String accountCreationUrl = TasksUiPlugin.getConnectorUi(connector.getConnectorKind()) |
| 901 |
.getAccountCreationUrl(repository); |
989 |
.getAccountCreationUrl(repository); |
|
Lines 1027-1036
Link Here
|
| 1027 |
@Override |
1115 |
@Override |
| 1028 |
public boolean isPageComplete() { |
1116 |
public boolean isPageComplete() { |
| 1029 |
String errorMessage = null; |
1117 |
String errorMessage = null; |
| 1030 |
String url = getServerUrl(); |
1118 |
if (!onlyAuthenticationCredentials()) { |
| 1031 |
errorMessage = isUniqueUrl(url); |
1119 |
String url = getServerUrl(); |
| 1032 |
if (errorMessage == null && !isValidUrl(url)) { |
1120 |
errorMessage = isUniqueUrl(url); |
| 1033 |
errorMessage = "Enter a valid server url"; |
1121 |
if (errorMessage == null && !isValidUrl(url)) { |
|
|
1122 |
errorMessage = "Enter a valid server url"; |
| 1123 |
} |
| 1034 |
} |
1124 |
} |
| 1035 |
if (errorMessage == null) { |
1125 |
if (errorMessage == null) { |
| 1036 |
errorMessage = credentialsComplete(); |
1126 |
errorMessage = credentialsComplete(); |
|
Lines 1042-1050
Link Here
|
| 1042 |
|
1132 |
|
| 1043 |
private String credentialsComplete() { |
1133 |
private String credentialsComplete() { |
| 1044 |
if ((needsAnonymousLogin() && !anonymousButton.getSelection()) |
1134 |
if ((needsAnonymousLogin() && !anonymousButton.getSelection()) |
| 1045 |
&& (repositoryUserNameEditor.getStringValue().trim().equals("") || repositoryPasswordEditor.getStringValue() |
1135 |
&& (repositoryUserNameEditor.getStringValue().trim().equals("") || (repositoryPasswordEditor.getStringValue() |
| 1046 |
.trim() |
1136 |
.trim().equals(""))) && savePasswordButton.getSelection()) { |
| 1047 |
.equals(""))) { |
|
|
| 1048 |
return "Repository user name and password must not be blank"; |
1137 |
return "Repository user name and password must not be blank"; |
| 1049 |
} |
1138 |
} |
| 1050 |
return null; |
1139 |
return null; |
|
Lines 1122-1142
Link Here
|
| 1122 |
if (needsAnonymousLogin()) { |
1211 |
if (needsAnonymousLogin()) { |
| 1123 |
repository.setAnonymous(anonymousButton.getSelection()); |
1212 |
repository.setAnonymous(anonymousButton.getSelection()); |
| 1124 |
} |
1213 |
} |
|
|
1214 |
repository.setSavePassword(savePasswordButton.getSelection()); |
| 1125 |
// repository.setProperty(TaskRepository.AUTH_HTTP_USERNAME, |
1215 |
// repository.setProperty(TaskRepository.AUTH_HTTP_USERNAME, |
| 1126 |
// getHttpAuthUserId()); |
1216 |
// getHttpAuthUserId()); |
| 1127 |
// repository.setProperty(TaskRepository.AUTH_HTTP_PASSWORD, |
1217 |
// repository.setProperty(TaskRepository.AUTH_HTTP_PASSWORD, |
| 1128 |
// getHttpAuthPassword()); |
1218 |
// getHttpAuthPassword()); |
| 1129 |
if (getHttpAuthUserId().length() > 0 && getHttpAuthPassword().length() > 0) { |
1219 |
if (getHttpAuthUserId().length() > 0) { |
| 1130 |
repository.setHttpAuthenticationCredentials(getHttpAuthUserId(), getHttpAuthPassword()); |
1220 |
repository.setHttpAuthenticationCredentials(getHttpAuthUserId(), getHttpAuthPassword(), |
|
|
1221 |
saveHttpPasswordButton.getSelection()); |
| 1222 |
repository.setSavePassword(saveHttpPasswordButton.getSelection()); |
| 1131 |
} |
1223 |
} |
| 1132 |
|
1224 |
|
| 1133 |
repository.setProperty(TaskRepository.PROXY_USEDEFAULT, String.valueOf(getUseDefaultProxy())); |
1225 |
repository.setProperty(TaskRepository.PROXY_USEDEFAULT, String.valueOf(getUseDefaultProxy())); |
| 1134 |
repository.setProperty(TaskRepository.PROXY_HOSTNAME, getProxyHostname()); |
1226 |
repository.setProperty(TaskRepository.PROXY_HOSTNAME, getProxyHostname()); |
| 1135 |
repository.setProperty(TaskRepository.PROXY_PORT, getProxyPort()); |
1227 |
repository.setProperty(TaskRepository.PROXY_PORT, getProxyPort()); |
| 1136 |
|
1228 |
|
| 1137 |
if (getProxyUserName().length() > 0 && getProxyPassword().length() > 0) { |
1229 |
if (getProxyUserName().length() > 0) { |
| 1138 |
repository.setProxyAuthenticationCredentials(getProxyUserName(), getProxyPassword()); |
1230 |
repository.setProxyAuthenticationCredentials(getProxyUserName(), getProxyPassword(), |
|
|
1231 |
saveProxyPasswordButton.getSelection()); |
| 1139 |
} |
1232 |
} |
|
|
1233 |
repository.setSavePassword(saveProxyPasswordButton.getSelection()); |
| 1140 |
// repository.setProperty(TaskRepository.PROXY_USERNAME, |
1234 |
// repository.setProperty(TaskRepository.PROXY_USERNAME, |
| 1141 |
// getProxyUsername()); |
1235 |
// getProxyUsername()); |
| 1142 |
|
1236 |
|
|
Lines 1166-1180
Link Here
|
| 1166 |
return needsAnonymousLogin; |
1260 |
return needsAnonymousLogin; |
| 1167 |
} |
1261 |
} |
| 1168 |
|
1262 |
|
| 1169 |
|
1263 |
public boolean needsAdvanced() { |
| 1170 |
public boolean needsAdvanced(){ |
|
|
| 1171 |
return needsAdvanced; |
1264 |
return needsAdvanced; |
| 1172 |
} |
1265 |
} |
| 1173 |
|
1266 |
|
| 1174 |
public void setNeedsEncoding(boolean needsEncoding) { |
1267 |
public void setNeedsEncoding(boolean needsEncoding) { |
| 1175 |
this.needsEncoding = needsEncoding; |
1268 |
this.needsEncoding = needsEncoding; |
| 1176 |
} |
1269 |
} |
| 1177 |
|
1270 |
|
| 1178 |
public void setNeedsTimeZone(boolean needsTimeZone) { |
1271 |
public void setNeedsTimeZone(boolean needsTimeZone) { |
| 1179 |
this.needsTimeZone = needsTimeZone; |
1272 |
this.needsTimeZone = needsTimeZone; |
| 1180 |
} |
1273 |
} |
|
Lines 1182-1188
Link Here
|
| 1182 |
public void setNeedsAdvanced(boolean needsAdvanced) { |
1275 |
public void setNeedsAdvanced(boolean needsAdvanced) { |
| 1183 |
this.needsAdvanced = needsAdvanced; |
1276 |
this.needsAdvanced = needsAdvanced; |
| 1184 |
} |
1277 |
} |
| 1185 |
|
1278 |
|
| 1186 |
public boolean needsHttpAuth() { |
1279 |
public boolean needsHttpAuth() { |
| 1187 |
return this.needsHttpAuth; |
1280 |
return this.needsHttpAuth; |
| 1188 |
} |
1281 |
} |
|
Lines 1314-1317
Link Here
|
| 1314 |
|
1407 |
|
| 1315 |
} |
1408 |
} |
| 1316 |
|
1409 |
|
|
|
1410 |
public void setSavePassword(boolean selected) { |
| 1411 |
|
| 1412 |
savePasswordButton.setSelection(selected); |
| 1413 |
|
| 1414 |
if (selected) { |
| 1415 |
repositoryPasswordEditor.setStringValue(oldPassword); |
| 1416 |
} else { |
| 1417 |
oldPassword = repositoryPasswordEditor.getStringValue(); |
| 1418 |
repositoryPasswordEditor.setStringValue(""); |
| 1419 |
} |
| 1420 |
|
| 1421 |
repositoryPasswordEditor.setEnabled(selected, compositeContainer); |
| 1422 |
if (getWizard() != null) { |
| 1423 |
getWizard().getContainer().updateButtons(); |
| 1424 |
} |
| 1425 |
} |
| 1426 |
|
| 1427 |
public void setSaveHttpPassword(boolean selected) { |
| 1428 |
|
| 1429 |
saveHttpPasswordButton.setSelection(selected); |
| 1430 |
|
| 1431 |
if (selected) { |
| 1432 |
httpAuthPasswordEditor.setStringValue(oldHttpAuthPassword); |
| 1433 |
} else { |
| 1434 |
oldHttpAuthPassword = httpAuthPasswordEditor.getStringValue(); |
| 1435 |
httpAuthPasswordEditor.setStringValue(""); |
| 1436 |
} |
| 1437 |
|
| 1438 |
httpAuthPasswordEditor.setEnabled(selected, compositeContainer); |
| 1439 |
if (getWizard() != null) { |
| 1440 |
getWizard().getContainer().updateButtons(); |
| 1441 |
} |
| 1442 |
} |
| 1443 |
|
| 1444 |
public void setSaveProxyPassword(boolean selected) { |
| 1445 |
|
| 1446 |
saveProxyPasswordButton.setSelection(selected); |
| 1447 |
|
| 1448 |
if (selected) { |
| 1449 |
proxyPasswordEditor.setStringValue(oldHttpAuthPassword); |
| 1450 |
} else { |
| 1451 |
oldHttpAuthPassword = proxyPasswordEditor.getStringValue(); |
| 1452 |
proxyPasswordEditor.setStringValue(""); |
| 1453 |
} |
| 1454 |
|
| 1455 |
proxyPasswordEditor.setEnabled(selected, compositeContainer); |
| 1456 |
if (getWizard() != null) { |
| 1457 |
getWizard().getContainer().updateButtons(); |
| 1458 |
} |
| 1459 |
} |
| 1460 |
|
| 1461 |
public boolean onlyAuthenticationCredentials() { |
| 1462 |
return onlyAuthenticationCredentials; |
| 1463 |
} |
| 1464 |
|
| 1465 |
public void setOnlyAuthenticationCredentials(boolean onlyAuthenticationCredentials) { |
| 1466 |
this.onlyAuthenticationCredentials = onlyAuthenticationCredentials; |
| 1467 |
} |
| 1468 |
|
| 1469 |
public Boolean getSavePassword() { |
| 1470 |
return savePasswordButton.getSelection(); |
| 1471 |
} |
| 1472 |
|
| 1473 |
public Boolean getSaveProxyPassword() { |
| 1474 |
return saveProxyPasswordButton.getSelection(); |
| 1475 |
} |
| 1476 |
|
| 1477 |
public Boolean getSaveHttpPassword() { |
| 1478 |
return saveHttpPasswordButton.getSelection(); |
| 1479 |
} |
| 1480 |
|
| 1481 |
public static AbstractRepositorySettingsPage getSingle() { |
| 1482 |
return single; |
| 1483 |
} |
| 1484 |
|
| 1317 |
} |
1485 |
} |