|
Lines 23-28
Link Here
|
| 23 |
import java.util.HashSet; |
23 |
import java.util.HashSet; |
| 24 |
import java.util.Map; |
24 |
import java.util.Map; |
| 25 |
import java.util.Set; |
25 |
import java.util.Set; |
|
|
26 |
import java.util.regex.Matcher; |
| 27 |
import java.util.regex.Pattern; |
| 26 |
|
28 |
|
| 27 |
import org.eclipse.core.runtime.CoreException; |
29 |
import org.eclipse.core.runtime.CoreException; |
| 28 |
import org.eclipse.core.runtime.IProgressMonitor; |
30 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
Lines 45-50
Link Here
|
| 45 |
import org.eclipse.jface.window.Window; |
47 |
import org.eclipse.jface.window.Window; |
| 46 |
import org.eclipse.mylyn.commons.core.CoreUtil; |
48 |
import org.eclipse.mylyn.commons.core.CoreUtil; |
| 47 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
49 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
|
|
50 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField; |
| 48 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; |
51 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; |
| 49 |
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; |
52 |
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; |
| 50 |
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; |
53 |
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; |
|
Lines 149-157
Link Here
|
| 149 |
private static final String[] emailRoleValues2 = { "emailassigned_to2", "emailreporter2", "emailcc2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
152 |
private static final String[] emailRoleValues2 = { "emailassigned_to2", "emailreporter2", "emailcc2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 150 |
"emaillongdesc2", "emailqa_contact2" }; //$NON-NLS-1$ //$NON-NLS-2$ |
153 |
"emaillongdesc2", "emailqa_contact2" }; //$NON-NLS-1$ //$NON-NLS-2$ |
| 151 |
|
154 |
|
|
|
155 |
private static final ArrayList<String> chartFieldTextDefault = new ArrayList<String>() { |
| 156 |
private static final long serialVersionUID = 1974092160992399001L; |
| 157 |
{ |
| 158 |
add(Messages.BugzillaSearchPage_Field_Noop); |
| 159 |
add(Messages.BugzillaSearchPage_Field_Alias); |
| 160 |
add(Messages.BugzillaSearchPage_Field_AssignedTo); |
| 161 |
add(Messages.BugzillaSearchPage_Field_Attachment_creator); |
| 162 |
add(Messages.BugzillaSearchPage_Field_Attachment_data); |
| 163 |
add(Messages.BugzillaSearchPage_Field_Attachment_description); |
| 164 |
add(Messages.BugzillaSearchPage_Field_Attachment_filename); |
| 165 |
add(Messages.BugzillaSearchPage_Field_Attachment_is_a_URL); |
| 166 |
add(Messages.BugzillaSearchPage_Field_Attachment_is_obsolete); |
| 167 |
add(Messages.BugzillaSearchPage_Field_Attachment_is_patch); |
| 168 |
add(Messages.BugzillaSearchPage_Field_Attachment_is_private); |
| 169 |
add(Messages.BugzillaSearchPage_Field_Attachment_mime_type); |
| 170 |
add(Messages.BugzillaSearchPage_Field_Blocks); |
| 171 |
add(Messages.BugzillaSearchPage_Field_Bug); |
| 172 |
add(Messages.BugzillaSearchPage_Field_CC); |
| 173 |
add(Messages.BugzillaSearchPage_Field_CC_Accessible); |
| 174 |
add(Messages.BugzillaSearchPage_Field_Classification); |
| 175 |
add(Messages.BugzillaSearchPage_Field_Comment); |
| 176 |
add(Messages.BugzillaSearchPage_Field_Comment_is_private); |
| 177 |
add(Messages.BugzillaSearchPage_Field_Commenter); |
| 178 |
add(Messages.BugzillaSearchPage_Field_Component); |
| 179 |
add(Messages.BugzillaSearchPage_Field_Content); |
| 180 |
add(Messages.BugzillaSearchPage_Field_Creation_date); |
| 181 |
add(Messages.BugzillaSearchPage_Field_Days_since_bug_changed); |
| 182 |
add(Messages.BugzillaSearchPage_Field_Depends_on); |
| 183 |
add(Messages.BugzillaSearchPage_Field_drop_down_custom_field); |
| 184 |
add(Messages.BugzillaSearchPage_Field_Ever_Confirmed); |
| 185 |
add(Messages.BugzillaSearchPage_Field_Flag); |
| 186 |
add(Messages.BugzillaSearchPage_Field_Flag_Requestee); |
| 187 |
add(Messages.BugzillaSearchPage_Field_Flag_Setter); |
| 188 |
add(Messages.BugzillaSearchPage_Field_free_text_custom_field); |
| 189 |
add(Messages.BugzillaSearchPage_Field_Group); |
| 190 |
add(Messages.BugzillaSearchPage_Field_Keywords); |
| 191 |
add(Messages.BugzillaSearchPage_Field_Last_changed_date); |
| 192 |
add(Messages.BugzillaSearchPage_Field_OS_Version); |
| 193 |
add(Messages.BugzillaSearchPage_Field_Platform); |
| 194 |
add(Messages.BugzillaSearchPage_Field_Priority); |
| 195 |
add(Messages.BugzillaSearchPage_Field_Product); |
| 196 |
add(Messages.BugzillaSearchPage_Field_QAContact); |
| 197 |
add(Messages.BugzillaSearchPage_Field_ReportedBy); |
| 198 |
add(Messages.BugzillaSearchPage_Field_Reporter_Accessible); |
| 199 |
add(Messages.BugzillaSearchPage_Field_Resolution); |
| 200 |
add(Messages.BugzillaSearchPage_Field_Severity); |
| 201 |
add(Messages.BugzillaSearchPage_Field_Status); |
| 202 |
add(Messages.BugzillaSearchPage_Field_Status_Whiteboard); |
| 203 |
add(Messages.BugzillaSearchPage_Field_Summary); |
| 204 |
add(Messages.BugzillaSearchPage_Field_Target_Milestone); |
| 205 |
add(Messages.BugzillaSearchPage_Field_Time_Since_Assignee_Touched); |
| 206 |
add(Messages.BugzillaSearchPage_Field_URL); |
| 207 |
add(Messages.BugzillaSearchPage_Field_Version); |
| 208 |
add(Messages.BugzillaSearchPage_Field_Votes); |
| 209 |
} |
| 210 |
}; |
| 211 |
|
| 212 |
private static final ArrayList<String> chartFieldValuesDefault = new ArrayList<String>() { |
| 213 |
private static final long serialVersionUID = 9135403539678279982L; |
| 214 |
{ |
| 215 |
add("noop"); //$NON-NLS-1$ |
| 216 |
add("alias"); //$NON-NLS-1$ |
| 217 |
add("assigned_to"); //$NON-NLS-1$ |
| 218 |
add("attachments.submitter"); //$NON-NLS-1$ |
| 219 |
add("attach_data.thedata"); //$NON-NLS-1$ |
| 220 |
add("attachments.description"); //$NON-NLS-1$ |
| 221 |
add("attachments.filename"); //$NON-NLS-1$ |
| 222 |
add("attachments.isurl"); //$NON-NLS-1$ |
| 223 |
add("attachments.isobsolete"); //$NON-NLS-1$ |
| 224 |
add("attachments.ispatch"); //$NON-NLS-1$ |
| 225 |
add("attachments.isprivate"); //$NON-NLS-1$ |
| 226 |
add("attachments.mimetype"); //$NON-NLS-1$ |
| 227 |
add("blocked"); //$NON-NLS-1$ |
| 228 |
add("bug_id"); //$NON-NLS-1$ |
| 229 |
add("cc"); //$NON-NLS-1$ |
| 230 |
add("cclist_accessible"); //$NON-NLS-1$ |
| 231 |
add("classification"); //$NON-NLS-1$ |
| 232 |
add("longdesc"); //$NON-NLS-1$ |
| 233 |
add("longdescs.isprivate"); //$NON-NLS-1$ |
| 234 |
add("commenter"); //$NON-NLS-1$ |
| 235 |
add("component"); //$NON-NLS-1$ |
| 236 |
add("content"); //$NON-NLS-1$ |
| 237 |
add("creation_ts"); //$NON-NLS-1$ |
| 238 |
add("days_elapsed"); //$NON-NLS-1$ |
| 239 |
add("dependson"); //$NON-NLS-1$ |
| 240 |
add("cf_dropdown"); //$NON-NLS-1$ |
| 241 |
add("everconfirmed"); //$NON-NLS-1$ |
| 242 |
add("flagtypes.name"); //$NON-NLS-1$ |
| 243 |
add("requestees.login_name"); //$NON-NLS-1$ |
| 244 |
add("setters.login_name"); //$NON-NLS-1$ |
| 245 |
add("cf_freetext"); //$NON-NLS-1$ |
| 246 |
add("bug_group"); //$NON-NLS-1$ |
| 247 |
add("keywords"); //$NON-NLS-1$ |
| 248 |
add("delta_ts"); //$NON-NLS-1$ |
| 249 |
add("op_sys"); //$NON-NLS-1$ |
| 250 |
add("rep_platform"); //$NON-NLS-1$ |
| 251 |
add("priority"); //$NON-NLS-1$ |
| 252 |
add("product"); //$NON-NLS-1$ |
| 253 |
add("qa_contact"); //$NON-NLS-1$ |
| 254 |
add("reporter"); //$NON-NLS-1$ |
| 255 |
add("reporter_accessible"); //$NON-NLS-1$ |
| 256 |
add("resolution"); //$NON-NLS-1$ |
| 257 |
add("bug_severity"); //$NON-NLS-1$ |
| 258 |
add("bug_status"); //$NON-NLS-1$ |
| 259 |
add("status_whiteboard"); //$NON-NLS-1$ |
| 260 |
add("short_desc"); //$NON-NLS-1$ |
| 261 |
add("target_milestone"); //$NON-NLS-1$ |
| 262 |
add("owner_idle_time"); //$NON-NLS-1$ |
| 263 |
add("bug_file_loc"); //$NON-NLS-1$ |
| 264 |
add("version"); //$NON-NLS-1$ |
| 265 |
add("votes"); //$NON-NLS-1$ |
| 266 |
} |
| 267 |
}; |
| 268 |
|
| 269 |
private static final String[] chartOperationText = { Messages.BugzillaSearchPage_Operation_Noop, |
| 270 |
Messages.BugzillaSearchPage_Operation_is_equal_to, Messages.BugzillaSearchPage_Operation_is_not_equal_to, |
| 271 |
Messages.BugzillaSearchPage_Operation_is_equal_to_any_of_the_strings, |
| 272 |
Messages.BugzillaSearchPage_Operation_contains_the_string, |
| 273 |
Messages.BugzillaSearchPage_Operation_contains_the_string_exact_case, |
| 274 |
Messages.BugzillaSearchPage_Operation_does_not_contain_the_string, |
| 275 |
Messages.BugzillaSearchPage_Operation_contains_any_of_the_strings, |
| 276 |
Messages.BugzillaSearchPage_Operation_contains_all_of_the_strings, |
| 277 |
Messages.BugzillaSearchPage_Operation_contains_none_of_the_strings, |
| 278 |
Messages.BugzillaSearchPage_Operation_contains_regexp, |
| 279 |
Messages.BugzillaSearchPage_Operation_does_not_contain_regexp, |
| 280 |
Messages.BugzillaSearchPage_Operation_is_less_than, Messages.BugzillaSearchPage_Operation_is_greater_than, |
| 281 |
Messages.BugzillaSearchPage_Operation_contains_any_of_he_words, |
| 282 |
Messages.BugzillaSearchPage_Operation_contains_all_of_the_words, |
| 283 |
Messages.BugzillaSearchPage_Operation_contains_none_of_the_words, |
| 284 |
Messages.BugzillaSearchPage_Operation_changed_before, Messages.BugzillaSearchPage_Operation_changed_after, |
| 285 |
Messages.BugzillaSearchPage_Operation_changed_from, Messages.BugzillaSearchPage_Operation_changed_to, |
| 286 |
Messages.BugzillaSearchPage_Operation_changed_by, Messages.BugzillaSearchPage_Operation_matches }; |
| 287 |
|
| 288 |
private static final String[] chartOperationValues = { "noop", "equals", "notequals", "anyexact", "substring", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ |
| 289 |
"casesubstring", "notsubstring", "anywordssubstr", "allwordssubstr", "nowordssubstr", "regexp", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
| 290 |
"notregexp", "lessthan", "greaterthan", "anywords", "allwords", "nowords", "changedbefore", "changedafter", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ |
| 291 |
"changedfrom", "changedto", "changedby", "matches" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
| 292 |
|
| 152 |
// dialog store id constants |
293 |
// dialog store id constants |
| 153 |
private final static String DIALOG_BOUNDS_KEY = "ResizableDialogBounds"; //$NON-NLS-1$ |
294 |
private final static String DIALOG_BOUNDS_KEY = "ResizableDialogBounds"; //$NON-NLS-1$ |
| 154 |
|
295 |
|
|
|
296 |
private final static String REGEXP_CHART_EXPR = "(field|type|value)([0-9]+)-([0-9]+)-([0-9]+)"; //$NON-NLS-1$ |
| 297 |
|
| 298 |
private static final Pattern PATTERN_CHART_EXPR = Pattern.compile(REGEXP_CHART_EXPR, Pattern.CASE_INSENSITIVE); |
| 299 |
|
| 300 |
private final static String REGEXP_CHART_NEGATE = "(negate)([0-9]+)"; //$NON-NLS-1$ |
| 301 |
|
| 302 |
private static final Pattern PATTERN_CHART_NEGATE = Pattern.compile(REGEXP_CHART_NEGATE, Pattern.CASE_INSENSITIVE); |
| 303 |
|
| 155 |
private static final String X = "x"; //$NON-NLS-1$ |
304 |
private static final String X = "x"; //$NON-NLS-1$ |
| 156 |
|
305 |
|
| 157 |
private static final String Y = "y"; //$NON-NLS-1$ |
306 |
private static final String Y = "y"; //$NON-NLS-1$ |
|
Lines 216-221
Link Here
|
| 216 |
|
365 |
|
| 217 |
protected Text daysText; |
366 |
protected Text daysText; |
| 218 |
|
367 |
|
|
|
368 |
protected String[] chartFieldText; |
| 369 |
|
| 370 |
protected String[] chartFieldValues; |
| 371 |
|
| 219 |
// /** File containing saved queries */ |
372 |
// /** File containing saved queries */ |
| 220 |
// protected static SavedQueryFile input; |
373 |
// protected static SavedQueryFile input; |
| 221 |
|
374 |
|
|
Lines 292-297
Link Here
|
| 292 |
|
445 |
|
| 293 |
private ExpandableComposite moreOptionsExpandComposite; |
446 |
private ExpandableComposite moreOptionsExpandComposite; |
| 294 |
|
447 |
|
|
|
448 |
//FB private ExpandableComposite basicOptionsExpandComposite; |
| 449 |
|
| 450 |
private ExpandableComposite chartExpandComposite; |
| 451 |
|
| 452 |
// private Group chartGroup; |
| 453 |
private Composite chartGroup; |
| 454 |
|
| 455 |
protected class ChartExpression { |
| 456 |
private int fieldName; |
| 457 |
|
| 458 |
private int operation; |
| 459 |
|
| 460 |
private String value; |
| 461 |
|
| 462 |
public ChartExpression(int fieldName, int operation, String value) { |
| 463 |
super(); |
| 464 |
this.fieldName = fieldName; |
| 465 |
this.operation = operation; |
| 466 |
this.value = value; |
| 467 |
} |
| 468 |
|
| 469 |
public int getFieldName() { |
| 470 |
return fieldName; |
| 471 |
} |
| 472 |
|
| 473 |
public void setFieldName(int fieldName) { |
| 474 |
this.fieldName = fieldName; |
| 475 |
} |
| 476 |
|
| 477 |
public int getOperation() { |
| 478 |
return operation; |
| 479 |
} |
| 480 |
|
| 481 |
public void setOperation(int operation) { |
| 482 |
this.operation = operation; |
| 483 |
} |
| 484 |
|
| 485 |
public String getValue() { |
| 486 |
return value; |
| 487 |
} |
| 488 |
|
| 489 |
public void setValue(String value) { |
| 490 |
this.value = value; |
| 491 |
} |
| 492 |
} |
| 493 |
|
| 494 |
protected class Chart { |
| 495 |
private final ArrayList<ArrayList<ChartExpression>> expressions; |
| 496 |
|
| 497 |
private boolean negate; |
| 498 |
|
| 499 |
public Chart() { |
| 500 |
super(); |
| 501 |
ChartExpression expression = new ChartExpression(0, 0, ""); //$NON-NLS-1$ |
| 502 |
ArrayList<ChartExpression> column = new ArrayList<ChartExpression>(1); |
| 503 |
column.add(expression); |
| 504 |
expressions = new ArrayList<ArrayList<ChartExpression>>(1); |
| 505 |
expressions.add(column); |
| 506 |
negate = false; |
| 507 |
} |
| 508 |
|
| 509 |
public boolean isNegate() { |
| 510 |
return negate; |
| 511 |
} |
| 512 |
|
| 513 |
public void setNegate(boolean negate) { |
| 514 |
this.negate = negate; |
| 515 |
} |
| 516 |
|
| 517 |
public void addExpression(int rowIndex, int columnIndex) { |
| 518 |
ChartExpression expression = new ChartExpression(0, 0, ""); //$NON-NLS-1$ |
| 519 |
int size = expressions.size(); |
| 520 |
if (rowIndex > size + 1) { |
| 521 |
rowIndex = size + 1; |
| 522 |
} |
| 523 |
if (rowIndex < 0) { |
| 524 |
rowIndex = 0; |
| 525 |
} |
| 526 |
ArrayList<ChartExpression> row; |
| 527 |
if (rowIndex == size) { |
| 528 |
row = new ArrayList<BugzillaSearchPage.ChartExpression>(); |
| 529 |
expressions.add(rowIndex, row); |
| 530 |
} else { |
| 531 |
row = expressions.get(rowIndex); |
| 532 |
} |
| 533 |
if (row != null) { |
| 534 |
int size1 = expressions.size(); |
| 535 |
if (columnIndex > size1 + 1) { |
| 536 |
columnIndex = size1 + 1; |
| 537 |
} |
| 538 |
if (columnIndex < 0) { |
| 539 |
columnIndex = 0; |
| 540 |
} |
| 541 |
row.add(columnIndex, expression); |
| 542 |
} |
| 543 |
|
| 544 |
} |
| 545 |
|
| 546 |
public void addRow(int index) { |
| 547 |
int size = expressions.size(); |
| 548 |
if (index > size) { |
| 549 |
index = size; |
| 550 |
} |
| 551 |
if (index < 0) { |
| 552 |
index = 0; |
| 553 |
} |
| 554 |
addRow(index); |
| 555 |
} |
| 556 |
|
| 557 |
public int getRowSize() { |
| 558 |
return expressions.size(); |
| 559 |
} |
| 560 |
|
| 561 |
public int getColumnSize(int row) { |
| 562 |
int size = expressions.size(); |
| 563 |
if (row > size) { |
| 564 |
row = size; |
| 565 |
} |
| 566 |
if (row < 0) { |
| 567 |
row = 0; |
| 568 |
} |
| 569 |
return expressions.get(row).size(); |
| 570 |
} |
| 571 |
|
| 572 |
public ChartExpression getChartExpression(int row, int column) { |
| 573 |
int rowSize = expressions.size(); |
| 574 |
if (row > rowSize) { |
| 575 |
row = rowSize; |
| 576 |
} |
| 577 |
if (row < 0) { |
| 578 |
row = 0; |
| 579 |
} |
| 580 |
|
| 581 |
int columnSize = getColumnSize(row); |
| 582 |
if (column > columnSize) { |
| 583 |
column = columnSize; |
| 584 |
} |
| 585 |
if (column < 0) { |
| 586 |
column = 0; |
| 587 |
} |
| 588 |
return expressions.get(row).get(column); |
| 589 |
} |
| 590 |
} |
| 591 |
|
| 592 |
private final ArrayList<Chart> charts = new ArrayList<BugzillaSearchPage.Chart>(1); |
| 593 |
|
| 594 |
private class ChartControls { |
| 595 |
private final Combo field; |
| 596 |
|
| 597 |
private final Combo operation; |
| 598 |
|
| 599 |
private final Combo value; |
| 600 |
|
| 601 |
public ChartControls(Combo field, Combo operation, Combo value) { |
| 602 |
super(); |
| 603 |
this.field = field; |
| 604 |
this.operation = operation; |
| 605 |
this.value = value; |
| 606 |
} |
| 607 |
|
| 608 |
public Combo getField() { |
| 609 |
return field; |
| 610 |
} |
| 611 |
|
| 612 |
public Combo getOperation() { |
| 613 |
return operation; |
| 614 |
} |
| 615 |
|
| 616 |
public Combo getValue() { |
| 617 |
return value; |
| 618 |
} |
| 619 |
} |
| 620 |
|
| 621 |
private final ArrayList<ArrayList<ArrayList<ChartControls>>> chartControls = new ArrayList<ArrayList<ArrayList<ChartControls>>>(); |
| 622 |
|
| 623 |
private final ArrayList<Button> negateButtons = new ArrayList<Button>(); |
| 624 |
|
| 295 |
private final SelectionAdapter updateActionSelectionAdapter = new SelectionAdapter() { |
625 |
private final SelectionAdapter updateActionSelectionAdapter = new SelectionAdapter() { |
| 296 |
@Override |
626 |
@Override |
| 297 |
public void widgetSelected(SelectionEvent e) { |
627 |
public void widgetSelected(SelectionEvent e) { |
|
Lines 452-457
Link Here
|
| 452 |
queryTitle.addModifyListener(new ModifyListenerImplementation()); |
782 |
queryTitle.addModifyListener(new ModifyListenerImplementation()); |
| 453 |
queryTitle.setFocus(); |
783 |
queryTitle.setFocus(); |
| 454 |
} |
784 |
} |
|
|
785 |
chartFieldText = chartFieldTextDefault.toArray(new String[chartFieldTextDefault.size()]); |
| 786 |
chartFieldValues = chartFieldValuesDefault.toArray(new String[chartFieldValuesDefault.size()]); |
| 787 |
|
| 788 |
// basicOptionsExpandComposite = toolkit.createExpandableComposite(basicComposite, ExpandableComposite.COMPACT |
| 789 |
// | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); |
| 790 |
// basicOptionsExpandComposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); |
| 791 |
// basicOptionsExpandComposite.setBackground(null); |
| 792 |
// basicOptionsExpandComposite.setText("Basic Options"); |
| 793 |
// basicOptionsExpandComposite.setLayout(new GridLayout(3, false)); |
| 794 |
// g = new GridData(GridData.FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, true); |
| 795 |
// g.horizontalSpan = 4; |
| 796 |
// g.horizontalIndent = INDENT; |
| 797 |
// basicOptionsExpandComposite.setLayoutData(g); |
| 798 |
// basicOptionsExpandComposite.addExpansionListener(new ExpansionAdapter() { |
| 799 |
// @Override |
| 800 |
// public void expansionStateChanged(ExpansionEvent e) { |
| 801 |
// if ((Boolean) e.data == true) { |
| 802 |
// Point minSize = getControl().getShell().getMinimumSize(); |
| 803 |
// minSize.y = 460; |
| 804 |
// getControl().getShell().setMinimumSize(minSize); |
| 805 |
// } else { |
| 806 |
// Point minSize = getControl().getShell().getMinimumSize(); |
| 807 |
// minSize.y = 250; |
| 808 |
// getControl().getShell().setMinimumSize(minSize); |
| 809 |
// } |
| 810 |
// Shell shell = getShell(); |
| 811 |
// shell.pack(); |
| 812 |
// Point shellSize = shell.getSize(); |
| 813 |
// shellSize.x++; |
| 814 |
// shell.setSize(shellSize); |
| 815 |
// shellSize.x--; |
| 816 |
// shell.setSize(shellSize); |
| 817 |
// } |
| 818 |
// }); |
| 819 |
// |
| 820 |
// Composite basicOptionsComposite = new Composite(basicOptionsExpandComposite, SWT.NULL); |
| 821 |
// GridLayout basicOptionsLayout = new GridLayout(4, false); |
| 822 |
// basicOptionsLayout.marginHeight = 0; |
| 823 |
// basicOptionsLayout.marginWidth = 0; |
| 824 |
// basicOptionsComposite.setLayout(basicOptionsLayout); |
| 825 |
// |
| 826 |
// Dialog.applyDialogFont(basicOptionsComposite); |
| 827 |
// basicOptionsExpandComposite.setClient(basicOptionsComposite); |
| 828 |
// createBasicComposite(basicOptionsComposite); |
| 455 |
createBasicComposite(basicComposite); |
829 |
createBasicComposite(basicComposite); |
| 456 |
|
830 |
|
| 457 |
moreOptionsExpandComposite = toolkit.createExpandableComposite(control, ExpandableComposite.COMPACT |
831 |
moreOptionsExpandComposite = toolkit.createExpandableComposite(control, ExpandableComposite.COMPACT |
|
Lines 460-466
Link Here
|
| 460 |
moreOptionsExpandComposite.setBackground(null); |
834 |
moreOptionsExpandComposite.setBackground(null); |
| 461 |
moreOptionsExpandComposite.setText(Messages.BugzillaSearchPage_More_Options); |
835 |
moreOptionsExpandComposite.setText(Messages.BugzillaSearchPage_More_Options); |
| 462 |
moreOptionsExpandComposite.setLayout(new GridLayout(3, false)); |
836 |
moreOptionsExpandComposite.setLayout(new GridLayout(3, false)); |
| 463 |
g = new GridData(GridData.FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false); |
837 |
g = new GridData(GridData.FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, true); |
| 464 |
g.horizontalSpan = 4; |
838 |
g.horizontalSpan = 4; |
| 465 |
g.horizontalIndent = INDENT; |
839 |
g.horizontalIndent = INDENT; |
| 466 |
moreOptionsExpandComposite.setLayoutData(g); |
840 |
moreOptionsExpandComposite.setLayoutData(g); |
|
Lines 469-479
Link Here
|
| 469 |
public void expansionStateChanged(ExpansionEvent e) { |
843 |
public void expansionStateChanged(ExpansionEvent e) { |
| 470 |
if ((Boolean) e.data == true) { |
844 |
if ((Boolean) e.data == true) { |
| 471 |
Point minSize = getControl().getShell().getMinimumSize(); |
845 |
Point minSize = getControl().getShell().getMinimumSize(); |
| 472 |
minSize.y = 660; |
846 |
minSize.y = 460; |
| 473 |
getControl().getShell().setMinimumSize(minSize); |
847 |
getControl().getShell().setMinimumSize(minSize); |
| 474 |
} else { |
848 |
} else { |
| 475 |
Point minSize = getControl().getShell().getMinimumSize(); |
849 |
Point minSize = getControl().getShell().getMinimumSize(); |
| 476 |
minSize.y = 450; |
850 |
minSize.y = 250; |
| 477 |
getControl().getShell().setMinimumSize(minSize); |
851 |
getControl().getShell().setMinimumSize(minSize); |
| 478 |
} |
852 |
} |
| 479 |
Shell shell = getShell(); |
853 |
Shell shell = getShell(); |
|
Lines 495-506
Link Here
|
| 495 |
Dialog.applyDialogFont(moreOptionsComposite); |
869 |
Dialog.applyDialogFont(moreOptionsComposite); |
| 496 |
moreOptionsExpandComposite.setClient(moreOptionsComposite); |
870 |
moreOptionsExpandComposite.setClient(moreOptionsComposite); |
| 497 |
|
871 |
|
|
|
872 |
chartExpandComposite = toolkit.createExpandableComposite(control, ExpandableComposite.COMPACT |
| 873 |
| ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); |
| 874 |
chartExpandComposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); |
| 875 |
chartExpandComposite.setBackground(null); |
| 876 |
chartExpandComposite.setText(Messages.BugzillaSearchPage_Field_0); |
| 877 |
chartExpandComposite.setLayout(new GridLayout(1, false)); |
| 878 |
g = new GridData(GridData.FILL, GridData.FILL, true, false); |
| 879 |
g.horizontalSpan = 4; |
| 880 |
g.horizontalIndent = INDENT; |
| 881 |
chartExpandComposite.setLayoutData(g); |
| 882 |
//FB chartExpandComposite.setBackground(new Color(moreOptionsExpandComposite.getDisplay(), 128, 128, 0)); |
| 883 |
|
| 884 |
chartExpandComposite.addExpansionListener(new ExpansionAdapter() { |
| 885 |
@Override |
| 886 |
public void expansionStateChanged(ExpansionEvent e) { |
| 887 |
if ((Boolean) e.data == true) { |
| 888 |
Point minSize = getControl().getShell().getMinimumSize(); |
| 889 |
minSize.y = 300; |
| 890 |
getControl().getShell().setMinimumSize(minSize); |
| 891 |
} else { |
| 892 |
Point minSize = getControl().getShell().getMinimumSize(); |
| 893 |
minSize.y = 90; |
| 894 |
getControl().getShell().setMinimumSize(minSize); |
| 895 |
} |
| 896 |
Shell shell = getShell(); |
| 897 |
shell.pack(); |
| 898 |
Point shellSize = shell.getSize(); |
| 899 |
shellSize.x++; |
| 900 |
shell.setSize(shellSize); |
| 901 |
shellSize.x--; |
| 902 |
shell.setSize(shellSize); |
| 903 |
} |
| 904 |
}); |
| 905 |
|
| 906 |
// Composite chartOptionsComposite = new Composite(chartExpandComposite, SWT.NULL); |
| 907 |
// GridLayout chartLayout = new GridLayout(1, false); |
| 908 |
// chartLayout.marginHeight = 0; |
| 909 |
// chartLayout.marginWidth = 0; |
| 910 |
// chartOptionsComposite.setLayout(chartLayout); |
| 911 |
// GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 1, 1); |
| 912 |
// chartOptionsComposite.setBackground(new Color(chartExpandComposite.getDisplay(), 0, 128, 128)); |
| 913 |
// chartOptionsComposite.setLayoutData(gd); |
| 914 |
// |
| 915 |
// Dialog.applyDialogFont(chartOptionsComposite); |
| 916 |
// chartExpandComposite.setClient(chartOptionsComposite); |
| 917 |
|
| 498 |
createMoreOptionsComposite(moreOptionsComposite); |
918 |
createMoreOptionsComposite(moreOptionsComposite); |
| 499 |
createSearchGroup(moreOptionsComposite); |
919 |
createSearchGroup(moreOptionsComposite); |
|
|
920 |
// createChartGroup(chartOptionsComposite); |
| 921 |
createChartGroup(chartExpandComposite); |
| 922 |
chartExpandComposite.setClient(chartGroup); |
| 923 |
|
| 500 |
if (inSearchContainer()) { |
924 |
if (inSearchContainer()) { |
| 501 |
control.getShell().setMinimumSize(new Point(610, 450)); |
925 |
control.getShell().setMinimumSize(new Point(210, 450)); |
| 502 |
} else { |
926 |
} else { |
| 503 |
control.getShell().setMinimumSize(new Point(590, 450)); |
927 |
control.getShell().setMinimumSize(new Point(190, 450)); |
| 504 |
} |
928 |
} |
| 505 |
} |
929 |
} |
| 506 |
|
930 |
|
|
Lines 974-980
Link Here
|
| 974 |
gd_os.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
1398 |
gd_os.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
| 975 |
os.setLayoutData(gd_os); |
1399 |
os.setLayoutData(gd_os); |
| 976 |
os.addSelectionListener(updateActionSelectionAdapter); |
1400 |
os.addSelectionListener(updateActionSelectionAdapter); |
| 977 |
|
|
|
| 978 |
} |
1401 |
} |
| 979 |
|
1402 |
|
| 980 |
private void createSearchGroup(Composite control) { |
1403 |
private void createSearchGroup(Composite control) { |
|
Lines 1161-1166
Link Here
|
| 1161 |
if (originalQuery != null) { |
1584 |
if (originalQuery != null) { |
| 1162 |
try { |
1585 |
try { |
| 1163 |
updateDefaults(originalQuery.getUrl()); |
1586 |
updateDefaults(originalQuery.getUrl()); |
|
|
1587 |
refreshChartControls(); |
| 1164 |
} catch (UnsupportedEncodingException e) { |
1588 |
} catch (UnsupportedEncodingException e) { |
| 1165 |
// ignore |
1589 |
// ignore |
| 1166 |
} |
1590 |
} |
|
Lines 1466-1472
Link Here
|
| 1466 |
sb.append("&status_whiteboard_type="); //$NON-NLS-1$ |
1890 |
sb.append("&status_whiteboard_type="); //$NON-NLS-1$ |
| 1467 |
sb.append(patternOperationValues[whiteboardOperation.getSelectionIndex()]); |
1891 |
sb.append(patternOperationValues[whiteboardOperation.getSelectionIndex()]); |
| 1468 |
appendToBuffer(sb, "&status_whiteboard=", whiteboardPattern.getText()); //$NON-NLS-1$ |
1892 |
appendToBuffer(sb, "&status_whiteboard=", whiteboardPattern.getText()); //$NON-NLS-1$ |
| 1469 |
|
1893 |
int indexMax = charts.size(); |
|
|
1894 |
for (int index = 0; index < indexMax; index++) { |
| 1895 |
Chart chart = charts.get(index); |
| 1896 |
if (chart.isNegate()) { |
| 1897 |
sb.append("&negate" + index + "=1"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 1898 |
} |
| 1899 |
int rowMax = chart.getRowSize(); |
| 1900 |
for (int row = 0; row < rowMax; row++) { |
| 1901 |
int columnMax = chart.getColumnSize(row); |
| 1902 |
for (int column = 0; column < columnMax; column++) { |
| 1903 |
ChartExpression chartExpression = chart.getChartExpression(row, column); |
| 1904 |
if (chartExpression.getFieldName() == 0) { |
| 1905 |
continue; |
| 1906 |
} |
| 1907 |
sb.append("&field" + index + "-" + row + "-" + column + "=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
| 1908 |
+ chartFieldValues[chartExpression.getFieldName()]); |
| 1909 |
sb.append("&type" + index + "-" + row + "-" + column + "=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
| 1910 |
+ chartOperationValues[chartExpression.getOperation()]); |
| 1911 |
sb.append("&value" + index + "-" + row + "-" + column + "=" + chartExpression.getValue()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
| 1912 |
} |
| 1913 |
} |
| 1914 |
} |
| 1470 |
return sb; |
1915 |
return sb; |
| 1471 |
} |
1916 |
} |
| 1472 |
|
1917 |
|
|
Lines 1496-1501
Link Here
|
| 1496 |
getDialogSettings(); |
1941 |
getDialogSettings(); |
| 1497 |
} |
1942 |
} |
| 1498 |
|
1943 |
|
|
|
1944 |
@SuppressWarnings("unchecked") |
| 1499 |
private void updateAttributesFromConfiguration(String[] selectedProducts) { |
1945 |
private void updateAttributesFromConfiguration(String[] selectedProducts) { |
| 1500 |
if (repositoryConfiguration != null) { |
1946 |
if (repositoryConfiguration != null) { |
| 1501 |
String[] saved_product = product.getSelection(); |
1947 |
String[] saved_product = product.getSelection(); |
|
Lines 1542-1547
Link Here
|
| 1542 |
setSelection(priority, saved_priority); |
1988 |
setSelection(priority, saved_priority); |
| 1543 |
setSelection(hardware, saved_hardware); |
1989 |
setSelection(hardware, saved_hardware); |
| 1544 |
setSelection(os, saved_os); |
1990 |
setSelection(os, saved_os); |
|
|
1991 |
|
| 1992 |
if (repositoryConfiguration != null) { |
| 1993 |
ArrayList<String> fieldText = (ArrayList<String>) chartFieldTextDefault.clone(); |
| 1994 |
ArrayList<String> fieldValue = (ArrayList<String>) chartFieldValuesDefault.clone(); |
| 1995 |
|
| 1996 |
for (BugzillaCustomField bugzillaCustomField : repositoryConfiguration.getCustomFields()) { |
| 1997 |
fieldValue.add(bugzillaCustomField.getName()); |
| 1998 |
fieldText.add(bugzillaCustomField.getDescription()); |
| 1999 |
} |
| 2000 |
chartFieldText = fieldText.toArray(new String[fieldText.size()]); |
| 2001 |
chartFieldValues = fieldValue.toArray(new String[fieldValue.size()]); |
| 2002 |
recreateChartControls(); |
| 2003 |
} |
| 2004 |
|
| 1545 |
} |
2005 |
} |
| 1546 |
} |
2006 |
} |
| 1547 |
|
2007 |
|
|
Lines 1566-1572
Link Here
|
| 1566 |
public void updateDefaults(String startingUrl) throws UnsupportedEncodingException { |
2026 |
public void updateDefaults(String startingUrl) throws UnsupportedEncodingException { |
| 1567 |
// String serverName = startingUrl.substring(0, |
2027 |
// String serverName = startingUrl.substring(0, |
| 1568 |
// startingUrl.indexOf("?")); |
2028 |
// startingUrl.indexOf("?")); |
| 1569 |
|
2029 |
boolean adjustChart = false; |
| 1570 |
startingUrl = startingUrl.substring(startingUrl.indexOf("?") + 1); //$NON-NLS-1$ |
2030 |
startingUrl = startingUrl.substring(startingUrl.indexOf("?") + 1); //$NON-NLS-1$ |
| 1571 |
String[] options = startingUrl.split("&"); //$NON-NLS-1$ |
2031 |
String[] options = startingUrl.split("&"); //$NON-NLS-1$ |
| 1572 |
for (String option : options) { |
2032 |
for (String option : options) { |
|
Lines 1586-1598
Link Here
|
| 1586 |
if (key.equals("short_desc")) { //$NON-NLS-1$ |
2046 |
if (key.equals("short_desc")) { //$NON-NLS-1$ |
| 1587 |
summaryPattern.setText(value); |
2047 |
summaryPattern.setText(value); |
| 1588 |
} else if (key.equals("short_desc_type")) { //$NON-NLS-1$ |
2048 |
} else if (key.equals("short_desc_type")) { //$NON-NLS-1$ |
| 1589 |
if (value.equals("allwordssubstr")) { //$NON-NLS-1$ |
|
|
| 1590 |
value = "all words"; //$NON-NLS-1$ |
| 1591 |
} else if (value.equals("anywordssubstr")) { //$NON-NLS-1$ |
| 1592 |
value = "any word"; //$NON-NLS-1$ |
| 1593 |
} |
| 1594 |
int index = 0; |
2049 |
int index = 0; |
| 1595 |
for (String item : summaryOperation.getItems()) { |
2050 |
for (String item : patternOperationValues) { |
| 1596 |
if (item.compareTo(value) == 0) { |
2051 |
if (item.compareTo(value) == 0) { |
| 1597 |
break; |
2052 |
break; |
| 1598 |
} |
2053 |
} |
|
Lines 1638-1650
Link Here
|
| 1638 |
sel = new String[selList.size()]; |
2093 |
sel = new String[selList.size()]; |
| 1639 |
version.setSelection(selList.toArray(sel)); |
2094 |
version.setSelection(selList.toArray(sel)); |
| 1640 |
} else if (key.equals("long_desc_type")) { //$NON-NLS-1$ |
2095 |
} else if (key.equals("long_desc_type")) { //$NON-NLS-1$ |
| 1641 |
if (value.equals("allwordssubstr")) { //$NON-NLS-1$ |
|
|
| 1642 |
value = "all words"; //$NON-NLS-1$ |
| 1643 |
} else if (value.equals("anywordssubstr")) { //$NON-NLS-1$ |
| 1644 |
value = "any word"; //$NON-NLS-1$ |
| 1645 |
} |
| 1646 |
int index = 0; |
2096 |
int index = 0; |
| 1647 |
for (String item : commentOperation.getItems()) { |
2097 |
for (String item : patternOperationValues) { |
| 1648 |
if (item.compareTo(value) == 0) { |
2098 |
if (item.compareTo(value) == 0) { |
| 1649 |
break; |
2099 |
break; |
| 1650 |
} |
2100 |
} |
|
Lines 1826-1833
Link Here
|
| 1826 |
} |
2276 |
} |
| 1827 |
index++; |
2277 |
index++; |
| 1828 |
} |
2278 |
} |
|
|
2279 |
} else if (key.equals("status_whiteboard_type")) { //$NON-NLS-1$ |
| 2280 |
int index = 0; |
| 2281 |
for (String item : patternOperationValues) { |
| 2282 |
if (item.compareTo(value) == 0) { |
| 2283 |
break; |
| 2284 |
} |
| 2285 |
index++; |
| 2286 |
} |
| 2287 |
if (index < whiteboardOperation.getItemCount()) { |
| 2288 |
whiteboardOperation.select(index); |
| 2289 |
} |
| 2290 |
} else if (key.equals("status_whiteboard")) { //$NON-NLS-1$ |
| 2291 |
whiteboardPattern.setText(value); |
| 2292 |
} else if (key.matches(REGEXP_CHART_EXPR)) { |
| 2293 |
Matcher mb = PATTERN_CHART_EXPR.matcher(key); |
| 2294 |
if (mb.find()) { |
| 2295 |
String g1 = mb.group(1); |
| 2296 |
String g2 = mb.group(2); |
| 2297 |
String g3 = mb.group(3); |
| 2298 |
String g4 = mb.group(4); |
| 2299 |
int chartNumber, row, column; |
| 2300 |
try { |
| 2301 |
chartNumber = Integer.parseInt(g2); |
| 2302 |
row = Integer.parseInt(g3); |
| 2303 |
column = Integer.parseInt(g4); |
| 2304 |
} catch (Exception E) { |
| 2305 |
chartNumber = -1; |
| 2306 |
row = -1; |
| 2307 |
column = -1; |
| 2308 |
} |
| 2309 |
for (int i = charts.size(); i <= chartNumber; i++) { |
| 2310 |
charts.add(new Chart()); |
| 2311 |
adjustChart = true; |
| 2312 |
} |
| 2313 |
for (int i = charts.get(chartNumber).getRowSize(); i <= row; i++) { |
| 2314 |
charts.get(chartNumber).addExpression(i, 0); |
| 2315 |
adjustChart = true; |
| 2316 |
} |
| 2317 |
for (int i = charts.get(chartNumber).getColumnSize(row); i <= column; i++) { |
| 2318 |
charts.get(chartNumber).addExpression(row, i); |
| 2319 |
adjustChart = true; |
| 2320 |
} |
| 2321 |
ChartExpression ex = charts.get(chartNumber).getChartExpression(row, column); |
| 2322 |
if ("field".equals(g1)) { //$NON-NLS-1$ |
| 2323 |
int index1 = 0; |
| 2324 |
for (String item : chartFieldValues) { |
| 2325 |
if (item.compareTo(value) == 0) { |
| 2326 |
break; |
| 2327 |
} |
| 2328 |
index1++; |
| 2329 |
} |
| 2330 |
if (index1 < chartFieldValues.length) { |
| 2331 |
ex.setFieldName(index1); |
| 2332 |
} |
| 2333 |
} else if ("type".equals(g1)) { //$NON-NLS-1$ |
| 2334 |
int index1 = 0; |
| 2335 |
for (String item : chartOperationValues) { |
| 2336 |
if (item.compareTo(value) == 0) { |
| 2337 |
break; |
| 2338 |
} |
| 2339 |
index1++; |
| 2340 |
} |
| 2341 |
if (index1 < chartOperationValues.length) { |
| 2342 |
ex.setOperation(index1); |
| 2343 |
} |
| 2344 |
} else if ("value".equals(g1)) { //$NON-NLS-1$ |
| 2345 |
ex.setValue(value); |
| 2346 |
} |
| 2347 |
|
| 2348 |
} |
| 2349 |
} else if (key.matches(REGEXP_CHART_NEGATE)) { |
| 2350 |
Matcher mb = PATTERN_CHART_NEGATE.matcher(key); |
| 2351 |
if (mb.find()) { |
| 2352 |
String g2 = mb.group(2); |
| 2353 |
int index; |
| 2354 |
try { |
| 2355 |
index = Integer.parseInt(g2); |
| 2356 |
} catch (Exception E) { |
| 2357 |
index = -1; |
| 2358 |
} |
| 2359 |
Chart ch = charts.get(index); |
| 2360 |
ch.setNegate("1".equals(value)); //$NON-NLS-1$ |
| 2361 |
} |
| 1829 |
} |
2362 |
} |
| 1830 |
} |
2363 |
} |
|
|
2364 |
if (adjustChart) { |
| 2365 |
recreateChartControls(); |
| 2366 |
} |
| 1831 |
} |
2367 |
} |
| 1832 |
|
2368 |
|
| 1833 |
private String[] nonNullArray(IDialogSettings settings, String id) { |
2369 |
private String[] nonNullArray(IDialogSettings settings, String id) { |
|
Lines 2159-2162
Link Here
|
| 2159 |
return currentSize.x < newSize.x || currentSize.y != newSize.y; |
2695 |
return currentSize.x < newSize.x || currentSize.y != newSize.y; |
| 2160 |
} |
2696 |
} |
| 2161 |
|
2697 |
|
|
|
2698 |
private void createChartGroup(final Composite parent) { |
| 2699 |
GridLayout layout; |
| 2700 |
GridData gd; |
| 2701 |
|
| 2702 |
chartGroup = new Group(parent, SWT.NONE); |
| 2703 |
layout = new GridLayout(1, false); |
| 2704 |
chartGroup.setLayout(layout); |
| 2705 |
gd = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1); |
| 2706 |
//FB chartGroup.setBackground(new Color(parent.getDisplay(), 0, 0, 255)); |
| 2707 |
chartGroup.setLayoutData(gd); |
| 2708 |
|
| 2709 |
createNewChartControls(chartGroup, 0); |
| 2710 |
|
| 2711 |
parent.layout(true); |
| 2712 |
parent.redraw(); |
| 2713 |
} |
| 2714 |
|
| 2715 |
private void createChartControls(final Composite chartGroup, final int chartNumber, final int row, final int column) { |
| 2716 |
final Combo comboField = new Combo(chartGroup, SWT.SINGLE | SWT.BORDER); |
| 2717 |
comboField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 2718 |
comboField.addModifyListener(new ModifyListenerImplementation()); |
| 2719 |
comboField.setItems(chartFieldText); |
| 2720 |
comboField.setText(chartFieldText[0]); |
| 2721 |
comboField.addSelectionListener(new SelectionAdapter() { |
| 2722 |
@Override |
| 2723 |
public void widgetSelected(SelectionEvent e) { |
| 2724 |
ChartExpression chartExpression = charts.get(chartNumber).getChartExpression(row, column); |
| 2725 |
chartExpression.setFieldName(comboField.getSelectionIndex()); |
| 2726 |
chartGroup.getShell().layout(true); |
| 2727 |
chartGroup.getShell().redraw(); |
| 2728 |
} |
| 2729 |
}); |
| 2730 |
|
| 2731 |
final Combo comboOperation = new Combo(chartGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); |
| 2732 |
comboOperation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 2733 |
comboOperation.setItems(chartOperationText); |
| 2734 |
comboOperation.setText(chartOperationText[0]); |
| 2735 |
comboOperation.select(0); |
| 2736 |
comboOperation.addSelectionListener(new SelectionAdapter() { |
| 2737 |
@Override |
| 2738 |
public void widgetSelected(SelectionEvent e) { |
| 2739 |
ChartExpression chartExpression = charts.get(chartNumber).getChartExpression(row, column); |
| 2740 |
chartExpression.setOperation(comboOperation.getSelectionIndex()); |
| 2741 |
} |
| 2742 |
}); |
| 2743 |
|
| 2744 |
final Combo comboValue = new Combo(chartGroup, SWT.SINGLE | SWT.BORDER); |
| 2745 |
GridData g = new GridData(GridData.FILL, GridData.CENTER, true, false); |
| 2746 |
g.widthHint = 150; |
| 2747 |
comboValue.setLayoutData(g); |
| 2748 |
comboValue.addModifyListener(new ModifyListener() { |
| 2749 |
|
| 2750 |
public void modifyText(ModifyEvent e) { |
| 2751 |
ChartExpression chartExpression = charts.get(chartNumber).getChartExpression(row, column); |
| 2752 |
chartExpression.setValue(comboValue.getText()); |
| 2753 |
if (isControlCreated()) { |
| 2754 |
setPageComplete(isPageComplete()); |
| 2755 |
} |
| 2756 |
} |
| 2757 |
}); |
| 2758 |
|
| 2759 |
Button orButton = new Button(chartGroup, SWT.PUSH); |
| 2760 |
orButton.setText(Messages.BugzillaSearchPage_OR_Button); |
| 2761 |
g = new GridData(SWT.LEFT, SWT.CENTER, false, false); |
| 2762 |
orButton.setLayoutData(g); |
| 2763 |
orButton.addSelectionListener(new SelectionAdapter() { |
| 2764 |
@Override |
| 2765 |
public void widgetSelected(SelectionEvent e) { |
| 2766 |
int y = charts.get(chartNumber).getColumnSize(row); |
| 2767 |
charts.get(chartNumber).addExpression(row, column + 1); |
| 2768 |
createChartControls(chartGroup, chartNumber, row, y); |
| 2769 |
} |
| 2770 |
}); |
| 2771 |
if (column == 0) { |
| 2772 |
final Button andButton = new Button(chartGroup.getParent(), SWT.PUSH); |
| 2773 |
andButton.setText(Messages.BugzillaSearchPage_AND_Button); |
| 2774 |
g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
| 2775 |
andButton.setLayoutData(g); |
| 2776 |
final Button newButton = new Button(chartGroup.getParent(), SWT.PUSH); |
| 2777 |
newButton.setText(Messages.BugzillaSearchPage_New_Chart_Button); |
| 2778 |
g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
| 2779 |
newButton.setLayoutData(g); |
| 2780 |
final Button negateButton = new Button(chartGroup.getParent(), SWT.CHECK); |
| 2781 |
negateButton.setText(Messages.BugzillaSearchPage_Negate_Button); |
| 2782 |
negateButtons.add(negateButton); |
| 2783 |
g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
| 2784 |
negateButton.setLayoutData(g); |
| 2785 |
negateButton.addSelectionListener(new SelectionAdapter() { |
| 2786 |
@Override |
| 2787 |
public void widgetSelected(SelectionEvent e) { |
| 2788 |
Chart chart = charts.get(chartNumber); |
| 2789 |
chart.setNegate(negateButton.getSelection()); |
| 2790 |
} |
| 2791 |
}); |
| 2792 |
newButton.addSelectionListener(new SelectionAdapter() { |
| 2793 |
@Override |
| 2794 |
public void widgetSelected(SelectionEvent e) { |
| 2795 |
newButton.setVisible(false); |
| 2796 |
newButton.dispose(); |
| 2797 |
createNewChartControls(chartGroup.getParent().getParent(), chartNumber + 1); |
| 2798 |
} |
| 2799 |
}); |
| 2800 |
andButton.addSelectionListener(new SelectionAdapter() { |
| 2801 |
@Override |
| 2802 |
public void widgetSelected(SelectionEvent e) { |
| 2803 |
if (!andButton.isDisposed()) { |
| 2804 |
andButton.setVisible(false); |
| 2805 |
andButton.dispose(); |
| 2806 |
} |
| 2807 |
if (!newButton.isDisposed()) { |
| 2808 |
newButton.setVisible(false); |
| 2809 |
newButton.dispose(); |
| 2810 |
} |
| 2811 |
if (!negateButton.isDisposed()) { |
| 2812 |
negateButton.setVisible(false); |
| 2813 |
negateButton.dispose(); |
| 2814 |
} |
| 2815 |
|
| 2816 |
Label lable = new Label(chartGroup.getParent(), SWT.NONE); |
| 2817 |
lable.setText(Messages.BugzillaSearchPage_AND_Button); |
| 2818 |
GridData g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1); |
| 2819 |
lable.setLayoutData(g); |
| 2820 |
|
| 2821 |
Group chartGroup1 = new Group(chartGroup.getParent(), SWT.NONE); |
| 2822 |
GridLayout layout = new GridLayout(4, false); |
| 2823 |
chartGroup1.setLayout(layout); |
| 2824 |
chartGroup1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 2825 |
GridData gd = new GridData(SWT.LEFT, SWT.CENTER, true, true, 3, 1); |
| 2826 |
chartGroup1.setLayoutData(gd); |
| 2827 |
|
| 2828 |
charts.get(chartNumber).addExpression(row + 1, 0); |
| 2829 |
createChartControls(chartGroup1, chartNumber, row + 1, 0); |
| 2830 |
} |
| 2831 |
}); |
| 2832 |
} |
| 2833 |
ChartControls chartControl = new ChartControls(comboField, comboOperation, comboValue); |
| 2834 |
int chart1 = chartControls.size(); |
| 2835 |
if (chart1 < chartNumber + 1) { |
| 2836 |
chartControls.add(new ArrayList<ArrayList<ChartControls>>()); |
| 2837 |
} |
| 2838 |
int chart2 = chartControls.get(chartNumber).size(); |
| 2839 |
if (chart2 < row + 1) { |
| 2840 |
chartControls.get(chartNumber).add(new ArrayList<BugzillaSearchPage.ChartControls>()); |
| 2841 |
} |
| 2842 |
chartControls.get(chartNumber).get(row).add(chartControl); |
| 2843 |
refreshChartControls(); |
| 2844 |
} |
| 2845 |
|
| 2846 |
private void createNewChartControls(final Composite chartGroup, final int chartNumber) { |
| 2847 |
final Group chartGroup0 = new Group(chartGroup, SWT.NONE); |
| 2848 |
if (chartNumber > 0) { |
| 2849 |
chartGroup0.setText(Messages.BugzillaSearchPage_OR_Label); |
| 2850 |
} |
| 2851 |
GridLayout layout = new GridLayout(3, false); |
| 2852 |
chartGroup0.setLayout(layout); |
| 2853 |
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 3, 1); |
| 2854 |
//FB chartGroup0.setBackground(new Color(chartGroup.getDisplay(), 255, 0, 0)); |
| 2855 |
chartGroup0.setLayoutData(gd); |
| 2856 |
|
| 2857 |
Group chartGroup1 = new Group(chartGroup0, SWT.NONE); |
| 2858 |
layout = new GridLayout(4, false); |
| 2859 |
chartGroup1.setLayout(layout); |
| 2860 |
gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 3, 1); |
| 2861 |
//FB chartGroup1.setBackground(new Color(chartGroup.getDisplay(), 0, 255, 0)); |
| 2862 |
chartGroup1.setLayoutData(gd); |
| 2863 |
|
| 2864 |
charts.add(new Chart()); |
| 2865 |
createChartControls(chartGroup1, chartNumber, 0, 0); |
| 2866 |
} |
| 2867 |
|
| 2868 |
private void refreshChartControls() { |
| 2869 |
int chartNumMax = chartControls.size(); |
| 2870 |
for (int chartNum = 0; chartNum < chartNumMax; chartNum++) { |
| 2871 |
int chartRowMax = chartControls.get(chartNum).size(); |
| 2872 |
for (int chartRow = 0; chartRow < chartRowMax; chartRow++) { |
| 2873 |
int chartColumnMax = chartControls.get(chartNum).get(chartRow).size(); |
| 2874 |
for (int chartColumn = 0; chartColumn < chartColumnMax; chartColumn++) { |
| 2875 |
ChartExpression expression = charts.get(chartNum).getChartExpression(chartRow, chartColumn); |
| 2876 |
ChartControls controls = chartControls.get(chartNum).get(chartRow).get(chartColumn); |
| 2877 |
controls.getField().setText(chartFieldText[expression.getFieldName()]); |
| 2878 |
controls.getOperation().setText(chartOperationText[expression.getOperation()]); |
| 2879 |
controls.getValue().setText(expression.getValue()); |
| 2880 |
} |
| 2881 |
} |
| 2882 |
} |
| 2883 |
int negButtonMax = negateButtons.size(); |
| 2884 |
for (int chartNum = 0; chartNum < negButtonMax; chartNum++) { |
| 2885 |
Button b = negateButtons.get(chartNum); |
| 2886 |
Chart c = charts.get(chartNum); |
| 2887 |
b.setSelection(c.isNegate()); |
| 2888 |
} |
| 2889 |
chartGroup.layout(true); |
| 2890 |
} |
| 2891 |
|
| 2892 |
private void recreateChartControls() { |
| 2893 |
GridLayout layout; |
| 2894 |
GridData gd; |
| 2895 |
Composite parent = chartGroup.getParent(); |
| 2896 |
chartGroup.setVisible(false); |
| 2897 |
chartGroup.dispose(); |
| 2898 |
chartControls.clear(); |
| 2899 |
negateButtons.clear(); |
| 2900 |
// chartGroup = new Group(parent, SWT.NONE); |
| 2901 |
chartGroup = new Composite(parent, SWT.NONE); |
| 2902 |
layout = new GridLayout(1, false); |
| 2903 |
chartGroup.setLayout(layout); |
| 2904 |
gd = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1); |
| 2905 |
//FB chartGroup.setBackground(new Color(parent.getDisplay(), 0, 0, 255)); |
| 2906 |
chartGroup.setLayoutData(gd); |
| 2907 |
chartExpandComposite.setClient(chartGroup); |
| 2908 |
|
| 2909 |
int chartNumMax = charts.size(); |
| 2910 |
for (int chartNumber = 0; chartNumber < chartNumMax; chartNumber++) { |
| 2911 |
final int chartNum = chartNumber; |
| 2912 |
// final Group chartGroup0 = new Group(chartGroup, SWT.NONE); |
| 2913 |
final Composite chartGroup0 = new Composite(chartGroup, SWT.NONE); |
| 2914 |
if (chartNum > 0) { |
| 2915 |
// chartGroup0.setText(Messages.BugzillaSearchPage_OR_Label); |
| 2916 |
new Label(chartGroup0, SWT.NONE).setText(Messages.BugzillaSearchPage_OR_Label); |
| 2917 |
} |
| 2918 |
layout = new GridLayout(3, false); |
| 2919 |
chartGroup0.setLayout(layout); |
| 2920 |
gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 3, 1); |
| 2921 |
//FB chartGroup0.setBackground(new Color(chartGroup.getDisplay(), 255, 0, 0)); |
| 2922 |
chartGroup0.setLayoutData(gd); |
| 2923 |
|
| 2924 |
final int chartRowMax = charts.get(chartNum).getRowSize(); |
| 2925 |
for (int chartRowNumber = 0; chartRowNumber < chartRowMax; chartRowNumber++) { |
| 2926 |
final int chartRow = chartRowNumber; |
| 2927 |
int chartColumnMax = charts.get(chartNum).getColumnSize(chartRow); |
| 2928 |
final Group chartGroup1 = new Group(chartGroup0, SWT.NONE); |
| 2929 |
layout = new GridLayout(4, false); |
| 2930 |
chartGroup1.setLayout(layout); |
| 2931 |
gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 3, 1); |
| 2932 |
//FB chartGroup1.setBackground(new Color(chartGroup.getDisplay(), 0, 255, 0)); |
| 2933 |
chartGroup1.setLayoutData(gd); |
| 2934 |
for (int chartColumnNumber = 0; chartColumnNumber < chartColumnMax; chartColumnNumber++) { |
| 2935 |
final int chartColumn = chartColumnNumber; |
| 2936 |
final Combo comboField = new Combo(chartGroup1, SWT.SINGLE | SWT.BORDER); |
| 2937 |
comboField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 2938 |
comboField.addModifyListener(new ModifyListenerImplementation()); |
| 2939 |
comboField.setItems(chartFieldText); |
| 2940 |
comboField.setText(chartFieldText[0]); |
| 2941 |
comboField.addSelectionListener(new SelectionAdapter() { |
| 2942 |
@Override |
| 2943 |
public void widgetSelected(SelectionEvent e) { |
| 2944 |
ChartExpression chartExpression = charts.get(chartNum).getChartExpression(chartRow, |
| 2945 |
chartColumn); |
| 2946 |
chartExpression.setFieldName(comboField.getSelectionIndex()); |
| 2947 |
chartGroup.getShell().layout(true); |
| 2948 |
chartGroup.getShell().redraw(); |
| 2949 |
} |
| 2950 |
}); |
| 2951 |
|
| 2952 |
final Combo comboOperation = new Combo(chartGroup1, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); |
| 2953 |
comboOperation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 2954 |
comboOperation.setItems(chartOperationText); |
| 2955 |
comboOperation.setText(chartOperationText[0]); |
| 2956 |
comboOperation.select(0); |
| 2957 |
comboOperation.addSelectionListener(new SelectionAdapter() { |
| 2958 |
@Override |
| 2959 |
public void widgetSelected(SelectionEvent e) { |
| 2960 |
ChartExpression chartExpression = charts.get(chartNum).getChartExpression(chartRow, |
| 2961 |
chartColumn); |
| 2962 |
chartExpression.setOperation(comboOperation.getSelectionIndex()); |
| 2963 |
} |
| 2964 |
}); |
| 2965 |
|
| 2966 |
final Combo comboValue = new Combo(chartGroup1, SWT.SINGLE | SWT.BORDER); |
| 2967 |
gd = new GridData(GridData.FILL, GridData.CENTER, true, false); |
| 2968 |
gd.widthHint = 150; |
| 2969 |
comboValue.setLayoutData(gd); |
| 2970 |
comboValue.addModifyListener(new ModifyListener() { |
| 2971 |
|
| 2972 |
public void modifyText(ModifyEvent e) { |
| 2973 |
ChartExpression chartExpression = charts.get(chartNum).getChartExpression(chartRow, |
| 2974 |
chartColumn); |
| 2975 |
chartExpression.setValue(comboValue.getText()); |
| 2976 |
if (isControlCreated()) { |
| 2977 |
setPageComplete(isPageComplete()); |
| 2978 |
} |
| 2979 |
} |
| 2980 |
}); |
| 2981 |
|
| 2982 |
Button orButton = new Button(chartGroup1, SWT.PUSH); |
| 2983 |
orButton.setText(Messages.BugzillaSearchPage_OR_Button); |
| 2984 |
gd = new GridData(SWT.LEFT, SWT.CENTER, false, false); |
| 2985 |
orButton.setLayoutData(gd); |
| 2986 |
orButton.addSelectionListener(new SelectionAdapter() { |
| 2987 |
@Override |
| 2988 |
public void widgetSelected(SelectionEvent e) { |
| 2989 |
int y = charts.get(chartNum).getColumnSize(chartRow); |
| 2990 |
charts.get(chartNum).addExpression(chartRow, chartColumn + 1); |
| 2991 |
createChartControls(chartGroup1, chartNum, chartRow, y); |
| 2992 |
} |
| 2993 |
}); |
| 2994 |
ChartControls chartControl = new ChartControls(comboField, comboOperation, comboValue); |
| 2995 |
int chart1 = chartControls.size(); |
| 2996 |
if (chart1 < chartNum + 1) { |
| 2997 |
chartControls.add(new ArrayList<ArrayList<ChartControls>>()); |
| 2998 |
} |
| 2999 |
int chart2 = chartControls.get(chartNum).size(); |
| 3000 |
if (chart2 < chartRow + 1) { |
| 3001 |
chartControls.get(chartNum).add(new ArrayList<BugzillaSearchPage.ChartControls>()); |
| 3002 |
} |
| 3003 |
chartControls.get(chartNum).get(chartRow).add(chartControl); |
| 3004 |
} |
| 3005 |
if (chartRowNumber < chartRowMax - 1) { |
| 3006 |
Label lable = new Label(chartGroup0, SWT.NONE); |
| 3007 |
lable.setText(Messages.BugzillaSearchPage_AND_Button); |
| 3008 |
GridData g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1); |
| 3009 |
lable.setLayoutData(g); |
| 3010 |
} |
| 3011 |
} |
| 3012 |
final Button andButton = new Button(chartGroup0, SWT.PUSH); |
| 3013 |
andButton.setText(Messages.BugzillaSearchPage_AND_Button); |
| 3014 |
gd = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
| 3015 |
andButton.setLayoutData(gd); |
| 3016 |
final Button newButton = new Button(chartGroup0, SWT.PUSH); |
| 3017 |
newButton.setText(Messages.BugzillaSearchPage_New_Chart_Button); |
| 3018 |
gd = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
| 3019 |
newButton.setLayoutData(gd); |
| 3020 |
final Button negateButton = new Button(chartGroup0, SWT.CHECK); |
| 3021 |
negateButton.setText(Messages.BugzillaSearchPage_Negate_Button); |
| 3022 |
negateButtons.add(negateButton); |
| 3023 |
gd = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
| 3024 |
negateButton.setLayoutData(gd); |
| 3025 |
|
| 3026 |
negateButton.addSelectionListener(new SelectionAdapter() { |
| 3027 |
@Override |
| 3028 |
public void widgetSelected(SelectionEvent e) { |
| 3029 |
Chart chart = charts.get(chartNum); |
| 3030 |
chart.setNegate(negateButton.getSelection()); |
| 3031 |
} |
| 3032 |
}); |
| 3033 |
newButton.addSelectionListener(new SelectionAdapter() { |
| 3034 |
@Override |
| 3035 |
public void widgetSelected(SelectionEvent e) { |
| 3036 |
newButton.setVisible(false); |
| 3037 |
newButton.dispose(); |
| 3038 |
createNewChartControls(chartGroup0.getParent(), chartNum + 1); |
| 3039 |
} |
| 3040 |
}); |
| 3041 |
andButton.addSelectionListener(new SelectionAdapter() { |
| 3042 |
@Override |
| 3043 |
public void widgetSelected(SelectionEvent e) { |
| 3044 |
if (!andButton.isDisposed()) { |
| 3045 |
andButton.setVisible(false); |
| 3046 |
andButton.dispose(); |
| 3047 |
} |
| 3048 |
if (!newButton.isDisposed()) { |
| 3049 |
newButton.setVisible(false); |
| 3050 |
newButton.dispose(); |
| 3051 |
} |
| 3052 |
if (!negateButton.isDisposed()) { |
| 3053 |
negateButton.setVisible(false); |
| 3054 |
negateButton.dispose(); |
| 3055 |
} |
| 3056 |
|
| 3057 |
Label lable = new Label(chartGroup0, SWT.NONE); |
| 3058 |
lable.setText(Messages.BugzillaSearchPage_AND_Button); |
| 3059 |
GridData g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1); |
| 3060 |
lable.setLayoutData(g); |
| 3061 |
|
| 3062 |
Group chartGroup1 = new Group(chartGroup0, SWT.NONE); |
| 3063 |
GridLayout layout = new GridLayout(4, false); |
| 3064 |
chartGroup1.setLayout(layout); |
| 3065 |
chartGroup1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
| 3066 |
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 3, 1); |
| 3067 |
chartGroup1.setLayoutData(gd); |
| 3068 |
|
| 3069 |
charts.get(chartNum).addExpression(chartRowMax, 0); |
| 3070 |
createChartControls(chartGroup1, chartNum, chartRowMax, 0); |
| 3071 |
} |
| 3072 |
}); |
| 3073 |
|
| 3074 |
} |
| 3075 |
parent.layout(true); |
| 3076 |
parent.redraw(); |
| 3077 |
refreshChartControls(); |
| 3078 |
} |
| 3079 |
|
| 2162 |
} |
3080 |
} |