|
Lines 14-20
Link Here
|
| 14 |
import java.util.ArrayList; |
14 |
import java.util.ArrayList; |
| 15 |
import java.util.Arrays; |
15 |
import java.util.Arrays; |
| 16 |
import java.util.HashMap; |
16 |
import java.util.HashMap; |
| 17 |
import java.util.Iterator; |
|
|
| 18 |
import java.util.List; |
17 |
import java.util.List; |
| 19 |
import java.util.Map; |
18 |
import java.util.Map; |
| 20 |
import java.util.Set; |
19 |
import java.util.Set; |
|
Lines 35-41
Link Here
|
| 35 |
import org.eclipse.jface.viewers.ISelectionProvider; |
34 |
import org.eclipse.jface.viewers.ISelectionProvider; |
| 36 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
35 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
| 37 |
import org.eclipse.jface.viewers.StructuredSelection; |
36 |
import org.eclipse.jface.viewers.StructuredSelection; |
| 38 |
import org.eclipse.mylar.bugzilla.core.Attribute; |
37 |
import org.eclipse.mylar.bugzilla.core.AbstractRepositoryReport; |
|
|
38 |
import org.eclipse.mylar.bugzilla.core.AbstractRepositoryReportAttribute; |
| 39 |
import org.eclipse.mylar.bugzilla.core.BugzillaReport; |
| 39 |
import org.eclipse.mylar.bugzilla.core.Comment; |
40 |
import org.eclipse.mylar.bugzilla.core.Comment; |
| 40 |
import org.eclipse.mylar.bugzilla.core.IBugzillaBug; |
41 |
import org.eclipse.mylar.bugzilla.core.IBugzillaBug; |
| 41 |
import org.eclipse.mylar.internal.bugzilla.core.BugzillaPlugin; |
42 |
import org.eclipse.mylar.internal.bugzilla.core.BugzillaPlugin; |
|
Lines 43-48
Link Here
|
| 43 |
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaAttributeListener; |
44 |
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaAttributeListener; |
| 44 |
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants; |
45 |
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants; |
| 45 |
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaReportSelection; |
46 |
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaReportSelection; |
|
|
47 |
import org.eclipse.mylar.internal.bugzilla.core.internal.BugzillaReportElement; |
| 46 |
import org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaRepositoryConnector; |
48 |
import org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaRepositoryConnector; |
| 47 |
import org.eclipse.mylar.internal.core.util.MylarStatusHandler; |
49 |
import org.eclipse.mylar.internal.core.util.MylarStatusHandler; |
| 48 |
import org.eclipse.mylar.internal.tasklist.ui.editors.MylarTaskEditor; |
50 |
import org.eclipse.mylar.internal.tasklist.ui.editors.MylarTaskEditor; |
|
Lines 170-176
Link Here
|
| 170 |
|
172 |
|
| 171 |
protected final int HORZ_INDENT = 0; |
173 |
protected final int HORZ_INDENT = 0; |
| 172 |
|
174 |
|
| 173 |
protected CCombo oSCombo; |
175 |
protected CCombo attributeCombo; |
| 174 |
|
176 |
|
| 175 |
protected CCombo versionCombo; |
177 |
protected CCombo versionCombo; |
| 176 |
|
178 |
|
|
Lines 257-263
Link Here
|
| 257 |
|
259 |
|
| 258 |
protected List<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>(); |
260 |
protected List<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>(); |
| 259 |
|
261 |
|
| 260 |
protected HashMap<CCombo, String> comboListenerMap = new HashMap<CCombo, String>(); |
262 |
protected HashMap<CCombo, AbstractRepositoryReportAttribute> comboListenerMap = new HashMap<CCombo, AbstractRepositoryReportAttribute>(); |
| 261 |
|
263 |
|
| 262 |
private IBugzillaReportSelection lastSelected = null; |
264 |
private IBugzillaReportSelection lastSelected = null; |
| 263 |
|
265 |
|
|
Lines 309-317
Link Here
|
| 309 |
if (comboListenerMap.containsKey(combo)) { |
311 |
if (comboListenerMap.containsKey(combo)) { |
| 310 |
if (combo.getSelectionIndex() > -1) { |
312 |
if (combo.getSelectionIndex() > -1) { |
| 311 |
String sel = combo.getItem(combo.getSelectionIndex()); |
313 |
String sel = combo.getItem(combo.getSelectionIndex()); |
| 312 |
Attribute attribute = getBug().getAttribute(comboListenerMap.get(combo)); |
314 |
AbstractRepositoryReportAttribute attribute = comboListenerMap.get(combo); |
| 313 |
if (sel != null && !(sel.equals(attribute.getNewValue()))) { |
315 |
if (sel != null && !(sel.equals(attribute.getValue()))) { |
| 314 |
attribute.setNewValue(sel); |
316 |
attribute.setValue(sel); |
| 315 |
for (IBugzillaAttributeListener client : attributesListeners) { |
317 |
for (IBugzillaAttributeListener client : attributesListeners) { |
| 316 |
client.attributeChanged(attribute.getName(), sel); |
318 |
client.attributeChanged(attribute.getName(), sel); |
| 317 |
} |
319 |
} |
|
Lines 382-387
Link Here
|
| 382 |
*/ |
384 |
*/ |
| 383 |
public abstract IBugzillaBug getBug(); |
385 |
public abstract IBugzillaBug getBug(); |
| 384 |
|
386 |
|
|
|
387 |
// TODO: temporary as part of conversion to xml |
| 388 |
public AbstractRepositoryReport getReport() { |
| 389 |
return (AbstractRepositoryReport) getBug(); |
| 390 |
} |
| 391 |
|
| 385 |
/** |
392 |
/** |
| 386 |
* @return Any currently selected text. |
393 |
* @return Any currently selected text. |
| 387 |
*/ |
394 |
*/ |
|
Lines 429-435
Link Here
|
| 429 |
Composite headerInfoComposite = toolkit.createComposite(editorComposite); |
436 |
Composite headerInfoComposite = toolkit.createComposite(editorComposite); |
| 430 |
headerInfoComposite.setLayout(new GridLayout(6, false)); |
437 |
headerInfoComposite.setLayout(new GridLayout(6, false)); |
| 431 |
toolkit.createLabel(headerInfoComposite, "Bug# ").setFont(TITLE_FONT); |
438 |
toolkit.createLabel(headerInfoComposite, "Bug# ").setFont(TITLE_FONT); |
| 432 |
toolkit.createText(headerInfoComposite, "" + getBug().getId()); |
439 |
toolkit.createText(headerInfoComposite, "" + getReport().getId()); |
| 433 |
|
440 |
|
| 434 |
toolkit.createLabel(headerInfoComposite, " Opened: ").setFont(TITLE_FONT); |
441 |
toolkit.createLabel(headerInfoComposite, " Opened: ").setFont(TITLE_FONT); |
| 435 |
String openedDateString = ""; |
442 |
String openedDateString = ""; |
|
Lines 490-495
Link Here
|
| 490 |
getSite().registerContextMenu("#BugEditor", contextMenuManager, getSite().getSelectionProvider()); |
497 |
getSite().registerContextMenu("#BugEditor", contextMenuManager, getSite().getSelectionProvider()); |
| 491 |
} |
498 |
} |
| 492 |
|
499 |
|
|
|
500 |
// /** |
| 501 |
// * Creates the attribute layout, which contains most of the basic |
| 502 |
// attributes |
| 503 |
// * of the bug (some of which are editable). |
| 504 |
// */ |
| 505 |
// protected void createAttributeLayout() { |
| 506 |
// |
| 507 |
// String title = getTitleString(); |
| 508 |
// String keywords = ""; |
| 509 |
// String url = ""; |
| 510 |
// |
| 511 |
// Section section = toolkit.createSection(form.getBody(), |
| 512 |
// ExpandableComposite.TITLE_BAR | Section.TWISTIE); |
| 513 |
// section.setText(LABEL_SECTION_ATTRIBUTES); |
| 514 |
// section.setExpanded(true); |
| 515 |
// section.setLayout(new GridLayout()); |
| 516 |
// section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 517 |
// |
| 518 |
// section.addExpansionListener(new IExpansionListener() { |
| 519 |
// public void expansionStateChanging(ExpansionEvent e) { |
| 520 |
// form.reflow(true); |
| 521 |
// } |
| 522 |
// |
| 523 |
// public void expansionStateChanged(ExpansionEvent e) { |
| 524 |
// form.reflow(true); |
| 525 |
// } |
| 526 |
// }); |
| 527 |
// |
| 528 |
// // Attributes Composite- this holds all the combo fiels and text fields |
| 529 |
// Composite attributesComposite = toolkit.createComposite(section); |
| 530 |
// GridLayout attributesLayout = new GridLayout(); |
| 531 |
// attributesLayout.numColumns = 4; |
| 532 |
// attributesLayout.horizontalSpacing = 14; |
| 533 |
// attributesLayout.verticalSpacing = 6; |
| 534 |
// attributesComposite.setLayout(attributesLayout); |
| 535 |
// GridData attributesData = new GridData(GridData.FILL_BOTH); |
| 536 |
// attributesData.horizontalSpan = 1; |
| 537 |
// attributesData.grabExcessVerticalSpace = false; |
| 538 |
// attributesComposite.setLayoutData(attributesData); |
| 539 |
// // attributesComposite.setBackground(background); |
| 540 |
// // End Attributes Composite |
| 541 |
// |
| 542 |
// section.setClient(attributesComposite); |
| 543 |
// |
| 544 |
// // Attributes Title Area |
| 545 |
// // Composite attributesTitleComposite = new |
| 546 |
// // Composite(attributesComposite, SWT.NONE); |
| 547 |
// // GridLayout attributesTitleLayout = new GridLayout(); |
| 548 |
// // attributesTitleLayout.horizontalSpacing = 0; |
| 549 |
// // attributesTitleLayout.marginWidth = 0; |
| 550 |
// // attributesTitleComposite.setLayout(attributesTitleLayout); |
| 551 |
// // attributesTitleComposite.setBackground(background); |
| 552 |
// // GridData attributesTitleData = new |
| 553 |
// // GridData(GridData.HORIZONTAL_ALIGN_FILL); |
| 554 |
// // attributesTitleData.horizontalSpan = 4; |
| 555 |
// // attributesTitleData.grabExcessVerticalSpace = false; |
| 556 |
// // attributesTitleComposite.setLayoutData(attributesTitleData); |
| 557 |
// // End Attributes Title |
| 558 |
// |
| 559 |
// // Set the Attributes Title |
| 560 |
// // newAttributesLayout(attributesTitleComposite); |
| 561 |
// // titleLabel.setText(title); |
| 562 |
// bugzillaInput.setToolTipText(title); |
| 563 |
// int currentCol = 1; |
| 564 |
// |
| 565 |
// // String ccValue = null; |
| 566 |
// |
| 567 |
// // Populate Attributes |
| 568 |
// for (Iterator<AbstractRepositoryReportAttribute> it = |
| 569 |
// getReport().getAttributes().iterator(); it.hasNext();) { |
| 570 |
// AbstractRepositoryReportAttribute attribute = it.next(); |
| 571 |
// String key = attribute.getID(); |
| 572 |
// String name = attribute.getName(); |
| 573 |
// String value = checkText(attribute.getValue()); |
| 574 |
// System.err.println(">>> AbstractBugEditor>> name: "+name+" key: "+key+" |
| 575 |
// value:"+value); |
| 576 |
// Map<String, String> values = attribute.getOptionValues(); |
| 577 |
// |
| 578 |
// // make sure we don't try to display a hidden field |
| 579 |
// if (attribute.isHidden() || (key != null && |
| 580 |
// key.equals("status_whiteboard"))) |
| 581 |
// continue; |
| 582 |
// |
| 583 |
// if (values == null) |
| 584 |
// values = new HashMap<String, String>(); |
| 585 |
// |
| 586 |
// if (key == null) |
| 587 |
// key = ""; |
| 588 |
// |
| 589 |
// GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); |
| 590 |
// data.horizontalSpan = 1; |
| 591 |
// data.horizontalIndent = HORZ_INDENT; |
| 592 |
// |
| 593 |
// if (key.equals(BugzillaReportElement.KEYWORDS.getKeyString())) { |
| 594 |
// keywords = attribute.getValue(); |
| 595 |
// } else if (key.equals(BugzillaReportElement.CC.getKeyString())) { |
| 596 |
// continue; |
| 597 |
// } else if (key.equals(BugzillaReportElement.NEWCC.getKeyString())) { |
| 598 |
// // force move to first column |
| 599 |
// if (currentCol > 1) { |
| 600 |
// while (currentCol <= attributesLayout.numColumns) { |
| 601 |
// newLayout(attributesComposite, 1, "", PROPERTY); |
| 602 |
// currentCol++; |
| 603 |
// } |
| 604 |
// } |
| 605 |
// addCCList(toolkit, "", attributesComposite); |
| 606 |
// } else if (key.equals(BugzillaReportElement.DEPENDSON.getKeyString())) { |
| 607 |
// // Dependson and blocked are multi valued so need to explicitly |
| 608 |
// // be parsed and shown in the AbstractBugEditor |
| 609 |
// continue; |
| 610 |
// } else if (key.equals(BugzillaReportElement.BLOCKED.getKeyString())) { |
| 611 |
// // Dependson and blocked are multi valued so need to explicitly |
| 612 |
// // be parsed and shown in the AbstractBugEditor |
| 613 |
// continue; |
| 614 |
// } else if (key.equals("bug_file_loc")) { |
| 615 |
// url = value; |
| 616 |
// } else if (key.equals("op_sys")) { |
| 617 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 618 |
// toolkit.createLabel(attributesComposite, name); |
| 619 |
// // oSCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | |
| 620 |
// // SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY);//SWT.NONE |
| 621 |
// oSCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.READ_ONLY); |
| 622 |
// // oSCombo = new Combo(attributesComposite, SWT.FLAT | |
| 623 |
// // SWT.READ_ONLY); |
| 624 |
// toolkit.adapt(oSCombo, true, true); |
| 625 |
// oSCombo.setFont(TEXT_FONT); |
| 626 |
// oSCombo.setLayoutData(data); |
| 627 |
// // oSCombo.setBackground(background); |
| 628 |
// Set<String> s = values.keySet(); |
| 629 |
// String[] a = s.toArray(new String[s.size()]); |
| 630 |
// Arrays.sort(a); |
| 631 |
// for (int i = 0; i < a.length; i++) { |
| 632 |
// oSCombo.add(a[i]); |
| 633 |
// } |
| 634 |
// if (oSCombo.indexOf(value) != -1) { |
| 635 |
// oSCombo.select(oSCombo.indexOf(value)); |
| 636 |
// } else { |
| 637 |
// oSCombo.select(oSCombo.indexOf("All")); |
| 638 |
// } |
| 639 |
// // oSCombo.addListener(SWT.Modify, this); |
| 640 |
// oSCombo.addSelectionListener(new ComboSelectionListener(oSCombo)); |
| 641 |
// comboListenerMap.put(oSCombo, attribute); |
| 642 |
// oSCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 643 |
// currentCol += 2; |
| 644 |
// } else if (key.equals("version")) { |
| 645 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 646 |
// toolkit.createLabel(attributesComposite, name); |
| 647 |
// versionCombo = new CCombo(attributesComposite, SWT.FLAT | |
| 648 |
// SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL |
| 649 |
// | SWT.READ_ONLY); |
| 650 |
// toolkit.adapt(versionCombo, true, true); |
| 651 |
// versionCombo.setFont(TEXT_FONT); |
| 652 |
// versionCombo.setLayoutData(data); |
| 653 |
// // versionCombo.setBackground(background); |
| 654 |
// Set<String> s = values.keySet(); |
| 655 |
// String[] a = s.toArray(new String[s.size()]); |
| 656 |
// Arrays.sort(a); |
| 657 |
// for (int i = 0; i < a.length; i++) { |
| 658 |
// versionCombo.add(a[i]); |
| 659 |
// } |
| 660 |
// versionCombo.select(versionCombo.indexOf(value)); |
| 661 |
// // versionCombo.addListener(SWT.Modify, this); |
| 662 |
// versionCombo.addSelectionListener(new |
| 663 |
// ComboSelectionListener(versionCombo)); |
| 664 |
// versionCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 665 |
// comboListenerMap.put(versionCombo, attribute); |
| 666 |
// currentCol += 2; |
| 667 |
// } else if (key.equals("priority")) { |
| 668 |
// // newLayout(attributesComposite, 1, "Priority", PROPERTY); |
| 669 |
// toolkit.createLabel(attributesComposite, name); |
| 670 |
// priorityCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.V_SCROLL | |
| 671 |
// SWT.READ_ONLY); |
| 672 |
// toolkit.adapt(priorityCombo, true, true); |
| 673 |
// priorityCombo.setFont(TEXT_FONT); |
| 674 |
// priorityCombo.setLayoutData(data); |
| 675 |
// // priorityCombo.setBackground(background); |
| 676 |
// Set<String> s = values.keySet(); |
| 677 |
// String[] a = s.toArray(new String[s.size()]); |
| 678 |
// Arrays.sort(a); |
| 679 |
// for (int i = 0; i < a.length; i++) { |
| 680 |
// priorityCombo.add(a[i]); |
| 681 |
// } |
| 682 |
// priorityCombo.select(priorityCombo.indexOf(value)); |
| 683 |
// // priorityCombo.addListener(SWT.Modify, this); |
| 684 |
// priorityCombo.addSelectionListener(new |
| 685 |
// ComboSelectionListener(priorityCombo)); |
| 686 |
// priorityCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 687 |
// comboListenerMap.put(priorityCombo, attribute); |
| 688 |
// currentCol += 2; |
| 689 |
// } else if (key.equals("bug_severity")) { |
| 690 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 691 |
// toolkit.createLabel(attributesComposite, name); |
| 692 |
// severityCombo = new CCombo(attributesComposite, SWT.FLAT | |
| 693 |
// SWT.READ_ONLY); |
| 694 |
// toolkit.adapt(severityCombo, true, true); |
| 695 |
// severityCombo.setFont(TEXT_FONT); |
| 696 |
// severityCombo.setLayoutData(data); |
| 697 |
// // severityCombo.setBackground(background); |
| 698 |
// Set<String> s = values.keySet(); |
| 699 |
// String[] a = s.toArray(new String[s.size()]); |
| 700 |
// Arrays.sort(a); |
| 701 |
// for (int i = 0; i < a.length; i++) { |
| 702 |
// severityCombo.add(a[i]); |
| 703 |
// } |
| 704 |
// severityCombo.select(severityCombo.indexOf(value)); |
| 705 |
// severityCombo.addSelectionListener(new |
| 706 |
// ComboSelectionListener(severityCombo)); |
| 707 |
// // severityCombo.addListener(SWT.Modify, this); |
| 708 |
// severityCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 709 |
// comboListenerMap.put(severityCombo, attribute); |
| 710 |
// currentCol += 2; |
| 711 |
// } else if (key.equals("target_milestone")) { |
| 712 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 713 |
// toolkit.createLabel(attributesComposite, name); |
| 714 |
// milestoneCombo = new CCombo(attributesComposite, SWT.FLAT | |
| 715 |
// SWT.NO_BACKGROUND | SWT.MULTI |
| 716 |
// | SWT.V_SCROLL | SWT.READ_ONLY); |
| 717 |
// toolkit.adapt(milestoneCombo, true, true); |
| 718 |
// milestoneCombo.setFont(TEXT_FONT); |
| 719 |
// milestoneCombo.setLayoutData(data); |
| 720 |
// // milestoneCombo.setBackground(background); |
| 721 |
// Set<String> s = values.keySet(); |
| 722 |
// String[] a = s.toArray(new String[s.size()]); |
| 723 |
// Arrays.sort(a); |
| 724 |
// for (int i = 0; i < a.length; i++) { |
| 725 |
// milestoneCombo.add(a[i]); |
| 726 |
// } |
| 727 |
// milestoneCombo.select(milestoneCombo.indexOf(value)); |
| 728 |
// // milestoneCombo.addListener(SWT.Modify, this); |
| 729 |
// milestoneCombo.addSelectionListener(new |
| 730 |
// ComboSelectionListener(milestoneCombo)); |
| 731 |
// milestoneCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 732 |
// comboListenerMap.put(milestoneCombo, attribute); |
| 733 |
// currentCol += 2; |
| 734 |
// } else if (key.equals("rep_platform")) { |
| 735 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 736 |
// toolkit.createLabel(attributesComposite, name); |
| 737 |
// platformCombo = new CCombo(attributesComposite, SWT.FLAT | |
| 738 |
// SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL |
| 739 |
// | SWT.READ_ONLY); |
| 740 |
// toolkit.adapt(platformCombo, true, true); |
| 741 |
// platformCombo.setFont(TEXT_FONT); |
| 742 |
// platformCombo.setLayoutData(data); |
| 743 |
// // platformCombo.setBackground(background); |
| 744 |
// Set<String> s = values.keySet(); |
| 745 |
// String[] a = s.toArray(new String[s.size()]); |
| 746 |
// Arrays.sort(a); |
| 747 |
// for (int i = 0; i < a.length; i++) { |
| 748 |
// platformCombo.add(a[i]); |
| 749 |
// } |
| 750 |
// platformCombo.select(platformCombo.indexOf(value)); |
| 751 |
// // platformCombo.addListener(SWT.Modify, this); |
| 752 |
// platformCombo.addSelectionListener(new |
| 753 |
// ComboSelectionListener(platformCombo)); |
| 754 |
// platformCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 755 |
// comboListenerMap.put(platformCombo, attribute); |
| 756 |
// currentCol += 2; |
| 757 |
// } else if (key.equals("product")) { |
| 758 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 759 |
// toolkit.createLabel(attributesComposite, name); |
| 760 |
// // toolkit.createLabel(attributesComposite, value); |
| 761 |
// Composite uneditableComp = toolkit.createComposite(attributesComposite); |
| 762 |
// GridLayout textLayout = new GridLayout(); |
| 763 |
// textLayout.marginWidth = 1; |
| 764 |
// uneditableComp.setLayout(textLayout); |
| 765 |
// toolkit.createText(uneditableComp, value, SWT.READ_ONLY);// |
| 766 |
// Label(attributesComposite, |
| 767 |
// // value); |
| 768 |
// // newLayout(attributesComposite, 1, value, |
| 769 |
// // VALUE).addListener(SWT.FocusIn, new GenericListener()); |
| 770 |
// currentCol += 2; |
| 771 |
// } else if (key.equals("assigned_to")) { |
| 772 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 773 |
// toolkit.createLabel(attributesComposite, name); |
| 774 |
// assignedTo = new Text(attributesComposite, SWT.SINGLE | SWT.WRAP); |
| 775 |
// assignedTo.setFont(TEXT_FONT); |
| 776 |
// assignedTo.setText(value); |
| 777 |
// data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); |
| 778 |
// data.horizontalSpan = 1; |
| 779 |
// assignedTo.setLayoutData(data); |
| 780 |
// |
| 781 |
// assignedTo.addListener(SWT.KeyUp, new Listener() { |
| 782 |
// public void handleEvent(Event event) { |
| 783 |
// String sel = assignedTo.getText(); |
| 784 |
// AbstractRepositoryReportAttribute a = getReport().getAttribute( |
| 785 |
// BugzillaReportElement.ASSIGNED_TO); |
| 786 |
// if (!(a.getValue().equals(sel))) { |
| 787 |
// a.setValue(sel); |
| 788 |
// changeDirtyStatus(true); |
| 789 |
// } |
| 790 |
// } |
| 791 |
// }); |
| 792 |
// assignedTo.addListener(SWT.FocusIn, new GenericListener()); |
| 793 |
// |
| 794 |
// currentCol += 2; |
| 795 |
// } else if (key.equals("component")) { |
| 796 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 797 |
// toolkit.createLabel(attributesComposite, name); |
| 798 |
// componentCombo = new CCombo(attributesComposite, SWT.FLAT | |
| 799 |
// SWT.NO_BACKGROUND | SWT.MULTI |
| 800 |
// | SWT.V_SCROLL | SWT.READ_ONLY); |
| 801 |
// toolkit.adapt(componentCombo, true, true); |
| 802 |
// componentCombo.setFont(TEXT_FONT); |
| 803 |
// componentCombo.setLayoutData(data); |
| 804 |
// // componentCombo.setBackground(background); |
| 805 |
// Set<String> s = values.keySet(); |
| 806 |
// String[] a = s.toArray(new String[s.size()]); |
| 807 |
// Arrays.sort(a); |
| 808 |
// for (int i = 0; i < a.length; i++) { |
| 809 |
// componentCombo.add(a[i]); |
| 810 |
// } |
| 811 |
// componentCombo.select(componentCombo.indexOf(value)); |
| 812 |
// // componentCombo.addListener(SWT.Modify, this); |
| 813 |
// componentCombo.addSelectionListener(new |
| 814 |
// ComboSelectionListener(componentCombo)); |
| 815 |
// componentCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 816 |
// comboListenerMap.put(componentCombo, attribute); |
| 817 |
// currentCol += 2; |
| 818 |
// } else if (name.equals("Summary")) { |
| 819 |
// // Don't show the summary here. |
| 820 |
// continue; |
| 821 |
// } else if (name.equals("Last Modified")) { |
| 822 |
// // Don't show last modified here. |
| 823 |
// continue; |
| 824 |
// } else if (name.equals("Bug#")) { |
| 825 |
// // Don't show bug number here |
| 826 |
// continue; |
| 827 |
// } else if (key.equals("bug_status")) { |
| 828 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 829 |
// toolkit.createLabel(attributesComposite, name); |
| 830 |
// Composite uneditableComp = toolkit.createComposite(attributesComposite); |
| 831 |
// GridLayout textLayout = new GridLayout(); |
| 832 |
// textLayout.marginWidth = 1; |
| 833 |
// uneditableComp.setLayout(textLayout); |
| 834 |
// toolkit.createText(uneditableComp, value, SWT.READ_ONLY);// |
| 835 |
// Label(attributesComposite, |
| 836 |
// // value); |
| 837 |
// // newLayout(attributesComposite, 1, value, |
| 838 |
// // VALUE).addListener(SWT.FocusIn, new GenericListener()); |
| 839 |
// currentCol += 2; |
| 840 |
// } else if (values.isEmpty()) { |
| 841 |
// // newLayout(attributesComposite, 1, name, PROPERTY); |
| 842 |
// toolkit.createLabel(attributesComposite, name); |
| 843 |
// Composite uneditableComp = toolkit.createComposite(attributesComposite); |
| 844 |
// GridLayout textLayout = new GridLayout(); |
| 845 |
// textLayout.marginWidth = 1; |
| 846 |
// uneditableComp.setLayout(textLayout); |
| 847 |
// toolkit.createText(uneditableComp, value, SWT.READ_ONLY);// |
| 848 |
// Label(attributesComposite, |
| 849 |
// // value); |
| 850 |
// // newLayout(attributesComposite, 1, value, |
| 851 |
// // VALUE).addListener(SWT.FocusIn, new GenericListener()); |
| 852 |
// currentCol += 2; |
| 853 |
// } |
| 854 |
// if (currentCol > attributesLayout.numColumns) { |
| 855 |
// currentCol -= attributesLayout.numColumns; |
| 856 |
// } |
| 857 |
// } |
| 858 |
// // End Populate Attributes |
| 859 |
// |
| 860 |
// // make sure that we are in the first column |
| 861 |
// if (currentCol > 1) { |
| 862 |
// while (currentCol <= attributesLayout.numColumns) { |
| 863 |
// newLayout(attributesComposite, 1, "", PROPERTY); |
| 864 |
// currentCol++; |
| 865 |
// } |
| 866 |
// } |
| 867 |
// |
| 868 |
// // URL field |
| 869 |
// addUrlText(url, attributesComposite); |
| 870 |
// |
| 871 |
// // keywords text field (not editable) |
| 872 |
// addKeywordsList(toolkit, keywords, attributesComposite); |
| 873 |
// // if (ccValue != null) { |
| 874 |
// // addCCList(toolkit, ccValue, attributesComposite); |
| 875 |
// // } |
| 876 |
// addSummaryText(attributesComposite); |
| 877 |
// // End URL, Keywords, Summary Text Fields |
| 878 |
// toolkit.paintBordersFor(attributesComposite); |
| 879 |
// } |
| 880 |
|
| 493 |
/** |
881 |
/** |
| 494 |
* Creates the attribute layout, which contains most of the basic attributes |
882 |
* Creates the attribute layout, which contains most of the basic attributes |
| 495 |
* of the bug (some of which are editable). |
883 |
* of the bug (some of which are editable). |
|
Lines 497-505
Link Here
|
| 497 |
protected void createAttributeLayout() { |
885 |
protected void createAttributeLayout() { |
| 498 |
|
886 |
|
| 499 |
String title = getTitleString(); |
887 |
String title = getTitleString(); |
| 500 |
String keywords = ""; |
|
|
| 501 |
String url = ""; |
| 502 |
|
| 503 |
Section section = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR | Section.TWISTIE); |
888 |
Section section = toolkit.createSection(form.getBody(), ExpandableComposite.TITLE_BAR | Section.TWISTIE); |
| 504 |
section.setText(LABEL_SECTION_ATTRIBUTES); |
889 |
section.setText(LABEL_SECTION_ATTRIBUTES); |
| 505 |
section.setExpanded(true); |
890 |
section.setExpanded(true); |
|
Lines 516-522
Link Here
|
| 516 |
} |
901 |
} |
| 517 |
}); |
902 |
}); |
| 518 |
|
903 |
|
| 519 |
// Attributes Composite- this holds all the combo fiels and text fields |
904 |
// Attributes Composite- this holds all the combo fields and text fields |
| 520 |
Composite attributesComposite = toolkit.createComposite(section); |
905 |
Composite attributesComposite = toolkit.createComposite(section); |
| 521 |
GridLayout attributesLayout = new GridLayout(); |
906 |
GridLayout attributesLayout = new GridLayout(); |
| 522 |
attributesLayout.numColumns = 4; |
907 |
attributesLayout.numColumns = 4; |
|
Lines 527-822
Link Here
|
| 527 |
attributesData.horizontalSpan = 1; |
912 |
attributesData.horizontalSpan = 1; |
| 528 |
attributesData.grabExcessVerticalSpace = false; |
913 |
attributesData.grabExcessVerticalSpace = false; |
| 529 |
attributesComposite.setLayoutData(attributesData); |
914 |
attributesComposite.setLayoutData(attributesData); |
| 530 |
// attributesComposite.setBackground(background); |
|
|
| 531 |
// End Attributes Composite |
| 532 |
|
| 533 |
section.setClient(attributesComposite); |
915 |
section.setClient(attributesComposite); |
| 534 |
|
|
|
| 535 |
// Attributes Title Area |
| 536 |
// Composite attributesTitleComposite = new |
| 537 |
// Composite(attributesComposite, SWT.NONE); |
| 538 |
// GridLayout attributesTitleLayout = new GridLayout(); |
| 539 |
// attributesTitleLayout.horizontalSpacing = 0; |
| 540 |
// attributesTitleLayout.marginWidth = 0; |
| 541 |
// attributesTitleComposite.setLayout(attributesTitleLayout); |
| 542 |
// attributesTitleComposite.setBackground(background); |
| 543 |
// GridData attributesTitleData = new |
| 544 |
// GridData(GridData.HORIZONTAL_ALIGN_FILL); |
| 545 |
// attributesTitleData.horizontalSpan = 4; |
| 546 |
// attributesTitleData.grabExcessVerticalSpace = false; |
| 547 |
// attributesTitleComposite.setLayoutData(attributesTitleData); |
| 548 |
// End Attributes Title |
| 549 |
|
| 550 |
// Set the Attributes Title |
| 551 |
// newAttributesLayout(attributesTitleComposite); |
| 552 |
// titleLabel.setText(title); |
| 553 |
bugzillaInput.setToolTipText(title); |
916 |
bugzillaInput.setToolTipText(title); |
|
|
917 |
|
| 554 |
int currentCol = 1; |
918 |
int currentCol = 1; |
| 555 |
|
919 |
|
| 556 |
String ccValue = null; |
920 |
for (AbstractRepositoryReportAttribute attribute : getReport().getAttributes()) { |
| 557 |
|
921 |
|
| 558 |
// Populate Attributes |
922 |
// String key = attribute.getID(); |
| 559 |
for (Iterator<Attribute> it = getBug().getAttributes().iterator(); it.hasNext();) { |
|
|
| 560 |
Attribute attribute = it.next(); |
| 561 |
String key = attribute.getParameterName(); |
| 562 |
String name = attribute.getName(); |
923 |
String name = attribute.getName(); |
| 563 |
String value = checkText(attribute.getValue()); |
924 |
String value = checkText(attribute.getValue()); |
| 564 |
Map<String, String> values = attribute.getOptionValues(); |
925 |
// System.err.println(">>> AbstractBugEditor>> name: "+name+" |
| 565 |
|
926 |
// key:"+key+" value:"+value+" is hidden"+attribute.isHidden()); |
| 566 |
// make sure we don't try to display a hidden field |
927 |
if (attribute.isHidden()) |
| 567 |
if (attribute.isHidden() || (key != null && key.equals("status_whiteboard"))) |
|
|
| 568 |
continue; |
928 |
continue; |
| 569 |
|
929 |
Map<String, String> values = attribute.getOptionValues(); |
| 570 |
if (values == null) |
930 |
if (values == null) |
| 571 |
values = new HashMap<String, String>(); |
931 |
values = new HashMap<String, String>(); |
| 572 |
|
932 |
|
| 573 |
if (key == null) |
|
|
| 574 |
key = ""; |
| 575 |
|
| 576 |
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); |
933 |
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); |
| 577 |
data.horizontalSpan = 1; |
934 |
data.horizontalSpan = 1; |
| 578 |
data.horizontalIndent = HORZ_INDENT; |
935 |
data.horizontalIndent = HORZ_INDENT; |
| 579 |
|
936 |
|
| 580 |
if (key.equals("short_desc") || key.equals("keywords")) { |
937 |
if (attribute.hasOptions() && !attribute.isReadOnly()) { |
| 581 |
keywords = value; |
|
|
| 582 |
} else if (key.equals("newcc")) { |
| 583 |
ccValue = value; |
| 584 |
if (value == null) |
| 585 |
ccValue = ""; |
| 586 |
} else if (key.equals("bug_file_loc")) { |
| 587 |
url = value; |
| 588 |
} else if (key.equals("op_sys")) { |
| 589 |
// newLayout(attributesComposite, 1, name, PROPERTY); |
| 590 |
toolkit.createLabel(attributesComposite, name); |
| 591 |
// oSCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | |
| 592 |
// SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY);//SWT.NONE |
| 593 |
oSCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.READ_ONLY); |
| 594 |
// oSCombo = new Combo(attributesComposite, SWT.FLAT | |
| 595 |
// SWT.READ_ONLY); |
| 596 |
toolkit.adapt(oSCombo, true, true); |
| 597 |
oSCombo.setFont(TEXT_FONT); |
| 598 |
oSCombo.setLayoutData(data); |
| 599 |
// oSCombo.setBackground(background); |
| 600 |
Set<String> s = values.keySet(); |
| 601 |
String[] a = s.toArray(new String[s.size()]); |
| 602 |
Arrays.sort(a); |
| 603 |
for (int i = 0; i < a.length; i++) { |
| 604 |
oSCombo.add(a[i]); |
| 605 |
} |
| 606 |
if (oSCombo.indexOf(value) != -1) { |
| 607 |
oSCombo.select(oSCombo.indexOf(value)); |
| 608 |
} else { |
| 609 |
oSCombo.select(oSCombo.indexOf("All")); |
| 610 |
} |
| 611 |
// oSCombo.addListener(SWT.Modify, this); |
| 612 |
oSCombo.addSelectionListener(new ComboSelectionListener(oSCombo)); |
| 613 |
comboListenerMap.put(oSCombo, name); |
| 614 |
oSCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 615 |
currentCol += 2; |
| 616 |
} else if (key.equals("version")) { |
| 617 |
// newLayout(attributesComposite, 1, name, PROPERTY); |
| 618 |
toolkit.createLabel(attributesComposite, name); |
| 619 |
versionCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL |
| 620 |
| SWT.READ_ONLY); |
| 621 |
toolkit.adapt(versionCombo, true, true); |
| 622 |
versionCombo.setFont(TEXT_FONT); |
| 623 |
versionCombo.setLayoutData(data); |
| 624 |
// versionCombo.setBackground(background); |
| 625 |
Set<String> s = values.keySet(); |
| 626 |
String[] a = s.toArray(new String[s.size()]); |
| 627 |
Arrays.sort(a); |
| 628 |
for (int i = 0; i < a.length; i++) { |
| 629 |
versionCombo.add(a[i]); |
| 630 |
} |
| 631 |
versionCombo.select(versionCombo.indexOf(value)); |
| 632 |
// versionCombo.addListener(SWT.Modify, this); |
| 633 |
versionCombo.addSelectionListener(new ComboSelectionListener(versionCombo)); |
| 634 |
versionCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 635 |
comboListenerMap.put(versionCombo, name); |
| 636 |
currentCol += 2; |
| 637 |
} else if (key.equals("priority")) { |
| 638 |
// newLayout(attributesComposite, 1, "Priority", PROPERTY); |
| 639 |
toolkit.createLabel(attributesComposite, name); |
938 |
toolkit.createLabel(attributesComposite, name); |
| 640 |
priorityCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.V_SCROLL | SWT.READ_ONLY); |
939 |
attributeCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.READ_ONLY); |
| 641 |
toolkit.adapt(priorityCombo, true, true); |
940 |
toolkit.adapt(attributeCombo, true, true); |
| 642 |
priorityCombo.setFont(TEXT_FONT); |
941 |
attributeCombo.setFont(TEXT_FONT); |
| 643 |
priorityCombo.setLayoutData(data); |
942 |
attributeCombo.setLayoutData(data); |
| 644 |
// priorityCombo.setBackground(background); |
|
|
| 645 |
Set<String> s = values.keySet(); |
943 |
Set<String> s = values.keySet(); |
| 646 |
String[] a = s.toArray(new String[s.size()]); |
944 |
String[] a = s.toArray(new String[s.size()]); |
| 647 |
Arrays.sort(a); |
945 |
Arrays.sort(a); |
| 648 |
for (int i = 0; i < a.length; i++) { |
946 |
for (int i = 0; i < a.length; i++) { |
| 649 |
priorityCombo.add(a[i]); |
947 |
attributeCombo.add(a[i]); |
| 650 |
} |
948 |
} |
| 651 |
priorityCombo.select(priorityCombo.indexOf(value)); |
949 |
if (attributeCombo.indexOf(value) != -1) { |
| 652 |
// priorityCombo.addListener(SWT.Modify, this); |
950 |
attributeCombo.select(attributeCombo.indexOf(value)); |
| 653 |
priorityCombo.addSelectionListener(new ComboSelectionListener(priorityCombo)); |
|
|
| 654 |
priorityCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 655 |
comboListenerMap.put(priorityCombo, name); |
| 656 |
currentCol += 2; |
| 657 |
} else if (key.equals("bug_severity")) { |
| 658 |
// newLayout(attributesComposite, 1, name, PROPERTY); |
| 659 |
toolkit.createLabel(attributesComposite, name); |
| 660 |
severityCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.READ_ONLY); |
| 661 |
toolkit.adapt(severityCombo, true, true); |
| 662 |
severityCombo.setFont(TEXT_FONT); |
| 663 |
severityCombo.setLayoutData(data); |
| 664 |
// severityCombo.setBackground(background); |
| 665 |
Set<String> s = values.keySet(); |
| 666 |
String[] a = s.toArray(new String[s.size()]); |
| 667 |
Arrays.sort(a); |
| 668 |
for (int i = 0; i < a.length; i++) { |
| 669 |
severityCombo.add(a[i]); |
| 670 |
} |
951 |
} |
| 671 |
severityCombo.select(severityCombo.indexOf(value)); |
952 |
attributeCombo.addSelectionListener(new ComboSelectionListener(attributeCombo)); |
| 672 |
severityCombo.addSelectionListener(new ComboSelectionListener(severityCombo)); |
953 |
comboListenerMap.put(attributeCombo, attribute); |
| 673 |
// severityCombo.addListener(SWT.Modify, this); |
954 |
attributeCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 674 |
severityCombo.addListener(SWT.FocusIn, new GenericListener()); |
|
|
| 675 |
comboListenerMap.put(severityCombo, name); |
| 676 |
currentCol += 2; |
955 |
currentCol += 2; |
| 677 |
} else if (key.equals("target_milestone")) { |
956 |
} else { |
| 678 |
// newLayout(attributesComposite, 1, name, PROPERTY); |
|
|
| 679 |
toolkit.createLabel(attributesComposite, name); |
957 |
toolkit.createLabel(attributesComposite, name); |
| 680 |
milestoneCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.NO_BACKGROUND | SWT.MULTI |
958 |
Composite textFieldComposite = toolkit.createComposite(attributesComposite); |
| 681 |
| SWT.V_SCROLL | SWT.READ_ONLY); |
|
|
| 682 |
toolkit.adapt(milestoneCombo, true, true); |
| 683 |
milestoneCombo.setFont(TEXT_FONT); |
| 684 |
milestoneCombo.setLayoutData(data); |
| 685 |
// milestoneCombo.setBackground(background); |
| 686 |
Set<String> s = values.keySet(); |
| 687 |
String[] a = s.toArray(new String[s.size()]); |
| 688 |
Arrays.sort(a); |
| 689 |
for (int i = 0; i < a.length; i++) { |
| 690 |
milestoneCombo.add(a[i]); |
| 691 |
} |
| 692 |
milestoneCombo.select(milestoneCombo.indexOf(value)); |
| 693 |
// milestoneCombo.addListener(SWT.Modify, this); |
| 694 |
milestoneCombo.addSelectionListener(new ComboSelectionListener(milestoneCombo)); |
| 695 |
milestoneCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 696 |
comboListenerMap.put(milestoneCombo, name); |
| 697 |
currentCol += 2; |
| 698 |
} else if (key.equals("rep_platform")) { |
| 699 |
// newLayout(attributesComposite, 1, name, PROPERTY); |
| 700 |
toolkit.createLabel(attributesComposite, name); |
| 701 |
platformCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL |
| 702 |
| SWT.READ_ONLY); |
| 703 |
toolkit.adapt(platformCombo, true, true); |
| 704 |
platformCombo.setFont(TEXT_FONT); |
| 705 |
platformCombo.setLayoutData(data); |
| 706 |
// platformCombo.setBackground(background); |
| 707 |
Set<String> s = values.keySet(); |
| 708 |
String[] a = s.toArray(new String[s.size()]); |
| 709 |
Arrays.sort(a); |
| 710 |
for (int i = 0; i < a.length; i++) { |
| 711 |
platformCombo.add(a[i]); |
| 712 |
} |
| 713 |
platformCombo.select(platformCombo.indexOf(value)); |
| 714 |
// platformCombo.addListener(SWT.Modify, this); |
| 715 |
platformCombo.addSelectionListener(new ComboSelectionListener(platformCombo)); |
| 716 |
platformCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 717 |
comboListenerMap.put(platformCombo, name); |
| 718 |
currentCol += 2; |
| 719 |
} else if (key.equals("product")) { |
| 720 |
// newLayout(attributesComposite, 1, name, PROPERTY); |
| 721 |
toolkit.createLabel(attributesComposite, name); |
| 722 |
// toolkit.createLabel(attributesComposite, value); |
| 723 |
Composite uneditableComp = toolkit.createComposite(attributesComposite); |
| 724 |
GridLayout textLayout = new GridLayout(); |
959 |
GridLayout textLayout = new GridLayout(); |
| 725 |
textLayout.marginWidth = 1; |
960 |
textLayout.marginWidth = 1; |
| 726 |
uneditableComp.setLayout(textLayout); |
961 |
textFieldComposite.setLayout(textLayout); |
| 727 |
toolkit.createText(uneditableComp, value, SWT.READ_ONLY);// Label(attributesComposite, |
962 |
GridData textData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); |
| 728 |
// value); |
963 |
textData.horizontalSpan = 1; |
| 729 |
// newLayout(attributesComposite, 1, value, |
964 |
textData.widthHint = 135; |
| 730 |
// VALUE).addListener(SWT.FocusIn, new GenericListener()); |
965 |
|
| 731 |
currentCol += 2; |
966 |
if (attribute.isReadOnly()) { |
| 732 |
} else if (key.equals("assigned_to")) { |
967 |
final Text text = toolkit.createText(textFieldComposite, value, SWT.FLAT | SWT.READ_ONLY); |
| 733 |
// newLayout(attributesComposite, 1, name, PROPERTY); |
968 |
text.setLayoutData(textData); |
| 734 |
toolkit.createLabel(attributesComposite, name); |
969 |
} else { |
| 735 |
assignedTo = new Text(attributesComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP); |
970 |
final Text text = toolkit.createText(textFieldComposite, value, SWT.FLAT); |
| 736 |
assignedTo.setFont(TEXT_FONT); |
971 |
text.setLayoutData(textData); |
| 737 |
assignedTo.setText(value); |
972 |
toolkit.paintBordersFor(textFieldComposite); |
| 738 |
data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); |
973 |
text.setData(attribute); |
| 739 |
data.horizontalSpan = 1; |
974 |
text.addListener(SWT.KeyUp, new Listener() { |
| 740 |
assignedTo.setLayoutData(data); |
975 |
public void handleEvent(Event event) { |
| 741 |
|
976 |
String sel = text.getText(); |
| 742 |
assignedTo.addListener(SWT.KeyUp, new Listener() { |
977 |
AbstractRepositoryReportAttribute a = (AbstractRepositoryReportAttribute) text.getData(); |
| 743 |
public void handleEvent(Event event) { |
978 |
if (!(a.getValue().equals(sel))) { |
| 744 |
String sel = assignedTo.getText(); |
979 |
a.setValue(sel); |
| 745 |
Attribute a = getBug().getAttribute("Assign To"); |
980 |
changeDirtyStatus(true); |
| 746 |
if (!(a.getNewValue().equals(sel))) { |
981 |
} |
| 747 |
a.setNewValue(sel); |
|
|
| 748 |
changeDirtyStatus(true); |
| 749 |
} |
982 |
} |
| 750 |
} |
983 |
}); |
| 751 |
}); |
984 |
text.addListener(SWT.FocusIn, new GenericListener()); |
| 752 |
assignedTo.addListener(SWT.FocusIn, new GenericListener()); |
|
|
| 753 |
|
| 754 |
currentCol += 2; |
| 755 |
} else if (key.equals("component")) { |
| 756 |
// newLayout(attributesComposite, 1, name, PROPERTY); |
| 757 |
toolkit.createLabel(attributesComposite, name); |
| 758 |
componentCombo = new CCombo(attributesComposite, SWT.FLAT | SWT.NO_BACKGROUND | SWT.MULTI |
| 759 |
| SWT.V_SCROLL | SWT.READ_ONLY); |
| 760 |
toolkit.adapt(componentCombo, true, true); |
| 761 |
componentCombo.setFont(TEXT_FONT); |
| 762 |
componentCombo.setLayoutData(data); |
| 763 |
// componentCombo.setBackground(background); |
| 764 |
Set<String> s = values.keySet(); |
| 765 |
String[] a = s.toArray(new String[s.size()]); |
| 766 |
Arrays.sort(a); |
| 767 |
for (int i = 0; i < a.length; i++) { |
| 768 |
componentCombo.add(a[i]); |
| 769 |
} |
985 |
} |
| 770 |
componentCombo.select(componentCombo.indexOf(value)); |
986 |
|
| 771 |
// componentCombo.addListener(SWT.Modify, this); |
|
|
| 772 |
componentCombo.addSelectionListener(new ComboSelectionListener(componentCombo)); |
| 773 |
componentCombo.addListener(SWT.FocusIn, new GenericListener()); |
| 774 |
comboListenerMap.put(componentCombo, name); |
| 775 |
currentCol += 2; |
| 776 |
} else if (name.equals("Summary")) { |
| 777 |
// Don't show the summary here. |
| 778 |
continue; |
| 779 |
} else if (name.equals("Last Modified")) { |
| 780 |
// Don't show last modified here. |
| 781 |
continue; |
| 782 |
} else if (name.equals("Bug#")) { |
| 783 |
// Don't show bug number here |
| 784 |
continue; |
| 785 |
} else if (values.isEmpty()) { |
| 786 |
// newLayout(attributesComposite, 1, name, PROPERTY); |
| 787 |
toolkit.createLabel(attributesComposite, name); |
| 788 |
Composite uneditableComp = toolkit.createComposite(attributesComposite); |
| 789 |
GridLayout textLayout = new GridLayout(); |
| 790 |
textLayout.marginWidth = 1; |
| 791 |
uneditableComp.setLayout(textLayout); |
| 792 |
toolkit.createText(uneditableComp, value, SWT.READ_ONLY);// Label(attributesComposite, |
| 793 |
// value); |
| 794 |
// newLayout(attributesComposite, 1, value, |
| 795 |
// VALUE).addListener(SWT.FocusIn, new GenericListener()); |
| 796 |
currentCol += 2; |
987 |
currentCol += 2; |
| 797 |
} |
988 |
} |
| 798 |
if (currentCol > attributesLayout.numColumns) { |
989 |
if (currentCol > attributesLayout.numColumns) { |
| 799 |
currentCol -= attributesLayout.numColumns; |
990 |
currentCol -= attributesLayout.numColumns; |
| 800 |
} |
991 |
} |
|
|
992 |
|
| 801 |
} |
993 |
} |
| 802 |
// End Populate Attributes |
|
|
| 803 |
|
994 |
|
| 804 |
// make sure that we are in the first column |
995 |
// make sure that we are in the first column |
| 805 |
if (currentCol > 1) { |
996 |
if (currentCol > 1) { |
| 806 |
while (currentCol <= attributesLayout.numColumns) { |
997 |
while (currentCol <= attributesLayout.numColumns) { |
| 807 |
newLayout(attributesComposite, 1, "", PROPERTY); |
998 |
toolkit.createLabel(attributesComposite, ""); |
|
|
999 |
// newLayout(attributesComposite, 1, "", PROPERTY); |
| 808 |
currentCol++; |
1000 |
currentCol++; |
| 809 |
} |
1001 |
} |
| 810 |
} |
1002 |
} |
| 811 |
|
1003 |
|
| 812 |
// URL, Keywords, Summary Text Fields |
1004 |
// Perhaps these should be performed in subclass eventually |
| 813 |
addUrlText(url, attributesComposite); |
1005 |
|
|
|
1006 |
addCCList(toolkit, "", attributesComposite); |
| 1007 |
|
| 1008 |
// URL field |
| 1009 |
addUrlText(getReport().getAttributeValue(BugzillaReportElement.BUG_FILE_LOC), attributesComposite); |
| 814 |
|
1010 |
|
| 815 |
// keywords text field (not editable) |
1011 |
// keywords text field (not editable) |
| 816 |
addKeywordsList(toolkit, keywords, attributesComposite); |
1012 |
addKeywordsList(toolkit, getReport().getAttributeValue(BugzillaReportElement.KEYWORDS), attributesComposite); |
| 817 |
if (ccValue != null) { |
1013 |
|
| 818 |
addCCList(toolkit, ccValue, attributesComposite); |
|
|
| 819 |
} |
| 820 |
addSummaryText(attributesComposite); |
1014 |
addSummaryText(attributesComposite); |
| 821 |
// End URL, Keywords, Summary Text Fields |
1015 |
// End URL, Keywords, Summary Text Fields |
| 822 |
toolkit.paintBordersFor(attributesComposite); |
1016 |
toolkit.paintBordersFor(attributesComposite); |
|
Lines 843-851
Link Here
|
| 843 |
urlText.addListener(SWT.KeyUp, new Listener() { |
1037 |
urlText.addListener(SWT.KeyUp, new Listener() { |
| 844 |
public void handleEvent(Event event) { |
1038 |
public void handleEvent(Event event) { |
| 845 |
String sel = urlText.getText(); |
1039 |
String sel = urlText.getText(); |
| 846 |
Attribute a = getBug().getAttribute("URL"); |
1040 |
AbstractRepositoryReportAttribute a = getReport().getAttribute(BugzillaReportElement.BUG_FILE_LOC); |
| 847 |
if (!(a.getNewValue().equals(sel))) { |
1041 |
if (!(a.getValue().equals(sel))) { |
| 848 |
a.setNewValue(sel); |
1042 |
a.setValue(sel); |
| 849 |
changeDirtyStatus(true); |
1043 |
changeDirtyStatus(true); |
| 850 |
} |
1044 |
} |
| 851 |
} |
1045 |
} |
|
Lines 1187-1198
Link Here
|
| 1187 |
public void saveBug() { |
1381 |
public void saveBug() { |
| 1188 |
try { |
1382 |
try { |
| 1189 |
updateBug(); |
1383 |
updateBug(); |
| 1190 |
IBugzillaBug bug = getBug(); |
1384 |
// IBugzillaBug bug = getBug(); |
| 1191 |
|
1385 |
|
| 1192 |
final BugzillaRepositoryConnector bugzillaRepositoryClient = (BugzillaRepositoryConnector) MylarTaskListPlugin |
1386 |
final BugzillaRepositoryConnector bugzillaRepositoryClient = (BugzillaRepositoryConnector) MylarTaskListPlugin |
| 1193 |
.getRepositoryManager().getRepositoryConnector(BugzillaPlugin.REPOSITORY_KIND); |
1387 |
.getRepositoryManager().getRepositoryConnector(BugzillaPlugin.REPOSITORY_KIND); |
| 1194 |
changeDirtyStatus(false); |
1388 |
changeDirtyStatus(false); |
| 1195 |
bugzillaRepositoryClient.saveBugReport(bug); |
1389 |
bugzillaRepositoryClient.saveBugReport((BugzillaReport) getReport()); |
| 1196 |
} catch (Exception e) { |
1390 |
} catch (Exception e) { |
| 1197 |
MylarStatusHandler.fail(e, "bug save offline failed", true); |
1391 |
MylarStatusHandler.fail(e, "bug save offline failed", true); |
| 1198 |
} |
1392 |
} |
|
Lines 1336-1342
Link Here
|
| 1336 |
*/ |
1530 |
*/ |
| 1337 |
protected class GenericListener implements Listener { |
1531 |
protected class GenericListener implements Listener { |
| 1338 |
public void handleEvent(Event event) { |
1532 |
public void handleEvent(Event event) { |
| 1339 |
IBugzillaBug bug = getBug(); |
1533 |
BugzillaReport bug = (BugzillaReport) getReport(); |
| 1340 |
fireSelectionChanged(new SelectionChangedEvent(selectionProvider, new StructuredSelection( |
1534 |
fireSelectionChanged(new SelectionChangedEvent(selectionProvider, new StructuredSelection( |
| 1341 |
new BugzillaReportSelection(bug.getId(), bug.getRepositoryUrl(), bug.getLabel(), false, bug |
1535 |
new BugzillaReportSelection(bug.getId(), bug.getRepositoryUrl(), bug.getLabel(), false, bug |
| 1342 |
.getSummary())))); |
1536 |
.getSummary())))); |