|
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 40-54
Link Here
|
| 40 |
import org.eclipse.jface.fieldassist.ContentProposalAdapter; |
42 |
import org.eclipse.jface.fieldassist.ContentProposalAdapter; |
| 41 |
import org.eclipse.jface.fieldassist.IContentProposalProvider; |
43 |
import org.eclipse.jface.fieldassist.IContentProposalProvider; |
| 42 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
44 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
| 43 |
import org.eclipse.jface.resource.JFaceResources; |
|
|
| 44 |
import org.eclipse.jface.viewers.ILabelProvider; |
45 |
import org.eclipse.jface.viewers.ILabelProvider; |
| 45 |
import org.eclipse.jface.window.Window; |
46 |
import org.eclipse.jface.window.Window; |
| 46 |
import org.eclipse.mylyn.commons.core.CoreUtil; |
47 |
import org.eclipse.mylyn.commons.core.CoreUtil; |
| 47 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
48 |
import org.eclipse.mylyn.commons.core.StatusHandler; |
|
|
49 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField; |
| 48 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; |
50 |
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; |
| 49 |
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; |
51 |
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; |
| 50 |
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; |
52 |
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; |
| 51 |
import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin; |
53 |
import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin; |
|
|
54 |
import org.eclipse.mylyn.internal.commons.ui.SectionComposite; |
| 52 |
import org.eclipse.mylyn.internal.provisional.commons.ui.WorkbenchUtil; |
55 |
import org.eclipse.mylyn.internal.provisional.commons.ui.WorkbenchUtil; |
| 53 |
import org.eclipse.mylyn.internal.provisional.commons.ui.dialogs.AbstractInPlaceDialog; |
56 |
import org.eclipse.mylyn.internal.provisional.commons.ui.dialogs.AbstractInPlaceDialog; |
| 54 |
import org.eclipse.mylyn.internal.provisional.commons.ui.dialogs.IInPlaceDialogListener; |
57 |
import org.eclipse.mylyn.internal.provisional.commons.ui.dialogs.IInPlaceDialogListener; |
|
Lines 67-72
Link Here
|
| 67 |
import org.eclipse.swt.events.ModifyListener; |
70 |
import org.eclipse.swt.events.ModifyListener; |
| 68 |
import org.eclipse.swt.events.SelectionAdapter; |
71 |
import org.eclipse.swt.events.SelectionAdapter; |
| 69 |
import org.eclipse.swt.events.SelectionEvent; |
72 |
import org.eclipse.swt.events.SelectionEvent; |
|
|
73 |
import org.eclipse.swt.graphics.Color; |
| 70 |
import org.eclipse.swt.graphics.Point; |
74 |
import org.eclipse.swt.graphics.Point; |
| 71 |
import org.eclipse.swt.graphics.Rectangle; |
75 |
import org.eclipse.swt.graphics.Rectangle; |
| 72 |
import org.eclipse.swt.layout.GridData; |
76 |
import org.eclipse.swt.layout.GridData; |
|
Lines 85-92
Link Here
|
| 85 |
import org.eclipse.swt.widgets.Text; |
89 |
import org.eclipse.swt.widgets.Text; |
| 86 |
import org.eclipse.ui.PlatformUI; |
90 |
import org.eclipse.ui.PlatformUI; |
| 87 |
import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter; |
91 |
import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter; |
| 88 |
import org.eclipse.ui.forms.events.ExpansionAdapter; |
|
|
| 89 |
import org.eclipse.ui.forms.events.ExpansionEvent; |
| 90 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
92 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
| 91 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
93 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
| 92 |
import org.eclipse.ui.progress.IProgressService; |
94 |
import org.eclipse.ui.progress.IProgressService; |
|
Lines 149-157
Link Here
|
| 149 |
private static final String[] emailRoleValues2 = { "emailassigned_to2", "emailreporter2", "emailcc2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
151 |
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$ |
152 |
"emaillongdesc2", "emailqa_contact2" }; //$NON-NLS-1$ //$NON-NLS-2$ |
| 151 |
|
153 |
|
|
|
154 |
private static final ArrayList<String> chartFieldTextDefault = new ArrayList<String>() { |
| 155 |
private static final long serialVersionUID = 1974092160992399001L; |
| 156 |
{ |
| 157 |
add(Messages.BugzillaSearchPage_Field_Noop); |
| 158 |
add(Messages.BugzillaSearchPage_Field_Alias); |
| 159 |
add(Messages.BugzillaSearchPage_Field_AssignedTo); |
| 160 |
add(Messages.BugzillaSearchPage_Field_Attachment_creator); |
| 161 |
add(Messages.BugzillaSearchPage_Field_Attachment_data); |
| 162 |
add(Messages.BugzillaSearchPage_Field_Attachment_description); |
| 163 |
add(Messages.BugzillaSearchPage_Field_Attachment_filename); |
| 164 |
add(Messages.BugzillaSearchPage_Field_Attachment_is_a_URL); |
| 165 |
add(Messages.BugzillaSearchPage_Field_Attachment_is_obsolete); |
| 166 |
add(Messages.BugzillaSearchPage_Field_Attachment_is_patch); |
| 167 |
add(Messages.BugzillaSearchPage_Field_Attachment_is_private); |
| 168 |
add(Messages.BugzillaSearchPage_Field_Attachment_mime_type); |
| 169 |
add(Messages.BugzillaSearchPage_Field_Blocks); |
| 170 |
add(Messages.BugzillaSearchPage_Field_Bug); |
| 171 |
add(Messages.BugzillaSearchPage_Field_CC); |
| 172 |
add(Messages.BugzillaSearchPage_Field_CC_Accessible); |
| 173 |
add(Messages.BugzillaSearchPage_Field_Classification); |
| 174 |
add(Messages.BugzillaSearchPage_Field_Comment); |
| 175 |
add(Messages.BugzillaSearchPage_Field_Comment_is_private); |
| 176 |
add(Messages.BugzillaSearchPage_Field_Commenter); |
| 177 |
add(Messages.BugzillaSearchPage_Field_Component); |
| 178 |
add(Messages.BugzillaSearchPage_Field_Content); |
| 179 |
add(Messages.BugzillaSearchPage_Field_Creation_date); |
| 180 |
add(Messages.BugzillaSearchPage_Field_Days_since_bug_changed); |
| 181 |
add(Messages.BugzillaSearchPage_Field_Depends_on); |
| 182 |
add(Messages.BugzillaSearchPage_Field_drop_down_custom_field); |
| 183 |
add(Messages.BugzillaSearchPage_Field_Ever_Confirmed); |
| 184 |
add(Messages.BugzillaSearchPage_Field_Flag); |
| 185 |
add(Messages.BugzillaSearchPage_Field_Flag_Requestee); |
| 186 |
add(Messages.BugzillaSearchPage_Field_Flag_Setter); |
| 187 |
add(Messages.BugzillaSearchPage_Field_free_text_custom_field); |
| 188 |
add(Messages.BugzillaSearchPage_Field_Group); |
| 189 |
add(Messages.BugzillaSearchPage_Field_Keywords); |
| 190 |
add(Messages.BugzillaSearchPage_Field_Last_changed_date); |
| 191 |
add(Messages.BugzillaSearchPage_Field_OS_Version); |
| 192 |
add(Messages.BugzillaSearchPage_Field_Platform); |
| 193 |
add(Messages.BugzillaSearchPage_Field_Priority); |
| 194 |
add(Messages.BugzillaSearchPage_Field_Product); |
| 195 |
add(Messages.BugzillaSearchPage_Field_QAContact); |
| 196 |
add(Messages.BugzillaSearchPage_Field_ReportedBy); |
| 197 |
add(Messages.BugzillaSearchPage_Field_Reporter_Accessible); |
| 198 |
add(Messages.BugzillaSearchPage_Field_Resolution); |
| 199 |
add(Messages.BugzillaSearchPage_Field_Severity); |
| 200 |
add(Messages.BugzillaSearchPage_Field_Status); |
| 201 |
add(Messages.BugzillaSearchPage_Field_Status_Whiteboard); |
| 202 |
add(Messages.BugzillaSearchPage_Field_Summary); |
| 203 |
add(Messages.BugzillaSearchPage_Field_Target_Milestone); |
| 204 |
add(Messages.BugzillaSearchPage_Field_Time_Since_Assignee_Touched); |
| 205 |
add(Messages.BugzillaSearchPage_Field_URL); |
| 206 |
add(Messages.BugzillaSearchPage_Field_Version); |
| 207 |
add(Messages.BugzillaSearchPage_Field_Votes); |
| 208 |
} |
| 209 |
}; |
| 210 |
|
| 211 |
private static final ArrayList<String> chartFieldValuesDefault = new ArrayList<String>() { |
| 212 |
private static final long serialVersionUID = 9135403539678279982L; |
| 213 |
{ |
| 214 |
add("noop"); //$NON-NLS-1$ |
| 215 |
add("alias"); //$NON-NLS-1$ |
| 216 |
add("assigned_to"); //$NON-NLS-1$ |
| 217 |
add("attachments.submitter"); //$NON-NLS-1$ |
| 218 |
add("attach_data.thedata"); //$NON-NLS-1$ |
| 219 |
add("attachments.description"); //$NON-NLS-1$ |
| 220 |
add("attachments.filename"); //$NON-NLS-1$ |
| 221 |
add("attachments.isurl"); //$NON-NLS-1$ |
| 222 |
add("attachments.isobsolete"); //$NON-NLS-1$ |
| 223 |
add("attachments.ispatch"); //$NON-NLS-1$ |
| 224 |
add("attachments.isprivate"); //$NON-NLS-1$ |
| 225 |
add("attachments.mimetype"); //$NON-NLS-1$ |
| 226 |
add("blocked"); //$NON-NLS-1$ |
| 227 |
add("bug_id"); //$NON-NLS-1$ |
| 228 |
add("cc"); //$NON-NLS-1$ |
| 229 |
add("cclist_accessible"); //$NON-NLS-1$ |
| 230 |
add("classification"); //$NON-NLS-1$ |
| 231 |
add("longdesc"); //$NON-NLS-1$ |
| 232 |
add("longdescs.isprivate"); //$NON-NLS-1$ |
| 233 |
add("commenter"); //$NON-NLS-1$ |
| 234 |
add("component"); //$NON-NLS-1$ |
| 235 |
add("content"); //$NON-NLS-1$ |
| 236 |
add("creation_ts"); //$NON-NLS-1$ |
| 237 |
add("days_elapsed"); //$NON-NLS-1$ |
| 238 |
add("dependson"); //$NON-NLS-1$ |
| 239 |
add("cf_dropdown"); //$NON-NLS-1$ |
| 240 |
add("everconfirmed"); //$NON-NLS-1$ |
| 241 |
add("flagtypes.name"); //$NON-NLS-1$ |
| 242 |
add("requestees.login_name"); //$NON-NLS-1$ |
| 243 |
add("setters.login_name"); //$NON-NLS-1$ |
| 244 |
add("cf_freetext"); //$NON-NLS-1$ |
| 245 |
add("bug_group"); //$NON-NLS-1$ |
| 246 |
add("keywords"); //$NON-NLS-1$ |
| 247 |
add("delta_ts"); //$NON-NLS-1$ |
| 248 |
add("op_sys"); //$NON-NLS-1$ |
| 249 |
add("rep_platform"); //$NON-NLS-1$ |
| 250 |
add("priority"); //$NON-NLS-1$ |
| 251 |
add("product"); //$NON-NLS-1$ |
| 252 |
add("qa_contact"); //$NON-NLS-1$ |
| 253 |
add("reporter"); //$NON-NLS-1$ |
| 254 |
add("reporter_accessible"); //$NON-NLS-1$ |
| 255 |
add("resolution"); //$NON-NLS-1$ |
| 256 |
add("bug_severity"); //$NON-NLS-1$ |
| 257 |
add("bug_status"); //$NON-NLS-1$ |
| 258 |
add("status_whiteboard"); //$NON-NLS-1$ |
| 259 |
add("short_desc"); //$NON-NLS-1$ |
| 260 |
add("target_milestone"); //$NON-NLS-1$ |
| 261 |
add("owner_idle_time"); //$NON-NLS-1$ |
| 262 |
add("bug_file_loc"); //$NON-NLS-1$ |
| 263 |
add("version"); //$NON-NLS-1$ |
| 264 |
add("votes"); //$NON-NLS-1$ |
| 265 |
} |
| 266 |
}; |
| 267 |
|
| 268 |
private static final String[] chartOperationText = { Messages.BugzillaSearchPage_Operation_Noop, |
| 269 |
Messages.BugzillaSearchPage_Operation_is_equal_to, Messages.BugzillaSearchPage_Operation_is_not_equal_to, |
| 270 |
Messages.BugzillaSearchPage_Operation_is_equal_to_any_of_the_strings, |
| 271 |
Messages.BugzillaSearchPage_Operation_contains_the_string, |
| 272 |
Messages.BugzillaSearchPage_Operation_contains_the_string_exact_case, |
| 273 |
Messages.BugzillaSearchPage_Operation_does_not_contain_the_string, |
| 274 |
Messages.BugzillaSearchPage_Operation_contains_any_of_the_strings, |
| 275 |
Messages.BugzillaSearchPage_Operation_contains_all_of_the_strings, |
| 276 |
Messages.BugzillaSearchPage_Operation_contains_none_of_the_strings, |
| 277 |
Messages.BugzillaSearchPage_Operation_contains_regexp, |
| 278 |
Messages.BugzillaSearchPage_Operation_does_not_contain_regexp, |
| 279 |
Messages.BugzillaSearchPage_Operation_is_less_than, Messages.BugzillaSearchPage_Operation_is_greater_than, |
| 280 |
Messages.BugzillaSearchPage_Operation_contains_any_of_he_words, |
| 281 |
Messages.BugzillaSearchPage_Operation_contains_all_of_the_words, |
| 282 |
Messages.BugzillaSearchPage_Operation_contains_none_of_the_words, |
| 283 |
Messages.BugzillaSearchPage_Operation_changed_before, Messages.BugzillaSearchPage_Operation_changed_after, |
| 284 |
Messages.BugzillaSearchPage_Operation_changed_from, Messages.BugzillaSearchPage_Operation_changed_to, |
| 285 |
Messages.BugzillaSearchPage_Operation_changed_by, Messages.BugzillaSearchPage_Operation_matches }; |
| 286 |
|
| 287 |
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$ |
| 288 |
"casesubstring", "notsubstring", "anywordssubstr", "allwordssubstr", "nowordssubstr", "regexp", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ |
| 289 |
"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$ |
| 290 |
"changedfrom", "changedto", "changedby", "matches" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
| 291 |
|
| 152 |
// dialog store id constants |
292 |
// dialog store id constants |
| 153 |
private final static String DIALOG_BOUNDS_KEY = "ResizableDialogBounds"; //$NON-NLS-1$ |
293 |
private final static String DIALOG_BOUNDS_KEY = "ResizableDialogBounds"; //$NON-NLS-1$ |
| 154 |
|
294 |
|
|
|
295 |
private final static String REGEXP_CHART_EXPR = "(field|type|value)([0-9]+)-([0-9]+)-([0-9]+)"; //$NON-NLS-1$ |
| 296 |
|
| 297 |
private static final Pattern PATTERN_CHART_EXPR = Pattern.compile(REGEXP_CHART_EXPR, Pattern.CASE_INSENSITIVE); |
| 298 |
|
| 299 |
private final static String REGEXP_CHART_NEGATE = "(negate)([0-9]+)"; //$NON-NLS-1$ |
| 300 |
|
| 301 |
private static final Pattern PATTERN_CHART_NEGATE = Pattern.compile(REGEXP_CHART_NEGATE, Pattern.CASE_INSENSITIVE); |
| 302 |
|
| 155 |
private static final String X = "x"; //$NON-NLS-1$ |
303 |
private static final String X = "x"; //$NON-NLS-1$ |
| 156 |
|
304 |
|
| 157 |
private static final String Y = "y"; //$NON-NLS-1$ |
305 |
private static final String Y = "y"; //$NON-NLS-1$ |
|
Lines 216-221
Link Here
|
| 216 |
|
364 |
|
| 217 |
protected Text daysText; |
365 |
protected Text daysText; |
| 218 |
|
366 |
|
|
|
367 |
protected String[] chartFieldText; |
| 368 |
|
| 369 |
protected String[] chartFieldValues; |
| 370 |
|
| 219 |
// /** File containing saved queries */ |
371 |
// /** File containing saved queries */ |
| 220 |
// protected static SavedQueryFile input; |
372 |
// protected static SavedQueryFile input; |
| 221 |
|
373 |
|
|
Lines 292-297
Link Here
|
| 292 |
|
444 |
|
| 293 |
private ExpandableComposite moreOptionsExpandComposite; |
445 |
private ExpandableComposite moreOptionsExpandComposite; |
| 294 |
|
446 |
|
|
|
447 |
private ExpandableComposite chartExpandComposite; |
| 448 |
|
| 449 |
private SectionComposite scrolledComposite; |
| 450 |
|
| 451 |
private Composite chartGroup; |
| 452 |
|
| 453 |
protected class ChartExpression { |
| 454 |
private int fieldName; |
| 455 |
|
| 456 |
private int operation; |
| 457 |
|
| 458 |
private String value; |
| 459 |
|
| 460 |
public ChartExpression(int fieldName, int operation, String value) { |
| 461 |
super(); |
| 462 |
this.fieldName = fieldName; |
| 463 |
this.operation = operation; |
| 464 |
this.value = value; |
| 465 |
} |
| 466 |
|
| 467 |
public int getFieldName() { |
| 468 |
return fieldName; |
| 469 |
} |
| 470 |
|
| 471 |
public void setFieldName(int fieldName) { |
| 472 |
this.fieldName = fieldName; |
| 473 |
} |
| 474 |
|
| 475 |
public int getOperation() { |
| 476 |
return operation; |
| 477 |
} |
| 478 |
|
| 479 |
public void setOperation(int operation) { |
| 480 |
this.operation = operation; |
| 481 |
} |
| 482 |
|
| 483 |
public String getValue() { |
| 484 |
return value; |
| 485 |
} |
| 486 |
|
| 487 |
public void setValue(String value) { |
| 488 |
this.value = value; |
| 489 |
} |
| 490 |
} |
| 491 |
|
| 492 |
protected class Chart { |
| 493 |
private final ArrayList<ArrayList<ChartExpression>> expressions; |
| 494 |
|
| 495 |
private boolean negate; |
| 496 |
|
| 497 |
public Chart() { |
| 498 |
super(); |
| 499 |
ChartExpression expression = new ChartExpression(0, 0, ""); //$NON-NLS-1$ |
| 500 |
ArrayList<ChartExpression> column = new ArrayList<ChartExpression>(1); |
| 501 |
column.add(expression); |
| 502 |
expressions = new ArrayList<ArrayList<ChartExpression>>(1); |
| 503 |
expressions.add(column); |
| 504 |
negate = false; |
| 505 |
} |
| 506 |
|
| 507 |
public boolean isNegate() { |
| 508 |
return negate; |
| 509 |
} |
| 510 |
|
| 511 |
public void setNegate(boolean negate) { |
| 512 |
this.negate = negate; |
| 513 |
} |
| 514 |
|
| 515 |
public void addExpression(int rowIndex, int columnIndex) { |
| 516 |
ChartExpression expression = new ChartExpression(0, 0, ""); //$NON-NLS-1$ |
| 517 |
int size = expressions.size(); |
| 518 |
if (rowIndex > size + 1) { |
| 519 |
rowIndex = size + 1; |
| 520 |
} |
| 521 |
if (rowIndex < 0) { |
| 522 |
rowIndex = 0; |
| 523 |
} |
| 524 |
ArrayList<ChartExpression> row; |
| 525 |
if (rowIndex == size) { |
| 526 |
row = new ArrayList<BugzillaSearchPage.ChartExpression>(); |
| 527 |
expressions.add(rowIndex, row); |
| 528 |
} else { |
| 529 |
row = expressions.get(rowIndex); |
| 530 |
} |
| 531 |
if (row != null) { |
| 532 |
int size1 = expressions.size(); |
| 533 |
if (columnIndex > size1 + 1) { |
| 534 |
columnIndex = size1 + 1; |
| 535 |
} |
| 536 |
if (columnIndex < 0) { |
| 537 |
columnIndex = 0; |
| 538 |
} |
| 539 |
row.add(columnIndex, expression); |
| 540 |
} |
| 541 |
|
| 542 |
} |
| 543 |
|
| 544 |
public void addRow(int index) { |
| 545 |
int size = expressions.size(); |
| 546 |
if (index > size) { |
| 547 |
index = size; |
| 548 |
} |
| 549 |
if (index < 0) { |
| 550 |
index = 0; |
| 551 |
} |
| 552 |
addRow(index); |
| 553 |
} |
| 554 |
|
| 555 |
public int getRowSize() { |
| 556 |
return expressions.size(); |
| 557 |
} |
| 558 |
|
| 559 |
public int getColumnSize(int row) { |
| 560 |
int size = expressions.size(); |
| 561 |
if (row > size) { |
| 562 |
row = size; |
| 563 |
} |
| 564 |
if (row < 0) { |
| 565 |
row = 0; |
| 566 |
} |
| 567 |
return expressions.get(row).size(); |
| 568 |
} |
| 569 |
|
| 570 |
public ChartExpression getChartExpression(int row, int column) { |
| 571 |
int rowSize = expressions.size(); |
| 572 |
if (row > rowSize) { |
| 573 |
row = rowSize; |
| 574 |
} |
| 575 |
if (row < 0) { |
| 576 |
row = 0; |
| 577 |
} |
| 578 |
|
| 579 |
int columnSize = getColumnSize(row); |
| 580 |
if (column > columnSize) { |
| 581 |
column = columnSize; |
| 582 |
} |
| 583 |
if (column < 0) { |
| 584 |
column = 0; |
| 585 |
} |
| 586 |
return expressions.get(row).get(column); |
| 587 |
} |
| 588 |
|
| 589 |
public void removeColumn(int row, int column) { |
| 590 |
int rowSize = expressions.size(); |
| 591 |
if (row > rowSize) { |
| 592 |
row = rowSize; |
| 593 |
} |
| 594 |
if (row < 0) { |
| 595 |
row = 0; |
| 596 |
} |
| 597 |
|
| 598 |
int columnSize = getColumnSize(row); |
| 599 |
if (column > columnSize) { |
| 600 |
column = columnSize; |
| 601 |
} |
| 602 |
if (column < 0) { |
| 603 |
column = 0; |
| 604 |
} |
| 605 |
expressions.get(row).remove(column); |
| 606 |
if (column == 0) { |
| 607 |
expressions.remove(row); |
| 608 |
} |
| 609 |
} |
| 610 |
} |
| 611 |
|
| 612 |
private final ArrayList<Chart> charts = new ArrayList<BugzillaSearchPage.Chart>(1); |
| 613 |
|
| 614 |
private class ChartControls { |
| 615 |
private final Combo field; |
| 616 |
|
| 617 |
private final Combo operation; |
| 618 |
|
| 619 |
private final Combo value; |
| 620 |
|
| 621 |
public ChartControls(Combo field, Combo operation, Combo value) { |
| 622 |
super(); |
| 623 |
this.field = field; |
| 624 |
this.operation = operation; |
| 625 |
this.value = value; |
| 626 |
} |
| 627 |
|
| 628 |
public Combo getField() { |
| 629 |
return field; |
| 630 |
} |
| 631 |
|
| 632 |
public Combo getOperation() { |
| 633 |
return operation; |
| 634 |
} |
| 635 |
|
| 636 |
public Combo getValue() { |
| 637 |
return value; |
| 638 |
} |
| 639 |
} |
| 640 |
|
| 641 |
private final ArrayList<ArrayList<ArrayList<ChartControls>>> chartControls = new ArrayList<ArrayList<ArrayList<ChartControls>>>(); |
| 642 |
|
| 643 |
private final ArrayList<Button> negateButtons = new ArrayList<Button>(); |
| 644 |
|
| 295 |
private final SelectionAdapter updateActionSelectionAdapter = new SelectionAdapter() { |
645 |
private final SelectionAdapter updateActionSelectionAdapter = new SelectionAdapter() { |
| 296 |
@Override |
646 |
@Override |
| 297 |
public void widgetSelected(SelectionEvent e) { |
647 |
public void widgetSelected(SelectionEvent e) { |
|
Lines 347-355
Link Here
|
| 347 |
|
697 |
|
| 348 |
public void createControl(Composite parent) { |
698 |
public void createControl(Composite parent) { |
| 349 |
initializeDialogUnits(parent); |
699 |
initializeDialogUnits(parent); |
|
|
700 |
parent.setBackground(new Color(parent.getDisplay(), 0, 255, 0)); |
| 350 |
readConfiguration(); |
701 |
readConfiguration(); |
| 351 |
|
702 |
|
| 352 |
Composite control = new Composite(parent, SWT.NONE); |
703 |
Composite control = new Composite(parent, SWT.NONE); |
|
|
704 |
control.setBackground(parent.getBackground()); |
| 353 |
GridLayout layout = new GridLayout(1, false); |
705 |
GridLayout layout = new GridLayout(1, false); |
| 354 |
layout.marginHeight = 0; |
706 |
layout.marginHeight = 0; |
| 355 |
control.setLayout(layout); |
707 |
control.setLayout(layout); |
|
Lines 364-369
Link Here
|
| 364 |
|
716 |
|
| 365 |
private void createButtons(Composite control) { |
717 |
private void createButtons(Composite control) { |
| 366 |
Composite buttonComposite = new Composite(control, SWT.NONE); |
718 |
Composite buttonComposite = new Composite(control, SWT.NONE); |
|
|
719 |
buttonComposite.setBackground(control.getBackground()); |
| 367 |
GridLayout layout = new GridLayout(2, false); |
720 |
GridLayout layout = new GridLayout(2, false); |
| 368 |
layout.marginWidth = 0; |
721 |
layout.marginWidth = 0; |
| 369 |
buttonComposite.setLayout(layout); |
722 |
buttonComposite.setLayout(layout); |
|
Lines 429-442
Link Here
|
| 429 |
} |
782 |
} |
| 430 |
|
783 |
|
| 431 |
private void createOptionsGroup(Composite control) { |
784 |
private void createOptionsGroup(Composite control) { |
| 432 |
final Composite basicComposite = new Composite(control, SWT.NONE); |
785 |
scrolledComposite = new SectionComposite(control, SWT.H_SCROLL | SWT.V_SCROLL /*| SWT.BORDER*/); |
|
|
786 |
scrolledComposite.setBackground(control.getBackground()); |
| 787 |
GridData g = new GridData(GridData.FILL, GridData.FILL, true, true); |
| 788 |
scrolledComposite.setLayoutData(g); |
| 789 |
Composite scrolledBodyComposite = scrolledComposite.getContent(); |
| 790 |
scrolledBodyComposite.setBackground(control.getBackground()); |
| 791 |
scrolledBodyComposite.setLayout(new GridLayout()); |
| 792 |
Dialog.applyDialogFont(scrolledBodyComposite); |
| 793 |
|
| 794 |
basicCompositeCreate(scrolledBodyComposite); |
| 795 |
moreCompositeCreate(scrolledBodyComposite); |
| 796 |
boolChartCompositeCreate(scrolledBodyComposite); |
| 797 |
Point p = scrolledBodyComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); |
| 798 |
scrolledComposite.setMinSize(p); |
| 799 |
} |
| 800 |
|
| 801 |
private void basicCompositeCreate(Composite parent) { |
| 802 |
final Composite basicComposite = new Composite(parent, SWT.NONE); |
| 803 |
basicComposite.setBackground(parent.getBackground()); |
| 433 |
GridLayout layout = new GridLayout(4, false); |
804 |
GridLayout layout = new GridLayout(4, false); |
| 434 |
layout.marginHeight = 0; |
805 |
layout.marginHeight = 0; |
| 435 |
layout.marginWidth = 0; |
806 |
layout.marginWidth = 0; |
| 436 |
layout.marginRight = 5; |
807 |
layout.marginRight = 5; |
| 437 |
basicComposite.setLayout(layout); |
808 |
basicComposite.setLayout(layout); |
| 438 |
GridData g = new GridData(GridData.FILL, GridData.FILL, true, true); |
809 |
GridData g = new GridData(GridData.FILL, GridData.FILL, true, true); |
| 439 |
g.widthHint = 400; |
810 |
g.widthHint = 500; |
| 440 |
basicComposite.setLayoutData(g); |
811 |
basicComposite.setLayoutData(g); |
| 441 |
Dialog.applyDialogFont(basicComposite); |
812 |
Dialog.applyDialogFont(basicComposite); |
| 442 |
|
813 |
|
|
Lines 452-510
Link Here
|
| 452 |
queryTitle.addModifyListener(new ModifyListenerImplementation()); |
823 |
queryTitle.addModifyListener(new ModifyListenerImplementation()); |
| 453 |
queryTitle.setFocus(); |
824 |
queryTitle.setFocus(); |
| 454 |
} |
825 |
} |
| 455 |
createBasicComposite(basicComposite); |
|
|
| 456 |
|
| 457 |
moreOptionsExpandComposite = toolkit.createExpandableComposite(control, ExpandableComposite.COMPACT |
| 458 |
| ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); |
| 459 |
moreOptionsExpandComposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); |
| 460 |
moreOptionsExpandComposite.setBackground(null); |
| 461 |
moreOptionsExpandComposite.setText(Messages.BugzillaSearchPage_More_Options); |
| 462 |
moreOptionsExpandComposite.setLayout(new GridLayout(3, false)); |
| 463 |
g = new GridData(GridData.FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false); |
| 464 |
g.horizontalSpan = 4; |
| 465 |
g.horizontalIndent = INDENT; |
| 466 |
moreOptionsExpandComposite.setLayoutData(g); |
| 467 |
moreOptionsExpandComposite.addExpansionListener(new ExpansionAdapter() { |
| 468 |
@Override |
| 469 |
public void expansionStateChanged(ExpansionEvent e) { |
| 470 |
if ((Boolean) e.data == true) { |
| 471 |
Point minSize = getControl().getShell().getMinimumSize(); |
| 472 |
minSize.y = 660; |
| 473 |
getControl().getShell().setMinimumSize(minSize); |
| 474 |
} else { |
| 475 |
Point minSize = getControl().getShell().getMinimumSize(); |
| 476 |
minSize.y = 450; |
| 477 |
getControl().getShell().setMinimumSize(minSize); |
| 478 |
} |
| 479 |
Shell shell = getShell(); |
| 480 |
shell.pack(); |
| 481 |
Point shellSize = shell.getSize(); |
| 482 |
shellSize.x++; |
| 483 |
shell.setSize(shellSize); |
| 484 |
shellSize.x--; |
| 485 |
shell.setSize(shellSize); |
| 486 |
} |
| 487 |
}); |
| 488 |
|
| 489 |
Composite moreOptionsComposite = new Composite(moreOptionsExpandComposite, SWT.NULL); |
| 490 |
GridLayout optionsLayout = new GridLayout(4, false); |
| 491 |
optionsLayout.marginHeight = 0; |
| 492 |
optionsLayout.marginWidth = 0; |
| 493 |
moreOptionsComposite.setLayout(optionsLayout); |
| 494 |
|
| 495 |
Dialog.applyDialogFont(moreOptionsComposite); |
| 496 |
moreOptionsExpandComposite.setClient(moreOptionsComposite); |
| 497 |
|
| 498 |
createMoreOptionsComposite(moreOptionsComposite); |
| 499 |
createSearchGroup(moreOptionsComposite); |
| 500 |
if (inSearchContainer()) { |
| 501 |
control.getShell().setMinimumSize(new Point(610, 450)); |
| 502 |
} else { |
| 503 |
control.getShell().setMinimumSize(new Point(590, 450)); |
| 504 |
} |
| 505 |
} |
| 506 |
|
| 507 |
private void createBasicComposite(Composite basicComposite) { |
| 508 |
// Info text |
826 |
// Info text |
| 509 |
Label labelSummary = new Label(basicComposite, SWT.LEFT); |
827 |
Label labelSummary = new Label(basicComposite, SWT.LEFT); |
| 510 |
labelSummary.setText(Messages.BugzillaSearchPage_Summary); |
828 |
labelSummary.setText(Messages.BugzillaSearchPage_Summary); |
|
Lines 527-533
Link Here
|
| 527 |
summaryOperation.select(0); |
845 |
summaryOperation.select(0); |
| 528 |
Label labelEmail = new Label(basicComposite, SWT.LEFT); |
846 |
Label labelEmail = new Label(basicComposite, SWT.LEFT); |
| 529 |
labelEmail.setText(Messages.BugzillaSearchPage_Email); |
847 |
labelEmail.setText(Messages.BugzillaSearchPage_Email); |
| 530 |
//labelEmail.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); |
|
|
| 531 |
|
848 |
|
| 532 |
// pattern combo |
849 |
// pattern combo |
| 533 |
emailPattern = new Combo(basicComposite, SWT.SINGLE | SWT.BORDER); |
850 |
emailPattern = new Combo(basicComposite, SWT.SINGLE | SWT.BORDER); |
|
Lines 558-563
Link Here
|
| 558 |
|
875 |
|
| 559 |
new Label(basicComposite, SWT.NONE); |
876 |
new Label(basicComposite, SWT.NONE); |
| 560 |
Composite emailComposite = new Composite(basicComposite, SWT.NONE); |
877 |
Composite emailComposite = new Composite(basicComposite, SWT.NONE); |
|
|
878 |
emailComposite.setBackground(parent.getBackground()); |
| 561 |
emailComposite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
879 |
emailComposite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); |
| 562 |
GridLayout emailLayout = new GridLayout(); |
880 |
GridLayout emailLayout = new GridLayout(); |
| 563 |
emailLayout.marginWidth = 0; |
881 |
emailLayout.marginWidth = 0; |
|
Lines 599-604
Link Here
|
| 599 |
GridLayout topLayout = new GridLayout(); |
917 |
GridLayout topLayout = new GridLayout(); |
| 600 |
topLayout.numColumns = 4; |
918 |
topLayout.numColumns = 4; |
| 601 |
SashForm topForm = new SashForm(sashForm, SWT.NONE); |
919 |
SashForm topForm = new SashForm(sashForm, SWT.NONE); |
|
|
920 |
topForm.setBackground(parent.getBackground()); |
| 602 |
GridData topLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1); |
921 |
GridData topLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1); |
| 603 |
topLayoutData.widthHint = 00; |
922 |
topLayoutData.widthHint = 00; |
| 604 |
topLayoutData.heightHint = 60; |
923 |
topLayoutData.heightHint = 60; |
|
Lines 610-620
Link Here
|
| 610 |
productLayout.marginHeight = 0; |
929 |
productLayout.marginHeight = 0; |
| 611 |
productLayout.horizontalSpacing = 0; |
930 |
productLayout.horizontalSpacing = 0; |
| 612 |
Composite productComposite = new Composite(topForm, SWT.NONE); |
931 |
Composite productComposite = new Composite(topForm, SWT.NONE); |
|
|
932 |
productComposite.setBackground(parent.getBackground()); |
| 613 |
productComposite.setLayout(productLayout); |
933 |
productComposite.setLayout(productLayout); |
| 614 |
|
934 |
|
| 615 |
Label productLabel = new Label(productComposite, SWT.LEFT); |
935 |
Label productLabel = new Label(productComposite, SWT.LEFT); |
|
|
936 |
productLabel.setBackground(parent.getBackground()); |
| 616 |
productLabel.setText(Messages.BugzillaSearchPage_Product); |
937 |
productLabel.setText(Messages.BugzillaSearchPage_Product); |
| 617 |
productLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
938 |
productLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
|
939 |
productLabel.setBackground(parent.getBackground()); |
| 618 |
|
940 |
|
| 619 |
GridData productLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); |
941 |
GridData productLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 620 |
productLayoutData.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
942 |
productLayoutData.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
|
Lines 642-652
Link Here
|
| 642 |
componentLayout.marginHeight = 0; |
964 |
componentLayout.marginHeight = 0; |
| 643 |
componentLayout.horizontalSpacing = 0; |
965 |
componentLayout.horizontalSpacing = 0; |
| 644 |
Composite componentComposite = new Composite(topForm, SWT.NONE); |
966 |
Composite componentComposite = new Composite(topForm, SWT.NONE); |
|
|
967 |
componentComposite.setBackground(parent.getBackground()); |
| 645 |
componentComposite.setLayout(componentLayout); |
968 |
componentComposite.setLayout(componentLayout); |
| 646 |
|
969 |
|
| 647 |
Label componentLabel = new Label(componentComposite, SWT.LEFT); |
970 |
Label componentLabel = new Label(componentComposite, SWT.LEFT); |
| 648 |
componentLabel.setText(Messages.BugzillaSearchPage_Component); |
971 |
componentLabel.setText(Messages.BugzillaSearchPage_Component); |
| 649 |
componentLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
972 |
componentLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
|
973 |
componentLabel.setBackground(parent.getBackground()); |
| 650 |
|
974 |
|
| 651 |
component = new List(componentComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
975 |
component = new List(componentComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 652 |
GridData componentLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); |
976 |
GridData componentLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true); |
|
Lines 655-660
Link Here
|
| 655 |
component.addSelectionListener(updateActionSelectionAdapter); |
979 |
component.addSelectionListener(updateActionSelectionAdapter); |
| 656 |
|
980 |
|
| 657 |
Composite statusComposite = new Composite(topForm, SWT.NONE); |
981 |
Composite statusComposite = new Composite(topForm, SWT.NONE); |
|
|
982 |
statusComposite.setBackground(parent.getBackground()); |
| 658 |
GridLayout statusLayout = new GridLayout(); |
983 |
GridLayout statusLayout = new GridLayout(); |
| 659 |
statusLayout.marginWidth = 0; |
984 |
statusLayout.marginWidth = 0; |
| 660 |
statusLayout.horizontalSpacing = 0; |
985 |
statusLayout.horizontalSpacing = 0; |
|
Lines 664-669
Link Here
|
| 664 |
Label statusLabel = new Label(statusComposite, SWT.LEFT); |
989 |
Label statusLabel = new Label(statusComposite, SWT.LEFT); |
| 665 |
statusLabel.setText(Messages.BugzillaSearchPage_Status); |
990 |
statusLabel.setText(Messages.BugzillaSearchPage_Status); |
| 666 |
statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
991 |
statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
|
992 |
statusLabel.setBackground(parent.getBackground()); |
| 667 |
|
993 |
|
| 668 |
status = new List(statusComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
994 |
status = new List(statusComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 669 |
final GridData gd_status = new GridData(SWT.FILL, SWT.FILL, true, true); |
995 |
final GridData gd_status = new GridData(SWT.FILL, SWT.FILL, true, true); |
|
Lines 672-677
Link Here
|
| 672 |
status.addSelectionListener(updateActionSelectionAdapter); |
998 |
status.addSelectionListener(updateActionSelectionAdapter); |
| 673 |
|
999 |
|
| 674 |
Composite severityComposite = new Composite(topForm, SWT.NONE); |
1000 |
Composite severityComposite = new Composite(topForm, SWT.NONE); |
|
|
1001 |
severityComposite.setBackground(parent.getBackground()); |
| 675 |
GridLayout severityLayout = new GridLayout(); |
1002 |
GridLayout severityLayout = new GridLayout(); |
| 676 |
severityLayout.marginWidth = 0; |
1003 |
severityLayout.marginWidth = 0; |
| 677 |
severityLayout.marginHeight = 0; |
1004 |
severityLayout.marginHeight = 0; |
|
Lines 681-693
Link Here
|
| 681 |
Label severityLabel = new Label(severityComposite, SWT.LEFT); |
1008 |
Label severityLabel = new Label(severityComposite, SWT.LEFT); |
| 682 |
severityLabel.setText(Messages.BugzillaSearchPage_Severity); |
1009 |
severityLabel.setText(Messages.BugzillaSearchPage_Severity); |
| 683 |
severityLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
1010 |
severityLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
|
1011 |
severityLabel.setBackground(parent.getBackground()); |
| 684 |
|
1012 |
|
| 685 |
severity = new List(severityComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
1013 |
severity = new List(severityComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER); |
| 686 |
final GridData gd_severity = new GridData(SWT.FILL, SWT.FILL, true, true); |
1014 |
final GridData gd_severity = new GridData(SWT.FILL, SWT.FILL, true, true); |
| 687 |
gd_severity.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
1015 |
gd_severity.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
| 688 |
severity.setLayoutData(gd_severity); |
1016 |
severity.setLayoutData(gd_severity); |
| 689 |
severity.addSelectionListener(updateActionSelectionAdapter); |
1017 |
severity.addSelectionListener(updateActionSelectionAdapter); |
|
|
1018 |
} |
| 1019 |
|
| 1020 |
private void moreCompositeCreate(Composite parent) { |
| 1021 |
moreOptionsExpandComposite = scrolledComposite.createSection(Messages.BugzillaSearchPage_More_Options, |
| 1022 |
ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR, true); |
| 1023 |
moreOptionsExpandComposite.setLayout(new GridLayout(3, false)); |
| 1024 |
GridData g = new GridData(GridData.FILL, GridData.CENTER, true, false); |
| 1025 |
g.horizontalSpan = 4; |
| 1026 |
g.horizontalIndent = INDENT; |
| 1027 |
moreOptionsExpandComposite.setLayoutData(g); |
| 1028 |
moreOptionsExpandComposite.setBackground(parent.getBackground()); |
| 1029 |
Composite moreOptionsComposite = new Composite(moreOptionsExpandComposite, SWT.NULL); |
| 1030 |
GridLayout optionsLayout = new GridLayout(4, false); |
| 1031 |
optionsLayout.marginHeight = 0; |
| 1032 |
optionsLayout.marginWidth = 0; |
| 1033 |
moreOptionsComposite.setBackground(parent.getBackground()); |
| 1034 |
moreOptionsComposite.setLayout(optionsLayout); |
| 1035 |
g = new GridData(GridData.FILL, GridData.FILL, true, true); |
| 1036 |
g.widthHint = 400; |
| 1037 |
moreOptionsComposite.setLayoutData(g); |
| 1038 |
Dialog.applyDialogFont(moreOptionsComposite); |
| 1039 |
moreOptionsExpandComposite.setClient(moreOptionsComposite); |
| 1040 |
createMoreOptionsComposite(moreOptionsComposite); |
| 1041 |
createSearchGroup(moreOptionsComposite); |
| 1042 |
} |
| 690 |
|
1043 |
|
|
|
1044 |
private void boolChartCompositeCreate(Composite parent) { |
| 1045 |
chartFieldText = chartFieldTextDefault.toArray(new String[chartFieldTextDefault.size()]); |
| 1046 |
chartFieldValues = chartFieldValuesDefault.toArray(new String[chartFieldValuesDefault.size()]); |
| 1047 |
chartExpandComposite = scrolledComposite.createSection(Messages.BugzillaSearchPage_BooleanChart, |
| 1048 |
ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR, false); |
| 1049 |
chartExpandComposite.setLayout(new GridLayout(3, false)); |
| 1050 |
chartExpandComposite.setBackground(parent.getBackground()); |
| 1051 |
GridData g = new GridData(GridData.FILL, GridData.BEGINNING, true, false); |
| 1052 |
g.horizontalSpan = 4; |
| 1053 |
g.horizontalIndent = INDENT; |
| 1054 |
chartExpandComposite.setLayoutData(g); |
| 1055 |
Composite chartComposite = new Composite(chartExpandComposite, SWT.NULL); |
| 1056 |
GridLayout optionsLayout = new GridLayout(4, false); |
| 1057 |
optionsLayout.marginHeight = 0; |
| 1058 |
optionsLayout.marginWidth = 0; |
| 1059 |
chartComposite.setLayout(optionsLayout); |
| 1060 |
g = new GridData(GridData.FILL, GridData.FILL, true, true); |
| 1061 |
g.widthHint = 400; |
| 1062 |
chartComposite.setLayoutData(g); |
| 1063 |
Dialog.applyDialogFont(chartComposite); |
| 1064 |
chartExpandComposite.setClient(chartComposite); |
| 1065 |
createChartGroup(chartComposite); |
| 691 |
} |
1066 |
} |
| 692 |
|
1067 |
|
| 693 |
private void createMoreOptionsComposite(Composite advancedComposite) { |
1068 |
private void createMoreOptionsComposite(Composite advancedComposite) { |
|
Lines 695-701
Link Here
|
| 695 |
// Info text |
1070 |
// Info text |
| 696 |
Label labelComment = new Label(advancedComposite, SWT.LEFT); |
1071 |
Label labelComment = new Label(advancedComposite, SWT.LEFT); |
| 697 |
labelComment.setText(Messages.BugzillaSearchPage_Comment); |
1072 |
labelComment.setText(Messages.BugzillaSearchPage_Comment); |
| 698 |
//labelComment.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); |
|
|
| 699 |
|
1073 |
|
| 700 |
// Comment pattern combo |
1074 |
// Comment pattern combo |
| 701 |
commentPattern = new Combo(advancedComposite, SWT.SINGLE | SWT.BORDER); |
1075 |
commentPattern = new Combo(advancedComposite, SWT.SINGLE | SWT.BORDER); |
|
Lines 716-722
Link Here
|
| 716 |
|
1090 |
|
| 717 |
Label labelEmail2 = new Label(advancedComposite, SWT.LEFT); |
1091 |
Label labelEmail2 = new Label(advancedComposite, SWT.LEFT); |
| 718 |
labelEmail2.setText(Messages.BugzillaSearchPage_Email_2); |
1092 |
labelEmail2.setText(Messages.BugzillaSearchPage_Email_2); |
| 719 |
//labelEmail.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); |
|
|
| 720 |
|
1093 |
|
| 721 |
// pattern combo |
1094 |
// pattern combo |
| 722 |
emailPattern2 = new Combo(advancedComposite, SWT.SINGLE | SWT.BORDER); |
1095 |
emailPattern2 = new Combo(advancedComposite, SWT.SINGLE | SWT.BORDER); |
|
Lines 974-980
Link Here
|
| 974 |
gd_os.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
1347 |
gd_os.heightHint = HEIGHT_ATTRIBUTE_COMBO; |
| 975 |
os.setLayoutData(gd_os); |
1348 |
os.setLayoutData(gd_os); |
| 976 |
os.addSelectionListener(updateActionSelectionAdapter); |
1349 |
os.addSelectionListener(updateActionSelectionAdapter); |
| 977 |
|
|
|
| 978 |
} |
1350 |
} |
| 979 |
|
1351 |
|
| 980 |
private void createSearchGroup(Composite control) { |
1352 |
private void createSearchGroup(Composite control) { |
|
Lines 1025-1086
Link Here
|
| 1025 |
gd = new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); |
1397 |
gd = new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); |
| 1026 |
gd.horizontalSpan = 2; |
1398 |
gd.horizontalSpan = 2; |
| 1027 |
group.setLayoutData(gd); |
1399 |
group.setLayoutData(gd); |
| 1028 |
|
|
|
| 1029 |
// loadButton = new Button(group, SWT.PUSH | SWT.LEFT); |
| 1030 |
// loadButton.setText("Saved Queries..."); |
| 1031 |
// final BugzillaSearchPage bsp = this; |
| 1032 |
// loadButton.addSelectionListener(new SelectionAdapter() { |
| 1033 |
// |
| 1034 |
// @Override |
| 1035 |
// public void widgetSelected(SelectionEvent event) { |
| 1036 |
// GetQueryDialog qd = new GetQueryDialog(getShell(), "Saved Queries", |
| 1037 |
// input); |
| 1038 |
// if (qd.open() == InputDialog.OK) { |
| 1039 |
// selIndex = qd.getSelected(); |
| 1040 |
// if (selIndex != -1) { |
| 1041 |
// rememberedQuery = true; |
| 1042 |
// performAction(); |
| 1043 |
// bsp.getShell().close(); |
| 1044 |
// } |
| 1045 |
// } |
| 1046 |
// } |
| 1047 |
// }); |
| 1048 |
// loadButton.setEnabled(true); |
| 1049 |
// loadButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); |
| 1050 |
// |
| 1051 |
// saveButton = new Button(group, SWT.PUSH | SWT.LEFT); |
| 1052 |
// saveButton.setText("Remember..."); |
| 1053 |
// saveButton.addSelectionListener(new SelectionAdapter() { |
| 1054 |
// |
| 1055 |
// @Override |
| 1056 |
// public void widgetSelected(SelectionEvent event) { |
| 1057 |
// SaveQueryDialog qd = new SaveQueryDialog(getShell(), "Remember Query"); |
| 1058 |
// if (qd.open() == InputDialog.OK) { |
| 1059 |
// String qName = qd.getText(); |
| 1060 |
// if (qName != null && qName.compareTo("") != 0) { |
| 1061 |
// try { |
| 1062 |
// input.add(getQueryParameters().toString(), qName, summaryPattern.getText()); |
| 1063 |
// } catch (UnsupportedEncodingException e) { |
| 1064 |
// /* |
| 1065 |
// * Do nothing. Every implementation of the Java |
| 1066 |
// * platform is required to support the standard |
| 1067 |
// * charset "UTF-8" |
| 1068 |
// */ |
| 1069 |
// } |
| 1070 |
// } |
| 1071 |
// } |
| 1072 |
// } |
| 1073 |
// }); |
| 1074 |
// saveButton.setEnabled(true); |
| 1075 |
// saveButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); |
| 1076 |
|
| 1077 |
return group; |
1400 |
return group; |
| 1078 |
} |
1401 |
} |
| 1079 |
|
1402 |
|
| 1080 |
// public static SavedQueryFile getInput() { |
|
|
| 1081 |
// return input; |
| 1082 |
// } |
| 1083 |
|
| 1084 |
private void handleWidgetSelected(Combo widget, Combo operation, ArrayList<BugzillaSearchData> history) { |
1403 |
private void handleWidgetSelected(Combo widget, Combo operation, ArrayList<BugzillaSearchData> history) { |
| 1085 |
if (widget.getSelectionIndex() < 0) { |
1404 |
if (widget.getSelectionIndex() < 0) { |
| 1086 |
return; |
1405 |
return; |
|
Lines 1161-1166
Link Here
|
| 1161 |
if (originalQuery != null) { |
1480 |
if (originalQuery != null) { |
| 1162 |
try { |
1481 |
try { |
| 1163 |
updateDefaults(originalQuery.getUrl()); |
1482 |
updateDefaults(originalQuery.getUrl()); |
|
|
1483 |
refreshChartControls(); |
| 1164 |
} catch (UnsupportedEncodingException e) { |
1484 |
} catch (UnsupportedEncodingException e) { |
| 1165 |
// ignore |
1485 |
// ignore |
| 1166 |
} |
1486 |
} |
|
Lines 1184-1218
Link Here
|
| 1184 |
restoreWidgetValues(); |
1504 |
restoreWidgetValues(); |
| 1185 |
} |
1505 |
} |
| 1186 |
} |
1506 |
} |
| 1187 |
if ((commentPattern.getText() != null && !commentPattern.getText().equals("")) || // //$NON-NLS-1$ |
|
|
| 1188 |
(emailPattern2.getText() != null && !emailPattern2.getText().equals("")) || // //$NON-NLS-1$ |
| 1189 |
(keywords.getText() != null && !keywords.getText().equals("")) || // //$NON-NLS-1$ |
| 1190 |
priority.getSelection().length > 0 || resolution.getSelection().length > 0 |
| 1191 |
|| version.getSelection().length > 0 || target.getSelection().length > 0 |
| 1192 |
|| hardware.getSelection().length > 0 || os.getSelection().length > 0) { |
| 1193 |
moreOptionsExpandComposite.setExpanded(true); |
| 1194 |
Shell shell = getShell(); |
| 1195 |
if (inSearchContainer()) { |
| 1196 |
shell.setMinimumSize(new Point(610, 660)); |
| 1197 |
} else { |
| 1198 |
shell.setMinimumSize(new Point(590, 660)); |
| 1199 |
} |
| 1200 |
shell.layout(true); |
| 1201 |
shell.pack(); |
| 1202 |
shell.layout(true); |
| 1203 |
} |
| 1204 |
setPageComplete(isPageComplete()); |
1507 |
setPageComplete(isPageComplete()); |
| 1205 |
} |
1508 |
} |
| 1206 |
if (visible) { |
1509 |
if (visible) { |
| 1207 |
getControl().getShell().layout(false, true); |
1510 |
if (getWizard() == null && summaryPattern != null) { |
| 1208 |
Point oldSize = getControl().getSize(); |
|
|
| 1209 |
Point newSize = getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, true); |
| 1210 |
if (!moreOptionsExpandComposite.isExpanded()) { |
| 1211 |
// for some reason in not expanded state the width is a little to small |
| 1212 |
newSize.x += 36; |
| 1213 |
} |
| 1214 |
resizeDialogIfNeeded(oldSize, newSize); |
| 1215 |
if (getWizard() == null) { |
| 1216 |
// TODO: wierd check |
1511 |
// TODO: wierd check |
| 1217 |
summaryPattern.setFocus(); |
1512 |
summaryPattern.setFocus(); |
| 1218 |
} |
1513 |
} |
|
Lines 1466-1472
Link Here
|
| 1466 |
sb.append("&status_whiteboard_type="); //$NON-NLS-1$ |
1761 |
sb.append("&status_whiteboard_type="); //$NON-NLS-1$ |
| 1467 |
sb.append(patternOperationValues[whiteboardOperation.getSelectionIndex()]); |
1762 |
sb.append(patternOperationValues[whiteboardOperation.getSelectionIndex()]); |
| 1468 |
appendToBuffer(sb, "&status_whiteboard=", whiteboardPattern.getText()); //$NON-NLS-1$ |
1763 |
appendToBuffer(sb, "&status_whiteboard=", whiteboardPattern.getText()); //$NON-NLS-1$ |
| 1469 |
|
1764 |
int indexMax = charts.size(); |
|
|
1765 |
for (int index = 0; index < indexMax; index++) { |
| 1766 |
Chart chart = charts.get(index); |
| 1767 |
if (chart.isNegate()) { |
| 1768 |
sb.append("&negate" + index + "=1"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 1769 |
} |
| 1770 |
int rowMax = chart.getRowSize(); |
| 1771 |
for (int row = 0; row < rowMax; row++) { |
| 1772 |
int columnMax = chart.getColumnSize(row); |
| 1773 |
for (int column = 0; column < columnMax; column++) { |
| 1774 |
ChartExpression chartExpression = chart.getChartExpression(row, column); |
| 1775 |
if (chartExpression.getFieldName() == 0) { |
| 1776 |
continue; |
| 1777 |
} |
| 1778 |
sb.append("&field" + index + "-" + row + "-" + column + "=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
| 1779 |
+ chartFieldValues[chartExpression.getFieldName()]); |
| 1780 |
sb.append("&type" + index + "-" + row + "-" + column + "=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
| 1781 |
+ chartOperationValues[chartExpression.getOperation()]); |
| 1782 |
sb.append("&value" + index + "-" + row + "-" + column + "=" + chartExpression.getValue()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
| 1783 |
} |
| 1784 |
} |
| 1785 |
} |
| 1470 |
return sb; |
1786 |
return sb; |
| 1471 |
} |
1787 |
} |
| 1472 |
|
1788 |
|
|
Lines 1496-1501
Link Here
|
| 1496 |
getDialogSettings(); |
1812 |
getDialogSettings(); |
| 1497 |
} |
1813 |
} |
| 1498 |
|
1814 |
|
|
|
1815 |
@SuppressWarnings("unchecked") |
| 1499 |
private void updateAttributesFromConfiguration(String[] selectedProducts) { |
1816 |
private void updateAttributesFromConfiguration(String[] selectedProducts) { |
| 1500 |
if (repositoryConfiguration != null) { |
1817 |
if (repositoryConfiguration != null) { |
| 1501 |
String[] saved_product = product.getSelection(); |
1818 |
String[] saved_product = product.getSelection(); |
|
Lines 1542-1557
Link Here
|
| 1542 |
setSelection(priority, saved_priority); |
1859 |
setSelection(priority, saved_priority); |
| 1543 |
setSelection(hardware, saved_hardware); |
1860 |
setSelection(hardware, saved_hardware); |
| 1544 |
setSelection(os, saved_os); |
1861 |
setSelection(os, saved_os); |
|
|
1862 |
|
| 1863 |
if (repositoryConfiguration != null) { |
| 1864 |
ArrayList<String> fieldText = (ArrayList<String>) chartFieldTextDefault.clone(); |
| 1865 |
ArrayList<String> fieldValue = (ArrayList<String>) chartFieldValuesDefault.clone(); |
| 1866 |
|
| 1867 |
for (BugzillaCustomField bugzillaCustomField : repositoryConfiguration.getCustomFields()) { |
| 1868 |
fieldValue.add(bugzillaCustomField.getName()); |
| 1869 |
fieldText.add(bugzillaCustomField.getDescription()); |
| 1870 |
} |
| 1871 |
chartFieldText = fieldText.toArray(new String[fieldText.size()]); |
| 1872 |
chartFieldValues = fieldValue.toArray(new String[fieldValue.size()]); |
| 1873 |
recreateChartControls(); |
| 1874 |
} |
| 1875 |
|
| 1545 |
} |
1876 |
} |
| 1546 |
} |
1877 |
} |
| 1547 |
|
1878 |
|
| 1548 |
@Override |
1879 |
@Override |
| 1549 |
public boolean canFlipToNextPage() { |
1880 |
public boolean canFlipToNextPage() { |
| 1550 |
// if (getErrorMessage() != null) |
1881 |
if (getErrorMessage() != null) { |
| 1551 |
// return false; |
1882 |
return false; |
| 1552 |
// |
1883 |
} |
| 1553 |
// return true; |
1884 |
|
| 1554 |
return false; |
1885 |
return true; |
| 1555 |
} |
1886 |
} |
| 1556 |
|
1887 |
|
| 1557 |
public void handleEvent(Event event) { |
1888 |
public void handleEvent(Event event) { |
|
Lines 1564-1572
Link Here
|
| 1564 |
* TODO: get rid of this? |
1895 |
* TODO: get rid of this? |
| 1565 |
*/ |
1896 |
*/ |
| 1566 |
public void updateDefaults(String startingUrl) throws UnsupportedEncodingException { |
1897 |
public void updateDefaults(String startingUrl) throws UnsupportedEncodingException { |
| 1567 |
// String serverName = startingUrl.substring(0, |
1898 |
boolean adjustChart = false; |
| 1568 |
// startingUrl.indexOf("?")); |
|
|
| 1569 |
|
| 1570 |
startingUrl = startingUrl.substring(startingUrl.indexOf("?") + 1); //$NON-NLS-1$ |
1899 |
startingUrl = startingUrl.substring(startingUrl.indexOf("?") + 1); //$NON-NLS-1$ |
| 1571 |
String[] options = startingUrl.split("&"); //$NON-NLS-1$ |
1900 |
String[] options = startingUrl.split("&"); //$NON-NLS-1$ |
| 1572 |
for (String option : options) { |
1901 |
for (String option : options) { |
|
Lines 1586-1598
Link Here
|
| 1586 |
if (key.equals("short_desc")) { //$NON-NLS-1$ |
1915 |
if (key.equals("short_desc")) { //$NON-NLS-1$ |
| 1587 |
summaryPattern.setText(value); |
1916 |
summaryPattern.setText(value); |
| 1588 |
} else if (key.equals("short_desc_type")) { //$NON-NLS-1$ |
1917 |
} 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; |
1918 |
int index = 0; |
| 1595 |
for (String item : summaryOperation.getItems()) { |
1919 |
for (String item : patternOperationValues) { |
| 1596 |
if (item.compareTo(value) == 0) { |
1920 |
if (item.compareTo(value) == 0) { |
| 1597 |
break; |
1921 |
break; |
| 1598 |
} |
1922 |
} |
|
Lines 1638-1650
Link Here
|
| 1638 |
sel = new String[selList.size()]; |
1962 |
sel = new String[selList.size()]; |
| 1639 |
version.setSelection(selList.toArray(sel)); |
1963 |
version.setSelection(selList.toArray(sel)); |
| 1640 |
} else if (key.equals("long_desc_type")) { //$NON-NLS-1$ |
1964 |
} 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; |
1965 |
int index = 0; |
| 1647 |
for (String item : commentOperation.getItems()) { |
1966 |
for (String item : patternOperationValues) { |
| 1648 |
if (item.compareTo(value) == 0) { |
1967 |
if (item.compareTo(value) == 0) { |
| 1649 |
break; |
1968 |
break; |
| 1650 |
} |
1969 |
} |
|
Lines 1826-1833
Link Here
|
| 1826 |
} |
2145 |
} |
| 1827 |
index++; |
2146 |
index++; |
| 1828 |
} |
2147 |
} |
|
|
2148 |
} else if (key.equals("status_whiteboard_type")) { //$NON-NLS-1$ |
| 2149 |
int index = 0; |
| 2150 |
for (String item : patternOperationValues) { |
| 2151 |
if (item.compareTo(value) == 0) { |
| 2152 |
break; |
| 2153 |
} |
| 2154 |
index++; |
| 2155 |
} |
| 2156 |
if (index < whiteboardOperation.getItemCount()) { |
| 2157 |
whiteboardOperation.select(index); |
| 2158 |
} |
| 2159 |
} else if (key.equals("status_whiteboard")) { //$NON-NLS-1$ |
| 2160 |
whiteboardPattern.setText(value); |
| 2161 |
} else if (key.matches(REGEXP_CHART_EXPR)) { |
| 2162 |
Matcher mb = PATTERN_CHART_EXPR.matcher(key); |
| 2163 |
if (mb.find()) { |
| 2164 |
String g1 = mb.group(1); |
| 2165 |
String g2 = mb.group(2); |
| 2166 |
String g3 = mb.group(3); |
| 2167 |
String g4 = mb.group(4); |
| 2168 |
int chartNumber, row, column; |
| 2169 |
try { |
| 2170 |
chartNumber = Integer.parseInt(g2); |
| 2171 |
row = Integer.parseInt(g3); |
| 2172 |
column = Integer.parseInt(g4); |
| 2173 |
} catch (Exception E) { |
| 2174 |
chartNumber = -1; |
| 2175 |
row = -1; |
| 2176 |
column = -1; |
| 2177 |
} |
| 2178 |
for (int i = charts.size(); i <= chartNumber; i++) { |
| 2179 |
charts.add(new Chart()); |
| 2180 |
adjustChart = true; |
| 2181 |
} |
| 2182 |
for (int i = charts.get(chartNumber).getRowSize(); i <= row; i++) { |
| 2183 |
charts.get(chartNumber).addExpression(i, 0); |
| 2184 |
adjustChart = true; |
| 2185 |
} |
| 2186 |
for (int i = charts.get(chartNumber).getColumnSize(row); i <= column; i++) { |
| 2187 |
charts.get(chartNumber).addExpression(row, i); |
| 2188 |
adjustChart = true; |
| 2189 |
} |
| 2190 |
ChartExpression ex = charts.get(chartNumber).getChartExpression(row, column); |
| 2191 |
if ("field".equals(g1)) { //$NON-NLS-1$ |
| 2192 |
int index1 = 0; |
| 2193 |
for (String item : chartFieldValues) { |
| 2194 |
if (item.compareTo(value) == 0) { |
| 2195 |
break; |
| 2196 |
} |
| 2197 |
index1++; |
| 2198 |
} |
| 2199 |
if (index1 < chartFieldValues.length) { |
| 2200 |
ex.setFieldName(index1); |
| 2201 |
} |
| 2202 |
} else if ("type".equals(g1)) { //$NON-NLS-1$ |
| 2203 |
int index1 = 0; |
| 2204 |
for (String item : chartOperationValues) { |
| 2205 |
if (item.compareTo(value) == 0) { |
| 2206 |
break; |
| 2207 |
} |
| 2208 |
index1++; |
| 2209 |
} |
| 2210 |
if (index1 < chartOperationValues.length) { |
| 2211 |
ex.setOperation(index1); |
| 2212 |
} |
| 2213 |
} else if ("value".equals(g1)) { //$NON-NLS-1$ |
| 2214 |
ex.setValue(value); |
| 2215 |
} |
| 2216 |
|
| 2217 |
} |
| 2218 |
} else if (key.matches(REGEXP_CHART_NEGATE)) { |
| 2219 |
Matcher mb = PATTERN_CHART_NEGATE.matcher(key); |
| 2220 |
if (mb.find()) { |
| 2221 |
String g2 = mb.group(2); |
| 2222 |
int index; |
| 2223 |
try { |
| 2224 |
index = Integer.parseInt(g2); |
| 2225 |
} catch (Exception E) { |
| 2226 |
index = -1; |
| 2227 |
} |
| 2228 |
Chart ch = charts.get(index); |
| 2229 |
ch.setNegate("1".equals(value)); //$NON-NLS-1$ |
| 2230 |
} |
| 1829 |
} |
2231 |
} |
| 1830 |
} |
2232 |
} |
|
|
2233 |
if (adjustChart) { |
| 2234 |
recreateChartControls(); |
| 2235 |
} |
| 1831 |
} |
2236 |
} |
| 1832 |
|
2237 |
|
| 1833 |
private String[] nonNullArray(IDialogSettings settings, String id) { |
2238 |
private String[] nonNullArray(IDialogSettings settings, String id) { |
|
Lines 1891-1897
Link Here
|
| 1891 |
priority.getSelection().length > 0 || resolution.getSelection().length > 0 |
2296 |
priority.getSelection().length > 0 || resolution.getSelection().length > 0 |
| 1892 |
|| version.getSelection().length > 0 || target.getSelection().length > 0 |
2297 |
|| version.getSelection().length > 0 || target.getSelection().length > 0 |
| 1893 |
|| hardware.getSelection().length > 0 || os.getSelection().length > 0) { |
2298 |
|| hardware.getSelection().length > 0 || os.getSelection().length > 0) { |
| 1894 |
moreOptionsExpandComposite.setExpanded(true); |
2299 |
chartExpandComposite.setExpanded(true); |
| 1895 |
} |
2300 |
} |
| 1896 |
|
2301 |
|
| 1897 |
} catch (IllegalArgumentException e) { |
2302 |
} catch (IllegalArgumentException e) { |
|
Lines 2129-2162
Link Here
|
| 2129 |
super.dispose(); |
2534 |
super.dispose(); |
| 2130 |
} |
2535 |
} |
| 2131 |
|
2536 |
|
| 2132 |
private void resizeDialogIfNeeded(Point oldSize, Point newSize) { |
2537 |
private void createChartGroup(final Composite parent) { |
| 2133 |
if (oldSize == null || newSize == null) { |
2538 |
GridLayout layout; |
| 2134 |
return; |
2539 |
GridData gd; |
| 2135 |
} |
2540 |
chartGroup = new Composite(parent, SWT.NONE); |
| 2136 |
Shell shell = getShell(); |
2541 |
layout = new GridLayout(1, false); |
| 2137 |
Point shellSize = shell.getSize(); |
2542 |
layout.marginHeight = 0; |
| 2138 |
if (mustResize(oldSize, newSize)) { |
2543 |
layout.marginWidth = 0; |
| 2139 |
if (newSize.x > oldSize.x) { |
2544 |
layout.horizontalSpacing = 0; |
| 2140 |
shellSize.x += (newSize.x - oldSize.x); |
2545 |
chartGroup.setLayout(layout); |
| 2141 |
} |
2546 |
gd = new GridData(GridData.FILL, GridData.FILL, true, true, 1, 1); |
| 2142 |
if (newSize.y > oldSize.y) { |
2547 |
chartGroup.setLayoutData(gd); |
| 2143 |
shellSize.y += (newSize.y - oldSize.y); |
2548 |
charts.add(0, new Chart()); |
| 2144 |
} else { |
2549 |
recreateChartControls(); |
| 2145 |
shellSize.y -= (oldSize.y - newSize.y); |
2550 |
|
|
|
2551 |
parent.layout(true); |
| 2552 |
parent.redraw(); |
| 2553 |
} |
| 2554 |
|
| 2555 |
private void refreshChartControls() { |
| 2556 |
int chartNumMax = chartControls.size(); |
| 2557 |
for (int chartNum = 0; chartNum < chartNumMax; chartNum++) { |
| 2558 |
int chartRowMax = chartControls.get(chartNum).size(); |
| 2559 |
for (int chartRow = 0; chartRow < chartRowMax; chartRow++) { |
| 2560 |
int chartColumnMax = chartControls.get(chartNum).get(chartRow).size(); |
| 2561 |
for (int chartColumn = 0; chartColumn < chartColumnMax; chartColumn++) { |
| 2562 |
ChartExpression expression = charts.get(chartNum).getChartExpression(chartRow, chartColumn); |
| 2563 |
ChartControls controls = chartControls.get(chartNum).get(chartRow).get(chartColumn); |
| 2564 |
controls.getField().setText(chartFieldText[expression.getFieldName()]); |
| 2565 |
controls.getOperation().setText(chartOperationText[expression.getOperation()]); |
| 2566 |
controls.getValue().setText(expression.getValue()); |
| 2567 |
} |
| 2146 |
} |
2568 |
} |
| 2147 |
shell.setSize(shellSize); |
|
|
| 2148 |
shell.layout(true); |
| 2149 |
} else { |
| 2150 |
shell.pack(); |
| 2151 |
shellSize.x++; |
| 2152 |
shell.setSize(shellSize); |
| 2153 |
shellSize.x--; |
| 2154 |
shell.setSize(shellSize); |
| 2155 |
} |
2569 |
} |
|
|
2570 |
int negButtonMax = negateButtons.size(); |
| 2571 |
for (int chartNum = 0; chartNum < negButtonMax; chartNum++) { |
| 2572 |
Button b = negateButtons.get(chartNum); |
| 2573 |
Chart c = charts.get(chartNum); |
| 2574 |
b.setSelection(c.isNegate()); |
| 2575 |
} |
| 2576 |
scrolledComposite.reflow(true); |
| 2156 |
} |
2577 |
} |
| 2157 |
|
2578 |
|
| 2158 |
private boolean mustResize(Point currentSize, Point newSize) { |
2579 |
private void recreateChartControls() { |
| 2159 |
return currentSize.x < newSize.x || currentSize.y != newSize.y; |
2580 |
GridLayout layout; |
| 2160 |
} |
2581 |
GridData gd; |
|
|
2582 |
Composite parent = chartGroup.getParent(); |
| 2583 |
chartGroup.setVisible(false); |
| 2584 |
chartGroup.dispose(); |
| 2585 |
chartControls.clear(); |
| 2586 |
negateButtons.clear(); |
| 2587 |
chartGroup = new Composite(parent, SWT.NONE); |
| 2588 |
layout = new GridLayout(1, false); |
| 2589 |
layout.verticalSpacing = 0; |
| 2590 |
layout.marginHeight = 0; |
| 2591 |
layout.marginWidth = 0; |
| 2592 |
chartGroup.setLayout(layout); |
| 2593 |
gd = new GridData(GridData.FILL, GridData.FILL, true, true, 1, 1); |
| 2594 |
chartGroup.setLayoutData(gd); |
| 2595 |
|
| 2596 |
int chartNumMax = charts.size(); |
| 2597 |
for (int chartNumber = 0; chartNumber < chartNumMax; chartNumber++) { |
| 2598 |
final int chartNum = chartNumber; |
| 2599 |
final Composite chartGroup0 = new Composite(chartGroup, SWT.NONE); |
| 2600 |
if (chartNum > 0) { |
| 2601 |
Label sep = new Label(chartGroup0, SWT.SEPARATOR | SWT.HORIZONTAL); |
| 2602 |
gd = new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1); |
| 2603 |
sep.setLayoutData(gd); |
| 2604 |
} |
| 2605 |
layout = new GridLayout(3, false); |
| 2606 |
chartGroup0.setLayout(layout); |
| 2607 |
gd = new GridData(GridData.FILL, GridData.FILL, true, true, 3, 1); |
| 2608 |
chartGroup0.setLayoutData(gd); |
| 2609 |
final int chartRowMax = charts.get(chartNum).getRowSize(); |
| 2610 |
for (int chartRowNumber = 0; chartRowNumber < chartRowMax; chartRowNumber++) { |
| 2611 |
final int chartRow = chartRowNumber; |
| 2612 |
int chartColumnMax = charts.get(chartNum).getColumnSize(chartRow); |
| 2613 |
final Group chartGroup1 = new Group(chartGroup0, SWT.NONE); |
| 2614 |
layout = new GridLayout(4, false); |
| 2615 |
chartGroup1.setLayout(layout); |
| 2616 |
gd = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1); |
| 2617 |
chartGroup1.setLayoutData(gd); |
| 2618 |
for (int chartColumnNumber = 0; chartColumnNumber < chartColumnMax; chartColumnNumber++) { |
| 2619 |
final int chartColumn = chartColumnNumber; |
| 2620 |
final Combo comboField = new Combo(chartGroup1, SWT.SINGLE | SWT.BORDER); |
| 2621 |
comboField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 2622 |
comboField.addModifyListener(new ModifyListenerImplementation()); |
| 2623 |
comboField.setItems(chartFieldText); |
| 2624 |
comboField.setText(chartFieldText[0]); |
| 2625 |
comboField.addSelectionListener(new SelectionAdapter() { |
| 2626 |
@Override |
| 2627 |
public void widgetSelected(SelectionEvent e) { |
| 2628 |
ChartExpression chartExpression = charts.get(chartNum).getChartExpression(chartRow, |
| 2629 |
chartColumn); |
| 2630 |
chartExpression.setFieldName(comboField.getSelectionIndex()); |
| 2631 |
chartGroup.getShell().layout(true); |
| 2632 |
chartGroup.getShell().redraw(); |
| 2633 |
} |
| 2634 |
}); |
| 2635 |
comboField.setToolTipText(Messages.BugzillaSearchPage_Tooltip_Custom_fields_at_end); |
| 2161 |
|
2636 |
|
|
|
2637 |
final Combo comboOperation = new Combo(chartGroup1, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); |
| 2638 |
comboOperation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); |
| 2639 |
comboOperation.setItems(chartOperationText); |
| 2640 |
comboOperation.setText(chartOperationText[0]); |
| 2641 |
comboOperation.select(0); |
| 2642 |
comboOperation.addSelectionListener(new SelectionAdapter() { |
| 2643 |
@Override |
| 2644 |
public void widgetSelected(SelectionEvent e) { |
| 2645 |
ChartExpression chartExpression = charts.get(chartNum).getChartExpression(chartRow, |
| 2646 |
chartColumn); |
| 2647 |
chartExpression.setOperation(comboOperation.getSelectionIndex()); |
| 2648 |
} |
| 2649 |
}); |
| 2650 |
final Combo comboValue = new Combo(chartGroup1, SWT.SINGLE | SWT.BORDER); |
| 2651 |
gd = new GridData(GridData.FILL, GridData.CENTER, true, false); |
| 2652 |
gd.widthHint = 150; |
| 2653 |
comboValue.setLayoutData(gd); |
| 2654 |
comboValue.addModifyListener(new ModifyListener() { |
| 2655 |
|
| 2656 |
public void modifyText(ModifyEvent e) { |
| 2657 |
ChartExpression chartExpression = charts.get(chartNum).getChartExpression(chartRow, |
| 2658 |
chartColumn); |
| 2659 |
chartExpression.setValue(comboValue.getText()); |
| 2660 |
if (isControlCreated()) { |
| 2661 |
setPageComplete(isPageComplete()); |
| 2662 |
} |
| 2663 |
} |
| 2664 |
}); |
| 2665 |
Button orButton = new Button(chartGroup1, SWT.PUSH); |
| 2666 |
orButton.setText(Messages.BugzillaSearchPage_OR_Button); |
| 2667 |
gd = new GridData(SWT.LEFT, SWT.CENTER, false, false); |
| 2668 |
orButton.setLayoutData(gd); |
| 2669 |
orButton.addSelectionListener(new SelectionAdapter() { |
| 2670 |
@Override |
| 2671 |
public void widgetSelected(SelectionEvent e) { |
| 2672 |
if (e.stateMask == SWT.CTRL) { |
| 2673 |
if (charts.size() == 1 && charts.get(0).getRowSize() == 1 |
| 2674 |
&& charts.get(0).getColumnSize(0) == 1) { |
| 2675 |
return; |
| 2676 |
} |
| 2677 |
charts.get(chartNum).removeColumn(chartRow, chartColumn); |
| 2678 |
if (charts.get(chartNum).getRowSize() == 0) { |
| 2679 |
if (chartNum != 0) { |
| 2680 |
charts.remove(chartNum); |
| 2681 |
} |
| 2682 |
} |
| 2683 |
} else { |
| 2684 |
charts.get(chartNum).addExpression(chartRow, chartColumn + 1); |
| 2685 |
} |
| 2686 |
recreateChartControls(); |
| 2687 |
} |
| 2688 |
}); |
| 2689 |
orButton.setToolTipText(Messages.BugzillaSearchPage_Tooltip_remove_row); |
| 2690 |
ChartControls chartControl = new ChartControls(comboField, comboOperation, comboValue); |
| 2691 |
int chart1 = chartControls.size(); |
| 2692 |
if (chart1 < chartNum + 1) { |
| 2693 |
chartControls.add(new ArrayList<ArrayList<ChartControls>>()); |
| 2694 |
} |
| 2695 |
int chart2 = chartControls.get(chartNum).size(); |
| 2696 |
if (chart2 < chartRow + 1) { |
| 2697 |
chartControls.get(chartNum).add(new ArrayList<BugzillaSearchPage.ChartControls>()); |
| 2698 |
} |
| 2699 |
chartControls.get(chartNum).get(chartRow).add(chartControl); |
| 2700 |
} |
| 2701 |
if (chartRowNumber < chartRowMax - 1) { |
| 2702 |
Label lable = new Label(chartGroup0, SWT.NONE); |
| 2703 |
lable.setText(Messages.BugzillaSearchPage_AND_Button); |
| 2704 |
GridData g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1); |
| 2705 |
lable.setLayoutData(g); |
| 2706 |
} else { |
| 2707 |
final Button andButton = new Button(chartGroup0, SWT.PUSH); |
| 2708 |
andButton.setText(Messages.BugzillaSearchPage_AND_Button); |
| 2709 |
gd = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
| 2710 |
andButton.setLayoutData(gd); |
| 2711 |
final Button newButton = new Button(chartGroup0, SWT.PUSH); |
| 2712 |
newButton.setText(Messages.BugzillaSearchPage_Add_Chart_Button); |
| 2713 |
gd = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
| 2714 |
newButton.setLayoutData(gd); |
| 2715 |
final Button negateButton = new Button(chartGroup0, SWT.CHECK); |
| 2716 |
negateButton.setText(Messages.BugzillaSearchPage_Negate_Button); |
| 2717 |
negateButtons.add(negateButton); |
| 2718 |
gd = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
| 2719 |
negateButton.setLayoutData(gd); |
| 2720 |
negateButton.addSelectionListener(new SelectionAdapter() { |
| 2721 |
@Override |
| 2722 |
public void widgetSelected(SelectionEvent e) { |
| 2723 |
Chart chart = charts.get(chartNum); |
| 2724 |
chart.setNegate(negateButton.getSelection()); |
| 2725 |
} |
| 2726 |
}); |
| 2727 |
newButton.addSelectionListener(new SelectionAdapter() { |
| 2728 |
@Override |
| 2729 |
public void widgetSelected(SelectionEvent e) { |
| 2730 |
newButton.setVisible(false); |
| 2731 |
newButton.dispose(); |
| 2732 |
charts.add(chartNum + 1, new Chart()); |
| 2733 |
recreateChartControls(); |
| 2734 |
} |
| 2735 |
}); |
| 2736 |
andButton.addSelectionListener(new SelectionAdapter() { |
| 2737 |
@Override |
| 2738 |
public void widgetSelected(SelectionEvent e) { |
| 2739 |
charts.get(chartNum).addExpression(chartRow + 1, 0); |
| 2740 |
recreateChartControls(); |
| 2741 |
|
| 2742 |
} |
| 2743 |
}); |
| 2744 |
} |
| 2745 |
} |
| 2746 |
|
| 2747 |
} |
| 2748 |
scrolledComposite.reflow(true); |
| 2749 |
refreshChartControls(); |
| 2750 |
} |
| 2162 |
} |
2751 |
} |