|
Lines 20-26
Link Here
|
| 20 |
import org.eclipse.core.runtime.IStatus; |
20 |
import org.eclipse.core.runtime.IStatus; |
| 21 |
import org.eclipse.core.runtime.NullProgressMonitor; |
21 |
import org.eclipse.core.runtime.NullProgressMonitor; |
| 22 |
import org.eclipse.core.runtime.Status; |
22 |
import org.eclipse.core.runtime.Status; |
|
|
23 |
import org.eclipse.jface.layout.GridDataFactory; |
| 23 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
24 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
|
|
25 |
import org.eclipse.jface.preference.StringFieldEditor; |
| 24 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; |
26 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; |
| 25 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientFactory; |
27 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientFactory; |
| 26 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; |
28 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; |
|
Lines 38-49
Link Here
|
| 38 |
import org.eclipse.swt.events.SelectionAdapter; |
40 |
import org.eclipse.swt.events.SelectionAdapter; |
| 39 |
import org.eclipse.swt.events.SelectionEvent; |
41 |
import org.eclipse.swt.events.SelectionEvent; |
| 40 |
import org.eclipse.swt.events.SelectionListener; |
42 |
import org.eclipse.swt.events.SelectionListener; |
|
|
43 |
import org.eclipse.swt.layout.GridData; |
| 41 |
import org.eclipse.swt.layout.GridLayout; |
44 |
import org.eclipse.swt.layout.GridLayout; |
| 42 |
import org.eclipse.swt.widgets.Button; |
45 |
import org.eclipse.swt.widgets.Button; |
| 43 |
import org.eclipse.swt.widgets.Combo; |
46 |
import org.eclipse.swt.widgets.Combo; |
| 44 |
import org.eclipse.swt.widgets.Composite; |
47 |
import org.eclipse.swt.widgets.Composite; |
| 45 |
import org.eclipse.swt.widgets.Label; |
48 |
import org.eclipse.swt.widgets.Label; |
| 46 |
import org.eclipse.ui.PlatformUI; |
49 |
import org.eclipse.ui.PlatformUI; |
|
|
50 |
import org.eclipse.ui.forms.events.ExpansionAdapter; |
| 51 |
import org.eclipse.ui.forms.events.ExpansionEvent; |
| 52 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
| 53 |
import org.eclipse.ui.forms.widgets.Section; |
| 47 |
|
54 |
|
| 48 |
/** |
55 |
/** |
| 49 |
* @author Mik Kersten |
56 |
* @author Mik Kersten |
|
Lines 85-90
Link Here
|
| 85 |
|
92 |
|
| 86 |
private String os = null; |
93 |
private String os = null; |
| 87 |
|
94 |
|
|
|
95 |
private Composite httpStringComp; |
| 96 |
|
| 97 |
private ExpandableComposite httpStringComposite; |
| 98 |
|
| 99 |
protected static final String HTTP_ERROR_LOGIN = "Login : "; |
| 100 |
|
| 101 |
protected StringFieldEditor htmlErrorLogin; |
| 102 |
|
| 103 |
protected static final String HTTP_ERROR_INVALID = "Invalid : "; |
| 104 |
|
| 105 |
protected StringFieldEditor htmlErrorInvalid; |
| 106 |
|
| 107 |
protected static final String HTTP_ERROR_PASSWORD = "Password : "; |
| 108 |
|
| 109 |
protected StringFieldEditor htmlErrorPassword; |
| 110 |
|
| 111 |
protected static final String HTTP_ERROR_CHECK_EMAIL = "check Email : "; |
| 112 |
|
| 113 |
protected StringFieldEditor htmlErrorCheckEMail; |
| 114 |
|
| 115 |
protected static final String HTTP_ERROR_COLLISION = "collision : "; |
| 116 |
|
| 117 |
protected StringFieldEditor htmlErrorCollision; |
| 118 |
|
| 119 |
protected static final String HTTP_ERROR_COMMENT_REQUIRED = "comment required : "; |
| 120 |
|
| 121 |
protected StringFieldEditor htmlErrorCommentRequired; |
| 122 |
|
| 123 |
protected static final String HTTP_ERROR_LOGGED_OUT = "logged out : "; |
| 124 |
|
| 125 |
protected StringFieldEditor htmlErrorLoggedOut; |
| 126 |
|
| 127 |
protected static final String HTTP_STRING_PROCESSED = "processed : "; |
| 128 |
|
| 129 |
protected StringFieldEditor htmlStringProcessed; |
| 130 |
|
| 88 |
public BugzillaRepositorySettingsPage(AbstractRepositoryConnectorUi repositoryUi) { |
131 |
public BugzillaRepositorySettingsPage(AbstractRepositoryConnectorUi repositoryUi) { |
| 89 |
super(TITLE, DESCRIPTION, repositoryUi); |
132 |
super(TITLE, DESCRIPTION, repositoryUi); |
| 90 |
setNeedsAnonymousLogin(true); |
133 |
setNeedsAnonymousLogin(true); |
|
Lines 265-270
Link Here
|
| 265 |
defaultOSCombo = new Combo(platformOSContainer, SWT.READ_ONLY); |
308 |
defaultOSCombo = new Combo(platformOSContainer, SWT.READ_ONLY); |
| 266 |
populateOsCombo(); |
309 |
populateOsCombo(); |
| 267 |
|
310 |
|
|
|
311 |
httpStringComposite = toolkit.createExpandableComposite(compositeContainer, Section.COMPACT | Section.TWISTIE |
| 312 |
| Section.TITLE_BAR); |
| 313 |
httpStringComposite.clientVerticalSpacing = 0; |
| 314 |
GridData gridData_2 = new GridData(SWT.FILL, SWT.FILL, true, false); |
| 315 |
gridData_2.horizontalIndent = -5; |
| 316 |
httpStringComposite.setLayoutData(gridData_2); |
| 317 |
httpStringComposite.setFont(compositeContainer.getFont()); |
| 318 |
httpStringComposite.setBackground(compositeContainer.getBackground()); |
| 319 |
httpStringComposite.setText("Bugzilla HTTP Response Strings"); |
| 320 |
httpStringComposite.addExpansionListener(new ExpansionAdapter() { |
| 321 |
@Override |
| 322 |
public void expansionStateChanged(ExpansionEvent e) { |
| 323 |
getControl().getShell().pack(); |
| 324 |
} |
| 325 |
}); |
| 326 |
|
| 327 |
GridDataFactory.fillDefaults().span(4, SWT.DEFAULT).applyTo(httpStringComposite); |
| 328 |
|
| 329 |
httpStringComp = toolkit.createComposite(httpStringComposite, SWT.NONE); |
| 330 |
GridLayout gridLayout2 = new GridLayout(); |
| 331 |
gridLayout2.numColumns = 4; |
| 332 |
gridLayout2.verticalSpacing = 0; |
| 333 |
httpStringComp.setLayout(gridLayout2); |
| 334 |
httpStringComp.setBackground(compositeContainer.getBackground()); |
| 335 |
httpStringComposite.setClient(httpStringComp); |
| 336 |
|
| 337 |
htmlErrorLogin = new StringFieldEditor("", HTTP_ERROR_LOGIN, StringFieldEditor.UNLIMITED, httpStringComp) { |
| 338 |
|
| 339 |
@Override |
| 340 |
protected boolean doCheckState() { |
| 341 |
return true; |
| 342 |
} |
| 343 |
|
| 344 |
@Override |
| 345 |
protected void valueChanged() { |
| 346 |
super.valueChanged(); |
| 347 |
isPageComplete(); |
| 348 |
if (getWizard() != null) { |
| 349 |
getWizard().getContainer().updateButtons(); |
| 350 |
} |
| 351 |
} |
| 352 |
}; |
| 353 |
|
| 354 |
htmlErrorInvalid = new StringFieldEditor("", HTTP_ERROR_INVALID, StringFieldEditor.UNLIMITED, httpStringComp) { |
| 355 |
|
| 356 |
@Override |
| 357 |
protected boolean doCheckState() { |
| 358 |
return true; |
| 359 |
} |
| 360 |
|
| 361 |
@Override |
| 362 |
protected void valueChanged() { |
| 363 |
super.valueChanged(); |
| 364 |
isPageComplete(); |
| 365 |
if (getWizard() != null) { |
| 366 |
getWizard().getContainer().updateButtons(); |
| 367 |
} |
| 368 |
} |
| 369 |
}; |
| 370 |
|
| 371 |
htmlErrorPassword = new StringFieldEditor("", HTTP_ERROR_PASSWORD, StringFieldEditor.UNLIMITED, httpStringComp) { |
| 372 |
|
| 373 |
@Override |
| 374 |
protected boolean doCheckState() { |
| 375 |
return true; |
| 376 |
} |
| 377 |
|
| 378 |
@Override |
| 379 |
protected void valueChanged() { |
| 380 |
super.valueChanged(); |
| 381 |
isPageComplete(); |
| 382 |
if (getWizard() != null) { |
| 383 |
getWizard().getContainer().updateButtons(); |
| 384 |
} |
| 385 |
} |
| 386 |
}; |
| 387 |
|
| 388 |
htmlErrorCheckEMail = new StringFieldEditor("", HTTP_ERROR_CHECK_EMAIL, StringFieldEditor.UNLIMITED, |
| 389 |
httpStringComp) { |
| 390 |
|
| 391 |
@Override |
| 392 |
protected boolean doCheckState() { |
| 393 |
return true; |
| 394 |
} |
| 395 |
|
| 396 |
@Override |
| 397 |
protected void valueChanged() { |
| 398 |
super.valueChanged(); |
| 399 |
isPageComplete(); |
| 400 |
if (getWizard() != null) { |
| 401 |
getWizard().getContainer().updateButtons(); |
| 402 |
} |
| 403 |
} |
| 404 |
}; |
| 405 |
|
| 406 |
htmlErrorCollision = new StringFieldEditor("", HTTP_ERROR_COLLISION, StringFieldEditor.UNLIMITED, |
| 407 |
httpStringComp) { |
| 408 |
|
| 409 |
@Override |
| 410 |
protected boolean doCheckState() { |
| 411 |
return true; |
| 412 |
} |
| 413 |
|
| 414 |
@Override |
| 415 |
protected void valueChanged() { |
| 416 |
super.valueChanged(); |
| 417 |
isPageComplete(); |
| 418 |
if (getWizard() != null) { |
| 419 |
getWizard().getContainer().updateButtons(); |
| 420 |
} |
| 421 |
} |
| 422 |
}; |
| 423 |
htmlErrorCommentRequired = new StringFieldEditor("", HTTP_ERROR_COMMENT_REQUIRED, StringFieldEditor.UNLIMITED, |
| 424 |
httpStringComp) { |
| 425 |
|
| 426 |
@Override |
| 427 |
protected boolean doCheckState() { |
| 428 |
return true; |
| 429 |
} |
| 430 |
|
| 431 |
@Override |
| 432 |
protected void valueChanged() { |
| 433 |
super.valueChanged(); |
| 434 |
isPageComplete(); |
| 435 |
if (getWizard() != null) { |
| 436 |
getWizard().getContainer().updateButtons(); |
| 437 |
} |
| 438 |
} |
| 439 |
}; |
| 440 |
htmlErrorLoggedOut = new StringFieldEditor("", HTTP_ERROR_LOGGED_OUT, StringFieldEditor.UNLIMITED, |
| 441 |
httpStringComp) { |
| 442 |
|
| 443 |
@Override |
| 444 |
protected boolean doCheckState() { |
| 445 |
return true; |
| 446 |
} |
| 447 |
|
| 448 |
@Override |
| 449 |
protected void valueChanged() { |
| 450 |
super.valueChanged(); |
| 451 |
isPageComplete(); |
| 452 |
if (getWizard() != null) { |
| 453 |
getWizard().getContainer().updateButtons(); |
| 454 |
} |
| 455 |
} |
| 456 |
}; |
| 457 |
htmlStringProcessed = new StringFieldEditor("", HTTP_STRING_PROCESSED, StringFieldEditor.UNLIMITED, |
| 458 |
httpStringComp) { |
| 459 |
|
| 460 |
@Override |
| 461 |
protected boolean doCheckState() { |
| 462 |
return true; |
| 463 |
} |
| 464 |
|
| 465 |
@Override |
| 466 |
protected void valueChanged() { |
| 467 |
super.valueChanged(); |
| 468 |
isPageComplete(); |
| 469 |
if (getWizard() != null) { |
| 470 |
getWizard().getContainer().updateButtons(); |
| 471 |
} |
| 472 |
} |
| 473 |
}; |
| 474 |
if (repository != null) { |
| 475 |
String propertyValue; |
| 476 |
propertyValue = repository.getProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_LOGIN); |
| 477 |
if (propertyValue == null) |
| 478 |
propertyValue = IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_ERROR_LOGIN; |
| 479 |
htmlErrorLogin.setStringValue(propertyValue); |
| 480 |
propertyValue = repository.getProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_INVALID); |
| 481 |
if (propertyValue == null) |
| 482 |
propertyValue = IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_ERROR_INVALID; |
| 483 |
htmlErrorInvalid.setStringValue(propertyValue); |
| 484 |
propertyValue = repository.getProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_PASSWORD); |
| 485 |
if (propertyValue == null) |
| 486 |
propertyValue = IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_ERROR_PASSWORD; |
| 487 |
htmlErrorPassword.setStringValue(propertyValue); |
| 488 |
propertyValue = repository.getProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_CHECK_EMAIL); |
| 489 |
if (propertyValue == null) |
| 490 |
propertyValue = IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_ERROR_CHECK_EMAIL; |
| 491 |
htmlErrorCheckEMail.setStringValue(propertyValue); |
| 492 |
propertyValue = repository.getProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_COLLISION); |
| 493 |
if (propertyValue == null) |
| 494 |
propertyValue = IBugzillaConstants.ERROR_MIDAIR_COLLISION; |
| 495 |
htmlErrorCollision.setStringValue(propertyValue); |
| 496 |
propertyValue = repository.getProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_COMMENT_REQUIRED); |
| 497 |
if (propertyValue == null) |
| 498 |
propertyValue = IBugzillaConstants.ERROR_COMMENT_REQUIRED; |
| 499 |
htmlErrorCommentRequired.setStringValue(propertyValue); |
| 500 |
propertyValue = repository.getProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_LOGGED_OUT); |
| 501 |
if (propertyValue == null) |
| 502 |
propertyValue = IBugzillaConstants.LOGGED_OUT; |
| 503 |
htmlErrorLoggedOut.setStringValue(propertyValue); |
| 504 |
propertyValue = repository.getProperty(IBugzillaConstants.REPOSITORY_HTTP_STRING_PROCESSED); |
| 505 |
if (propertyValue == null) |
| 506 |
propertyValue = IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_STRING_PROCESSED; |
| 507 |
htmlStringProcessed.setStringValue(propertyValue); |
| 508 |
} else { |
| 509 |
htmlErrorLogin.setStringValue(IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_ERROR_LOGIN); |
| 510 |
htmlErrorInvalid.setStringValue(IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_ERROR_INVALID); |
| 511 |
htmlErrorPassword.setStringValue(IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_ERROR_PASSWORD); |
| 512 |
htmlErrorCheckEMail.setStringValue(IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_ERROR_CHECK_EMAIL); |
| 513 |
htmlErrorCollision.setStringValue(IBugzillaConstants.ERROR_MIDAIR_COLLISION); |
| 514 |
htmlErrorCommentRequired.setStringValue(IBugzillaConstants.ERROR_COMMENT_REQUIRED); |
| 515 |
htmlErrorLoggedOut.setStringValue(IBugzillaConstants.LOGGED_OUT); |
| 516 |
htmlStringProcessed.setStringValue(IBugzillaConstants.REPOSITORY_HTTP_DEFAULT_STRING_PROCESSED); |
| 517 |
} |
| 268 |
} |
518 |
} |
| 269 |
|
519 |
|
| 270 |
private void populateOsCombo() { |
520 |
private void populateOsCombo() { |
|
Lines 361-366
Link Here
|
| 361 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM); |
611 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_PLATFORM); |
| 362 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_OS); |
612 |
repository.removeProperty(IBugzillaConstants.BUGZILLA_DEF_OS); |
| 363 |
} |
613 |
} |
|
|
614 |
repository.setProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_LOGIN, htmlErrorLogin.getStringValue()); |
| 615 |
repository.setProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_INVALID, htmlErrorInvalid.getStringValue()); |
| 616 |
repository.setProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_PASSWORD, htmlErrorPassword.getStringValue()); |
| 617 |
repository.setProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_CHECK_EMAIL, |
| 618 |
htmlErrorCheckEMail.getStringValue()); |
| 619 |
repository.setProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_COLLISION, htmlErrorCollision.getStringValue()); |
| 620 |
repository.setProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_COMMENT_REQUIRED, |
| 621 |
htmlErrorCommentRequired.getStringValue()); |
| 622 |
repository.setProperty(IBugzillaConstants.REPOSITORY_HTTP_ERROR_LOGGED_OUT, htmlErrorLoggedOut.getStringValue()); |
| 623 |
repository.setProperty(IBugzillaConstants.REPOSITORY_HTTP_STRING_PROCESSED, |
| 624 |
htmlStringProcessed.getStringValue()); |
| 625 |
|
| 364 |
} |
626 |
} |
| 365 |
|
627 |
|
| 366 |
@Override |
628 |
@Override |
|
Lines 372-377
Link Here
|
| 372 |
erg = false; |
634 |
erg = false; |
| 373 |
} |
635 |
} |
| 374 |
} |
636 |
} |
|
|
637 |
if (erg) { |
| 638 |
if (htmlErrorLogin != null && htmlErrorLogin.getStringValue().compareTo("")== 0) { |
| 639 |
setErrorMessage("Bugzilla HTTP Response: login field must be filled "); |
| 640 |
erg = false; |
| 641 |
} |
| 642 |
} |
| 643 |
if (erg) { |
| 644 |
if (htmlErrorInvalid != null && htmlErrorInvalid.getStringValue().compareTo("")== 0) { |
| 645 |
setErrorMessage("Bugzilla HTTP Response: invalid field must be filled "); |
| 646 |
erg = false; |
| 647 |
} |
| 648 |
} |
| 649 |
if (erg) { |
| 650 |
if (htmlErrorPassword != null && htmlErrorPassword.getStringValue().compareTo("")== 0) { |
| 651 |
setErrorMessage("Bugzilla HTTP Response: password field must be filled "); |
| 652 |
erg = false; |
| 653 |
} |
| 654 |
} |
| 655 |
if (erg) { |
| 656 |
if (htmlErrorCheckEMail != null && htmlErrorCheckEMail.getStringValue().compareTo("")== 0) { |
| 657 |
setErrorMessage("Bugzilla HTTP Response: check eMail field must be filled "); |
| 658 |
erg = false; |
| 659 |
} |
| 660 |
} |
| 661 |
if (erg) { |
| 662 |
if (htmlErrorCollision != null && htmlErrorCollision.getStringValue().compareTo("")== 0) { |
| 663 |
setErrorMessage("Bugzilla HTTP Response: collision field must be filled "); |
| 664 |
erg = false; |
| 665 |
} |
| 666 |
} |
| 667 |
if (erg) { |
| 668 |
if (htmlErrorCommentRequired != null && htmlErrorCommentRequired.getStringValue().compareTo("")== 0) { |
| 669 |
setErrorMessage("Bugzilla HTTP Response: comment required field must be filled "); |
| 670 |
erg = false; |
| 671 |
} |
| 672 |
} |
| 673 |
if (erg) { |
| 674 |
if (htmlErrorLoggedOut != null && htmlErrorLoggedOut.getStringValue().compareTo("")== 0) { |
| 675 |
setErrorMessage("Bugzilla HTTP Response: clogged out field must be filled "); |
| 676 |
erg = false; |
| 677 |
} |
| 678 |
} |
| 679 |
if (erg) { |
| 680 |
if (htmlStringProcessed != null && htmlStringProcessed.getStringValue().compareTo("")== 0) { |
| 681 |
setErrorMessage("Bugzilla HTTP Response: processed field must be filled "); |
| 682 |
erg = false; |
| 683 |
} |
| 684 |
} |
| 375 |
return erg; |
685 |
return erg; |
| 376 |
} |
686 |
} |
| 377 |
|
687 |
|