|
Lines 29-34
Link Here
|
| 29 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
29 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
| 30 |
import org.eclipse.jface.preference.PreferenceDialog; |
30 |
import org.eclipse.jface.preference.PreferenceDialog; |
| 31 |
import org.eclipse.jface.preference.StringFieldEditor; |
31 |
import org.eclipse.jface.preference.StringFieldEditor; |
|
|
32 |
import org.eclipse.jface.resource.JFaceResources; |
| 32 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
33 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
| 33 |
import org.eclipse.mylyn.commons.net.AuthenticationCredentials; |
34 |
import org.eclipse.mylyn.commons.net.AuthenticationCredentials; |
| 34 |
import org.eclipse.mylyn.commons.net.AuthenticationType; |
35 |
import org.eclipse.mylyn.commons.net.AuthenticationType; |
|
Lines 50-56
Link Here
|
| 50 |
import org.eclipse.swt.events.SelectionAdapter; |
51 |
import org.eclipse.swt.events.SelectionAdapter; |
| 51 |
import org.eclipse.swt.events.SelectionEvent; |
52 |
import org.eclipse.swt.events.SelectionEvent; |
| 52 |
import org.eclipse.swt.events.SelectionListener; |
53 |
import org.eclipse.swt.events.SelectionListener; |
| 53 |
import org.eclipse.swt.layout.FillLayout; |
|
|
| 54 |
import org.eclipse.swt.layout.GridData; |
54 |
import org.eclipse.swt.layout.GridData; |
| 55 |
import org.eclipse.swt.layout.GridLayout; |
55 |
import org.eclipse.swt.layout.GridLayout; |
| 56 |
import org.eclipse.swt.widgets.Button; |
56 |
import org.eclipse.swt.widgets.Button; |
|
Lines 288-295
Link Here
|
| 288 |
oldHttpAuthUserId = null; |
288 |
oldHttpAuthUserId = null; |
| 289 |
} |
289 |
} |
| 290 |
|
290 |
|
| 291 |
compositeContainer = new Composite(parent, SWT.NULL); |
291 |
compositeContainer = new Composite(parent, SWT.NONE); |
| 292 |
FillLayout layout = new FillLayout(); |
292 |
GridLayout layout = new GridLayout(3, false); |
| 293 |
compositeContainer.setLayout(layout); |
293 |
compositeContainer.setLayout(layout); |
| 294 |
|
294 |
|
| 295 |
new Label(compositeContainer, SWT.NONE).setText(LABEL_SERVER); |
295 |
new Label(compositeContainer, SWT.NONE).setText(LABEL_SERVER); |
|
Lines 317-323
Link Here
|
| 317 |
} |
317 |
} |
| 318 |
}); |
318 |
}); |
| 319 |
|
319 |
|
| 320 |
GridDataFactory.fillDefaults().hint(300, SWT.DEFAULT).grab(true, false).applyTo(serverUrlCombo); |
320 |
GridDataFactory.fillDefaults().hint(300, SWT.DEFAULT).grab(true, false).span(2, SWT.DEFAULT).applyTo( |
|
|
321 |
serverUrlCombo); |
| 321 |
|
322 |
|
| 322 |
repositoryLabelEditor = new StringFieldEditor("", LABEL_REPOSITORY_LABEL, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
323 |
repositoryLabelEditor = new StringFieldEditor("", LABEL_REPOSITORY_LABEL, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
| 323 |
compositeContainer) { |
324 |
compositeContainer) { |
|
Lines 335-356
Link Here
|
| 335 |
getWizard().getContainer().updateButtons(); |
336 |
getWizard().getContainer().updateButtons(); |
| 336 |
} |
337 |
} |
| 337 |
} |
338 |
} |
|
|
339 |
|
| 340 |
@Override |
| 341 |
public int getNumberOfControls() { |
| 342 |
return 2; |
| 343 |
} |
| 338 |
}; |
344 |
}; |
| 339 |
// repositoryLabelEditor.setErrorMessage("error"); |
345 |
// repositoryLabelEditor.setErrorMessage("error"); |
| 340 |
|
346 |
((GridLayout) (compositeContainer.getLayout())).numColumns++; |
| 341 |
if (needsAnonymousLogin()) { |
347 |
disconnectedButton = new Button(compositeContainer, SWT.CHECK); |
| 342 |
anonymousButton = new Button(compositeContainer, SWT.CHECK); |
348 |
disconnectedButton.setText(Messages.AbstractRepositorySettingsPage_Disconnected); |
| 343 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(anonymousButton); |
349 |
disconnectedButton.setSelection(repository != null ? repository.isOffline() : false); |
| 344 |
|
|
|
| 345 |
anonymousButton.setText(Messages.AbstractRepositorySettingsPage_Anonymous_Access); |
| 346 |
anonymousButton.addSelectionListener(new SelectionAdapter() { |
| 347 |
@Override |
| 348 |
public void widgetSelected(SelectionEvent e) { |
| 349 |
setAnonymous(anonymousButton.getSelection()); |
| 350 |
isPageComplete(); |
| 351 |
} |
| 352 |
}); |
| 353 |
} |
| 354 |
|
350 |
|
| 355 |
repositoryUserNameEditor = new StringFieldEditor("", LABEL_USER, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
351 |
repositoryUserNameEditor = new StringFieldEditor("", LABEL_USER, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
| 356 |
compositeContainer) { |
352 |
compositeContainer) { |
|
Lines 368-374
Link Here
|
| 368 |
getWizard().getContainer().updateButtons(); |
364 |
getWizard().getContainer().updateButtons(); |
| 369 |
} |
365 |
} |
| 370 |
} |
366 |
} |
|
|
367 |
|
| 368 |
@Override |
| 369 |
public int getNumberOfControls() { |
| 370 |
// if will have anonymous checkbox on same line, make this control only span 2 columns |
| 371 |
return needsAnonymousLogin() ? 2 : 3; |
| 372 |
} |
| 371 |
}; |
373 |
}; |
|
|
374 |
if (needsAnonymousLogin()) { |
| 375 |
// need to increase column number here, because above string editor will use them if declared beforehand |
| 376 |
((GridLayout) (compositeContainer.getLayout())).numColumns++; |
| 377 |
anonymousButton = new Button(compositeContainer, SWT.CHECK); |
| 378 |
|
| 379 |
anonymousButton.setText(Messages.AbstractRepositorySettingsPage_Anonymous_Access); |
| 380 |
anonymousButton.addSelectionListener(new SelectionAdapter() { |
| 381 |
@Override |
| 382 |
public void widgetSelected(SelectionEvent e) { |
| 383 |
setAnonymous(anonymousButton.getSelection()); |
| 384 |
isPageComplete(); |
| 385 |
} |
| 386 |
}); |
| 387 |
} |
| 372 |
|
388 |
|
| 373 |
repositoryPasswordEditor = new RepositoryStringFieldEditor("", LABEL_PASSWORD, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
389 |
repositoryPasswordEditor = new RepositoryStringFieldEditor("", LABEL_PASSWORD, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
| 374 |
compositeContainer) { |
390 |
compositeContainer) { |
|
Lines 386-395
Link Here
|
| 386 |
getWizard().getContainer().updateButtons(); |
402 |
getWizard().getContainer().updateButtons(); |
| 387 |
} |
403 |
} |
| 388 |
} |
404 |
} |
|
|
405 |
|
| 406 |
@Override |
| 407 |
public int getNumberOfControls() { |
| 408 |
return 2; |
| 409 |
} |
| 389 |
}; |
410 |
}; |
| 390 |
|
411 |
|
|
|
412 |
// need to increase column number here, because above string editor will use them if declared beforehand |
| 413 |
((GridLayout) (compositeContainer.getLayout())).numColumns++; |
| 391 |
savePasswordButton = new Button(compositeContainer, SWT.CHECK); |
414 |
savePasswordButton = new Button(compositeContainer, SWT.CHECK); |
| 392 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(savePasswordButton); |
|
|
| 393 |
savePasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Password); |
415 |
savePasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Password); |
| 394 |
|
416 |
|
| 395 |
if (repository != null) { |
417 |
if (repository != null) { |
|
Lines 452-464
Link Here
|
| 452 |
|
474 |
|
| 453 |
if (needsAdvanced() || needsEncoding()) { |
475 |
if (needsAdvanced() || needsEncoding()) { |
| 454 |
|
476 |
|
| 455 |
advancedExpComposite = toolkit.createExpandableComposite(compositeContainer, ExpandableComposite.COMPACT |
477 |
advancedExpComposite = toolkit.createExpandableComposite(compositeContainer, ExpandableComposite.TWISTIE |
| 456 |
| ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); |
478 |
| ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT); |
| 457 |
advancedExpComposite.clientVerticalSpacing = 0; |
479 |
advancedExpComposite.clientVerticalSpacing = 0; |
| 458 |
GridData gridData_2 = new GridData(SWT.FILL, SWT.FILL, true, false); |
480 |
advancedExpComposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); |
| 459 |
gridData_2.horizontalIndent = -5; |
|
|
| 460 |
advancedExpComposite.setLayoutData(gridData_2); |
| 461 |
advancedExpComposite.setFont(compositeContainer.getFont()); |
| 462 |
advancedExpComposite.setBackground(compositeContainer.getBackground()); |
481 |
advancedExpComposite.setBackground(compositeContainer.getBackground()); |
| 463 |
advancedExpComposite.setText(Messages.AbstractRepositorySettingsPage_Additional_Settings); |
482 |
advancedExpComposite.setText(Messages.AbstractRepositorySettingsPage_Additional_Settings); |
| 464 |
advancedExpComposite.addExpansionListener(new ExpansionAdapter() { |
483 |
advancedExpComposite.addExpansionListener(new ExpansionAdapter() { |
|
Lines 468-479
Link Here
|
| 468 |
} |
487 |
} |
| 469 |
}); |
488 |
}); |
| 470 |
|
489 |
|
| 471 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(advancedExpComposite); |
490 |
GridDataFactory.fillDefaults().indent(0, 8).span(3, SWT.DEFAULT).applyTo(advancedExpComposite); |
| 472 |
|
491 |
|
| 473 |
advancedComp = toolkit.createComposite(advancedExpComposite, SWT.NONE); |
492 |
advancedComp = toolkit.createComposite(advancedExpComposite, SWT.NONE); |
| 474 |
GridLayout gridLayout2 = new GridLayout(); |
493 |
GridLayout gridLayout2 = new GridLayout(); |
| 475 |
gridLayout2.numColumns = 2; |
494 |
gridLayout2.numColumns = 2; |
| 476 |
gridLayout2.verticalSpacing = 5; |
495 |
gridLayout2.verticalSpacing = 5; |
|
|
496 |
gridLayout2.marginWidth = 0; |
| 477 |
advancedComp.setLayout(gridLayout2); |
497 |
advancedComp.setLayout(gridLayout2); |
| 478 |
advancedComp.setBackground(compositeContainer.getBackground()); |
498 |
advancedComp.setBackground(compositeContainer.getBackground()); |
| 479 |
advancedExpComposite.setClient(advancedComp); |
499 |
advancedExpComposite.setClient(advancedComp); |
|
Lines 558-570
Link Here
|
| 558 |
} |
578 |
} |
| 559 |
|
579 |
|
| 560 |
if (needsHttpAuth()) { |
580 |
if (needsHttpAuth()) { |
| 561 |
httpAuthExpComposite = toolkit.createExpandableComposite(compositeContainer, ExpandableComposite.COMPACT |
581 |
httpAuthExpComposite = toolkit.createExpandableComposite(compositeContainer, ExpandableComposite.TWISTIE |
| 562 |
| ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); |
582 |
| ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT); |
| 563 |
httpAuthExpComposite.clientVerticalSpacing = 0; |
583 |
httpAuthExpComposite.clientVerticalSpacing = 0; |
| 564 |
GridData gridData_2 = new GridData(SWT.FILL, SWT.FILL, true, false); |
584 |
httpAuthExpComposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); |
| 565 |
gridData_2.horizontalIndent = -5; |
|
|
| 566 |
httpAuthExpComposite.setLayoutData(gridData_2); |
| 567 |
httpAuthExpComposite.setFont(compositeContainer.getFont()); |
| 568 |
httpAuthExpComposite.setBackground(compositeContainer.getBackground()); |
585 |
httpAuthExpComposite.setBackground(compositeContainer.getBackground()); |
| 569 |
httpAuthExpComposite.setText(Messages.AbstractRepositorySettingsPage_Http_Authentication); |
586 |
httpAuthExpComposite.setText(Messages.AbstractRepositorySettingsPage_Http_Authentication); |
| 570 |
httpAuthExpComposite.addExpansionListener(new ExpansionAdapter() { |
587 |
httpAuthExpComposite.addExpansionListener(new ExpansionAdapter() { |
|
Lines 574-593
Link Here
|
| 574 |
} |
591 |
} |
| 575 |
}); |
592 |
}); |
| 576 |
|
593 |
|
| 577 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(httpAuthExpComposite); |
594 |
GridDataFactory.fillDefaults().indent(0, 5).span(3, SWT.DEFAULT).applyTo(httpAuthExpComposite); |
| 578 |
|
595 |
|
| 579 |
httpAuthComp = toolkit.createComposite(httpAuthExpComposite, SWT.NONE); |
596 |
httpAuthComp = toolkit.createComposite(httpAuthExpComposite, SWT.NONE); |
| 580 |
GridLayout gridLayout2 = new GridLayout(); |
597 |
GridLayout gridLayout2 = new GridLayout(); |
| 581 |
gridLayout2.numColumns = 2; |
|
|
| 582 |
gridLayout2.verticalSpacing = 0; |
598 |
gridLayout2.verticalSpacing = 0; |
|
|
599 |
gridLayout2.numColumns = 3; |
| 583 |
httpAuthComp.setLayout(gridLayout2); |
600 |
httpAuthComp.setLayout(gridLayout2); |
| 584 |
httpAuthComp.setBackground(compositeContainer.getBackground()); |
601 |
httpAuthComp.setBackground(compositeContainer.getBackground()); |
|
|
602 |
GridDataFactory.fillDefaults().span(3, SWT.DEFAULT).applyTo(httpAuthComp); |
| 585 |
httpAuthExpComposite.setClient(httpAuthComp); |
603 |
httpAuthExpComposite.setClient(httpAuthComp); |
| 586 |
|
604 |
|
|
|
605 |
// need to increase column number here, because above string editor will use them if declared beforehand |
| 587 |
httpAuthButton = new Button(httpAuthComp, SWT.CHECK); |
606 |
httpAuthButton = new Button(httpAuthComp, SWT.CHECK); |
| 588 |
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(httpAuthButton); |
607 |
GridDataFactory.fillDefaults().indent(0, 5).align(SWT.LEFT, SWT.TOP).span(3, SWT.DEFAULT).applyTo( |
|
|
608 |
httpAuthButton); |
| 589 |
|
609 |
|
| 590 |
httpAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enabled); |
610 |
httpAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enable_http_authentication); |
| 591 |
|
611 |
|
| 592 |
httpAuthButton.addSelectionListener(new SelectionListener() { |
612 |
httpAuthButton.addSelectionListener(new SelectionListener() { |
| 593 |
public void widgetSelected(SelectionEvent e) { |
613 |
public void widgetSelected(SelectionEvent e) { |
|
Lines 614-628
Link Here
|
| 614 |
getWizard().getContainer().updateButtons(); |
634 |
getWizard().getContainer().updateButtons(); |
| 615 |
} |
635 |
} |
| 616 |
} |
636 |
} |
|
|
637 |
|
| 638 |
@Override |
| 639 |
public int getNumberOfControls() { |
| 640 |
return 3; |
| 641 |
} |
| 617 |
}; |
642 |
}; |
|
|
643 |
|
| 618 |
httpAuthPasswordEditor = new RepositoryStringFieldEditor( |
644 |
httpAuthPasswordEditor = new RepositoryStringFieldEditor( |
| 619 |
"", Messages.AbstractRepositorySettingsPage_Password_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
645 |
"", Messages.AbstractRepositorySettingsPage_Password_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
| 620 |
httpAuthComp); |
646 |
httpAuthComp) { |
|
|
647 |
@Override |
| 648 |
public int getNumberOfControls() { |
| 649 |
return 2; |
| 650 |
} |
| 651 |
}; |
| 621 |
((RepositoryStringFieldEditor) httpAuthPasswordEditor).getTextControl().setEchoChar('*'); |
652 |
((RepositoryStringFieldEditor) httpAuthPasswordEditor).getTextControl().setEchoChar('*'); |
| 622 |
|
653 |
|
|
|
654 |
// need to increase column number here, because above string editor will use them if declared beforehand |
| 655 |
((GridLayout) (httpAuthComp.getLayout())).numColumns++; |
| 656 |
|
| 623 |
saveHttpPasswordButton = new Button(httpAuthComp, SWT.CHECK); |
657 |
saveHttpPasswordButton = new Button(httpAuthComp, SWT.CHECK); |
| 624 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(saveHttpPasswordButton); |
658 |
saveHttpPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Password); |
| 625 |
saveHttpPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Http_Password); |
|
|
| 626 |
|
659 |
|
| 627 |
httpAuthUserNameEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); |
660 |
httpAuthUserNameEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); |
| 628 |
httpAuthPasswordEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); |
661 |
httpAuthPasswordEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); |
|
Lines 641-648
Link Here
|
| 641 |
addProxySection(); |
674 |
addProxySection(); |
| 642 |
} |
675 |
} |
| 643 |
|
676 |
|
| 644 |
addStatusSection(); |
|
|
| 645 |
|
| 646 |
addContributionSection(); |
677 |
addContributionSection(); |
| 647 |
|
678 |
|
| 648 |
Composite managementComposite = new Composite(compositeContainer, SWT.NULL); |
679 |
Composite managementComposite = new Composite(compositeContainer, SWT.NULL); |
|
Lines 711-723
Link Here
|
| 711 |
|
742 |
|
| 712 |
private void addProxySection() { |
743 |
private void addProxySection() { |
| 713 |
|
744 |
|
| 714 |
proxyExpComposite = toolkit.createExpandableComposite(compositeContainer, ExpandableComposite.COMPACT |
745 |
proxyExpComposite = toolkit.createExpandableComposite(compositeContainer, ExpandableComposite.TWISTIE |
| 715 |
| ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); |
746 |
| ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT); |
| 716 |
proxyExpComposite.clientVerticalSpacing = 0; |
747 |
proxyExpComposite.clientVerticalSpacing = 0; |
| 717 |
GridData gridData_2 = new GridData(SWT.FILL, SWT.FILL, true, false); |
748 |
proxyExpComposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); |
| 718 |
gridData_2.horizontalIndent = -5; |
|
|
| 719 |
proxyExpComposite.setLayoutData(gridData_2); |
| 720 |
proxyExpComposite.setFont(compositeContainer.getFont()); |
| 721 |
proxyExpComposite.setBackground(compositeContainer.getBackground()); |
749 |
proxyExpComposite.setBackground(compositeContainer.getBackground()); |
| 722 |
proxyExpComposite.setText(Messages.AbstractRepositorySettingsPage_Proxy_Server_Configuration); |
750 |
proxyExpComposite.setText(Messages.AbstractRepositorySettingsPage_Proxy_Server_Configuration); |
| 723 |
proxyExpComposite.addExpansionListener(new ExpansionAdapter() { |
751 |
proxyExpComposite.addExpansionListener(new ExpansionAdapter() { |
|
Lines 727-753
Link Here
|
| 727 |
} |
755 |
} |
| 728 |
}); |
756 |
}); |
| 729 |
|
757 |
|
| 730 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(proxyExpComposite); |
758 |
GridDataFactory.fillDefaults().indent(0, 5).span(3, SWT.DEFAULT).applyTo(proxyExpComposite); |
| 731 |
|
759 |
|
| 732 |
proxyAuthComp = toolkit.createComposite(proxyExpComposite, SWT.NONE); |
760 |
proxyAuthComp = toolkit.createComposite(proxyExpComposite, SWT.NONE); |
| 733 |
GridLayout gridLayout2 = new GridLayout(); |
761 |
GridLayout gridLayout2 = new GridLayout(); |
| 734 |
gridLayout2.numColumns = 2; |
|
|
| 735 |
gridLayout2.verticalSpacing = 0; |
762 |
gridLayout2.verticalSpacing = 0; |
|
|
763 |
gridLayout2.numColumns = 3; |
| 736 |
proxyAuthComp.setLayout(gridLayout2); |
764 |
proxyAuthComp.setLayout(gridLayout2); |
| 737 |
proxyAuthComp.setBackground(compositeContainer.getBackground()); |
765 |
proxyAuthComp.setBackground(compositeContainer.getBackground()); |
| 738 |
proxyExpComposite.setClient(proxyAuthComp); |
766 |
proxyExpComposite.setClient(proxyAuthComp); |
| 739 |
|
767 |
|
| 740 |
Composite settingsComposite = new Composite(proxyAuthComp, SWT.NULL); |
768 |
Composite systemSettingsComposite = new Composite(proxyAuthComp, SWT.NULL); |
| 741 |
GridLayout gridLayout3 = new GridLayout(); |
769 |
GridLayout gridLayout3 = new GridLayout(); |
| 742 |
gridLayout3.numColumns = 2; |
|
|
| 743 |
gridLayout3.verticalSpacing = 0; |
770 |
gridLayout3.verticalSpacing = 0; |
| 744 |
settingsComposite.setLayout(gridLayout3); |
771 |
gridLayout3.numColumns = 2; |
|
|
772 |
gridLayout3.marginWidth = 0; |
| 773 |
systemSettingsComposite.setLayout(gridLayout3); |
| 745 |
|
774 |
|
| 746 |
systemProxyButton = new Button(settingsComposite, SWT.CHECK); |
775 |
systemProxyButton = new Button(systemSettingsComposite, SWT.CHECK); |
| 747 |
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(settingsComposite); |
776 |
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(3, SWT.DEFAULT).applyTo(systemSettingsComposite); |
| 748 |
|
777 |
|
| 749 |
systemProxyButton.setText(Messages.AbstractRepositorySettingsPage_Use_global_Network_Connections_preferences); |
778 |
systemProxyButton.setText(Messages.AbstractRepositorySettingsPage_Use_global_Network_Connections_preferences); |
| 750 |
Hyperlink changeProxySettingsLink = toolkit.createHyperlink(settingsComposite, |
779 |
|
|
|
780 |
systemProxyButton.addSelectionListener(new SelectionListener() { |
| 781 |
public void widgetSelected(SelectionEvent e) { |
| 782 |
setUseDefaultProxy(systemProxyButton.getSelection()); |
| 783 |
} |
| 784 |
|
| 785 |
public void widgetDefaultSelected(SelectionEvent e) { |
| 786 |
// ignore |
| 787 |
} |
| 788 |
}); |
| 789 |
|
| 790 |
Hyperlink changeProxySettingsLink = toolkit.createHyperlink(systemSettingsComposite, |
| 751 |
Messages.AbstractRepositorySettingsPage_Change_Settings, SWT.NULL); |
791 |
Messages.AbstractRepositorySettingsPage_Change_Settings, SWT.NULL); |
| 752 |
changeProxySettingsLink.setBackground(compositeContainer.getBackground()); |
792 |
changeProxySettingsLink.setBackground(compositeContainer.getBackground()); |
| 753 |
changeProxySettingsLink.addHyperlinkListener(new IHyperlinkListener() { |
793 |
changeProxySettingsLink.addHyperlinkListener(new IHyperlinkListener() { |
|
Lines 767-775
Link Here
|
| 767 |
} |
807 |
} |
| 768 |
}); |
808 |
}); |
| 769 |
|
809 |
|
| 770 |
systemProxyButton.addSelectionListener(new SelectionListener() { |
810 |
proxyAuthButton = new Button(proxyAuthComp, SWT.CHECK); |
|
|
811 |
GridDataFactory.fillDefaults().span(3, SWT.DEFAULT).applyTo(proxyAuthButton); |
| 812 |
proxyAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enable_proxy_authentication); |
| 813 |
proxyAuthButton.addSelectionListener(new SelectionListener() { |
| 771 |
public void widgetSelected(SelectionEvent e) { |
814 |
public void widgetSelected(SelectionEvent e) { |
| 772 |
setUseDefaultProxy(systemProxyButton.getSelection()); |
815 |
setProxyAuth(proxyAuthButton.getSelection()); |
| 773 |
} |
816 |
} |
| 774 |
|
817 |
|
| 775 |
public void widgetDefaultSelected(SelectionEvent e) { |
818 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
Lines 793-804
Link Here
|
| 793 |
getWizard().getContainer().updateButtons(); |
836 |
getWizard().getContainer().updateButtons(); |
| 794 |
} |
837 |
} |
| 795 |
} |
838 |
} |
|
|
839 |
|
| 840 |
@Override |
| 841 |
public int getNumberOfControls() { |
| 842 |
return 3; |
| 843 |
} |
| 796 |
}; |
844 |
}; |
| 797 |
proxyHostnameEditor.setStringValue(oldProxyHostname); |
845 |
proxyHostnameEditor.setStringValue(oldProxyHostname); |
| 798 |
|
846 |
|
| 799 |
proxyPortEditor = new RepositoryStringFieldEditor( |
847 |
proxyPortEditor = new RepositoryStringFieldEditor( |
| 800 |
"", Messages.AbstractRepositorySettingsPage_Proxy_host_port_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
848 |
"", Messages.AbstractRepositorySettingsPage_Proxy_host_port_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
| 801 |
proxyAuthComp); |
849 |
proxyAuthComp) { |
|
|
850 |
|
| 851 |
@Override |
| 852 |
public int getNumberOfControls() { |
| 853 |
return 3; |
| 854 |
} |
| 855 |
}; |
| 802 |
|
856 |
|
| 803 |
proxyPortEditor.setStringValue(oldProxyPort); |
857 |
proxyPortEditor.setStringValue(oldProxyPort); |
| 804 |
|
858 |
|
|
Lines 807-826
Link Here
|
| 807 |
|
861 |
|
| 808 |
// ************* PROXY AUTHENTICATION ************** |
862 |
// ************* PROXY AUTHENTICATION ************** |
| 809 |
|
863 |
|
| 810 |
proxyAuthButton = new Button(proxyAuthComp, SWT.CHECK); |
|
|
| 811 |
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(proxyAuthButton); |
| 812 |
|
| 813 |
proxyAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enable_proxy_authentication); |
| 814 |
proxyAuthButton.addSelectionListener(new SelectionListener() { |
| 815 |
public void widgetSelected(SelectionEvent e) { |
| 816 |
setProxyAuth(proxyAuthButton.getSelection()); |
| 817 |
} |
| 818 |
|
| 819 |
public void widgetDefaultSelected(SelectionEvent e) { |
| 820 |
// ignore |
| 821 |
} |
| 822 |
}); |
| 823 |
|
| 824 |
proxyUserNameEditor = new StringFieldEditor( |
864 |
proxyUserNameEditor = new StringFieldEditor( |
| 825 |
"", Messages.AbstractRepositorySettingsPage_User_ID_, StringFieldEditor.UNLIMITED, proxyAuthComp) { //$NON-NLS-1$ |
865 |
"", Messages.AbstractRepositorySettingsPage_User_ID_, StringFieldEditor.UNLIMITED, proxyAuthComp) { //$NON-NLS-1$ |
| 826 |
|
866 |
|
|
Lines 836-845
Link Here
|
| 836 |
getWizard().getContainer().updateButtons(); |
876 |
getWizard().getContainer().updateButtons(); |
| 837 |
} |
877 |
} |
| 838 |
} |
878 |
} |
|
|
879 |
|
| 880 |
@Override |
| 881 |
public int getNumberOfControls() { |
| 882 |
return 3; |
| 883 |
} |
| 839 |
}; |
884 |
}; |
|
|
885 |
|
| 840 |
proxyPasswordEditor = new RepositoryStringFieldEditor( |
886 |
proxyPasswordEditor = new RepositoryStringFieldEditor( |
| 841 |
"", Messages.AbstractRepositorySettingsPage_Password_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
887 |
"", Messages.AbstractRepositorySettingsPage_Password_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ |
| 842 |
proxyAuthComp); |
888 |
proxyAuthComp) { |
|
|
889 |
@Override |
| 890 |
public int getNumberOfControls() { |
| 891 |
return 2; |
| 892 |
} |
| 893 |
}; |
| 843 |
((RepositoryStringFieldEditor) proxyPasswordEditor).getTextControl().setEchoChar('*'); |
894 |
((RepositoryStringFieldEditor) proxyPasswordEditor).getTextControl().setEchoChar('*'); |
| 844 |
|
895 |
|
| 845 |
// proxyPasswordEditor.setEnabled(httpAuthButton.getSelection(), |
896 |
// proxyPasswordEditor.setEnabled(httpAuthButton.getSelection(), |
|
Lines 848-856
Link Here
|
| 848 |
// httpAuthPasswordEditor).setEnabled(httpAuthButton.getSelection(), |
899 |
// httpAuthPasswordEditor).setEnabled(httpAuthButton.getSelection(), |
| 849 |
// advancedComp); |
900 |
// advancedComp); |
| 850 |
|
901 |
|
|
|
902 |
// need to increase column number here, because above string editor will use them if declared beforehand |
| 903 |
((GridLayout) (proxyAuthComp.getLayout())).numColumns++; |
| 851 |
saveProxyPasswordButton = new Button(proxyAuthComp, SWT.CHECK); |
904 |
saveProxyPasswordButton = new Button(proxyAuthComp, SWT.CHECK); |
| 852 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(saveProxyPasswordButton); |
905 |
saveProxyPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Password); |
| 853 |
saveProxyPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Proxy_Password); |
|
|
| 854 |
saveProxyPasswordButton.setEnabled(proxyAuthButton.getSelection()); |
906 |
saveProxyPasswordButton.setEnabled(proxyAuthButton.getSelection()); |
| 855 |
|
907 |
|
| 856 |
if (repository != null) { |
908 |
if (repository != null) { |
|
Lines 867-873
Link Here
|
| 867 |
|
919 |
|
| 868 |
private void addContributionSection() { |
920 |
private void addContributionSection() { |
| 869 |
Composite composite = toolkit.createComposite(compositeContainer); |
921 |
Composite composite = toolkit.createComposite(compositeContainer); |
| 870 |
GridDataFactory.fillDefaults().grab(true, false).span(2, SWT.DEFAULT).applyTo(composite); |
922 |
GridDataFactory.fillDefaults().grab(true, false).span(3, SWT.DEFAULT).applyTo(composite); |
| 871 |
|
923 |
|
| 872 |
GridLayout layout = new GridLayout(1, false); |
924 |
GridLayout layout = new GridLayout(1, false); |
| 873 |
layout.marginWidth = 0; |
925 |
layout.marginWidth = 0; |
|
Lines 879-917
Link Here
|
| 879 |
createContributionControls(composite); |
931 |
createContributionControls(composite); |
| 880 |
} |
932 |
} |
| 881 |
|
933 |
|
| 882 |
private void addStatusSection() { |
|
|
| 883 |
ExpandableComposite statusComposite = toolkit.createExpandableComposite(compositeContainer, |
| 884 |
ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); |
| 885 |
statusComposite.clientVerticalSpacing = 0; |
| 886 |
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false); |
| 887 |
gd.horizontalIndent = -5; |
| 888 |
statusComposite.setLayoutData(gd); |
| 889 |
statusComposite.setFont(compositeContainer.getFont()); |
| 890 |
statusComposite.setBackground(compositeContainer.getBackground()); |
| 891 |
statusComposite.setText(Messages.AbstractRepositorySettingsPage_Status); |
| 892 |
statusComposite.addExpansionListener(new ExpansionAdapter() { |
| 893 |
@Override |
| 894 |
public void expansionStateChanged(ExpansionEvent e) { |
| 895 |
getControl().getShell().pack(); |
| 896 |
} |
| 897 |
}); |
| 898 |
GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(statusComposite); |
| 899 |
|
| 900 |
Composite composite = toolkit.createComposite(statusComposite, SWT.NONE); |
| 901 |
GridLayout layout = new GridLayout(); |
| 902 |
layout.numColumns = 2; |
| 903 |
layout.verticalSpacing = 0; |
| 904 |
composite.setLayout(layout); |
| 905 |
composite.setBackground(compositeContainer.getBackground()); |
| 906 |
statusComposite.setClient(composite); |
| 907 |
|
| 908 |
disconnectedButton = new Button(composite, SWT.CHECK); |
| 909 |
disconnectedButton.setText(Messages.AbstractRepositorySettingsPage_Disconnected); |
| 910 |
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(disconnectedButton); |
| 911 |
disconnectedButton.setSelection(repository != null ? repository.isOffline() : false); |
| 912 |
statusComposite.setExpanded(disconnectedButton.getSelection()); |
| 913 |
} |
| 914 |
|
| 915 |
protected void setEncoding(String encoding) { |
934 |
protected void setEncoding(String encoding) { |
| 916 |
if (encoding.equals(TaskRepository.DEFAULT_CHARACTER_ENCODING)) { |
935 |
if (encoding.equals(TaskRepository.DEFAULT_CHARACTER_ENCODING)) { |
| 917 |
setDefaultEncoding(); |
936 |
setDefaultEncoding(); |