Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 182766 Details for
Bug 283200
[bugzilla] support querying over custom fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
current implematation
patch283200V1.txt (text/plain), 18.44 KB, created by
Frank Becker
on 2010-11-09 15:08:07 EST
(
hide
)
Description:
current implematation
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2010-11-09 15:08:07 EST
Size:
18.44 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.ui >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java,v >retrieving revision 1.148 >diff -u -r1.148 BugzillaSearchPage.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java 24 Oct 2010 19:02:40 -0000 1.148 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java 9 Nov 2010 20:07:07 -0000 >@@ -149,6 +149,38 @@ > private static final String[] emailRoleValues2 = { "emailassigned_to2", "emailreporter2", "emailcc2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > "emaillongdesc2", "emailqa_contact2" }; //$NON-NLS-1$ //$NON-NLS-2$ > >+ private static final String[] chartFieldText = { "---", "Alias", "AssignedTo", "Attachment creator", >+ "Attachment data", "Attachment description", "Attachment filename", "Attachment is a URL", >+ "Attachment is obsolete", "Attachment is patch", "Attachment is private", "Attachment mime type", "Blocks", >+ "Bug #", "CC", "CC Accessible", "Classification", "Comment", "Comment is private", "Commenter", >+ "Component", "Content", "Creation date", "Days since bug changed", "Depends on", "drop down custom field", >+ "Ever Confirmed", "Flag", "Flag Requestee", "Flag Setter", "free text custom field", "Group", "Keywords", >+ "Last changed date", "OS/Version", "Platform", "Priority", "Product", "QAContact", "ReportedBy", >+ "Reporter Accessible", "Resolution", "Severity", "Status", "Status Whiteboard", "Summary", >+ "Target Milestone", "Time Since Assignee Touched", "URL", "Version", "Votes" }; >+ >+ private static final String[] chartFieldValues = { "noop", "alias", "assigned_to", "attachments.submitter", >+ "attach_data.thedata", "attachments.description", "attachments.filename", "attachments.isurl", >+ "attachments.isobsolete", "attachments.ispatch", "attachments.isprivate", "attachments.mimetype", >+ "blocked", "bug_id", "cc", "cclist_accessible", "classification", "longdesc", "longdescs.isprivate", >+ "commenter", "component", "content", "creation_ts", "days_elapsed", "dependson", "cf_dropdown", >+ "everconfirmed", "flagtypes.name", "requestees.login_name", "setters.login_name", "cf_freetext", >+ "bug_group", "keywords", "delta_ts", "op_sys", "rep_platform", "priority", "product", "qa_contact", >+ "reporter", "reporter_accessible", "resolution", "bug_severity", "bug_status", "status_whiteboard", >+ "short_desc", "target_milestone", "owner_idle_time", "bug_file_loc", "version", "votes" }; >+ >+ private static final String[] chartOperationText = { "---", "is equal to", "is not equal to", >+ "is equal to any of the strings", "contains the string", "contains the string (exact case)", >+ "does not contain the string", "contains any of the strings", "contains all of the strings", >+ "contains none of the strings", "contains regexp", "does not contain regexp", "is less than", >+ "is greater than", "contains any of the words", "contains all of the words", "contains none of the words", >+ "changed before", "changed after", "changed from", "changed to", "changed by", "matches" }; >+ >+ private static final String[] chartOperationValues = { "noop", "equals", "notequals", "anyexact", "substring", >+ "casesubstring", "notsubstring", "anywordssubstr", "allwordssubstr", "nowordssubstr", "regexp", >+ "notregexp", "lessthan", "greaterthan", "anywords", "allwords", "nowords", "changedbefore", "changedafter", >+ "changedfrom", "changedto", "changedby", "matches" }; >+ > // dialog store id constants > private final static String DIALOG_BOUNDS_KEY = "ResizableDialogBounds"; //$NON-NLS-1$ > >@@ -292,6 +324,189 @@ > > private ExpandableComposite moreOptionsExpandComposite; > >+ private ExpandableComposite chartExpandComposite; >+ >+ private Group chartGroup; >+ >+ protected class ChartExpression { >+ private int fieldName; >+ >+ private int operation; >+ >+ private String value; >+ >+ public ChartExpression(int fieldName, int operation, String value) { >+ super(); >+ this.fieldName = fieldName; >+ this.operation = operation; >+ this.value = value; >+ } >+ >+ public int getFieldName() { >+ return fieldName; >+ } >+ >+ public void setFieldName(int fieldName) { >+ this.fieldName = fieldName; >+ } >+ >+ public int getOperation() { >+ return operation; >+ } >+ >+ public void setOperation(int operation) { >+ this.operation = operation; >+ } >+ >+ public String getValue() { >+ return value; >+ } >+ >+ public void setValue(String value) { >+ this.value = value; >+ } >+ } >+ >+ protected class Chart { >+ private final ArrayList<ArrayList<ChartExpression>> expressions; >+ >+ private boolean negate; >+ >+ private final int chartNumber; >+ >+ public Chart(int chartNumber) { >+ super(); >+ ChartExpression expression = new ChartExpression(0, 0, ""); //$NON-NLS-1$ >+ ArrayList<ChartExpression> column = new ArrayList<ChartExpression>(1); >+ column.add(expression); >+ expressions = new ArrayList<ArrayList<ChartExpression>>(1); >+ expressions.add(column); >+ negate = false; >+ this.chartNumber = chartNumber; >+ } >+ >+ public boolean isNegate() { >+ return negate; >+ } >+ >+ public void setNegate(boolean negate) { >+ this.negate = negate; >+ } >+ >+ public void addExpression(int rowIndex, int columnIndex) { >+ ChartExpression expression = new ChartExpression(0, 0, ""); //$NON-NLS-1$ >+ int size = expressions.size(); >+ if (rowIndex > size + 1) { >+ rowIndex = size + 1; >+ } >+ if (rowIndex < 0) { >+ rowIndex = 0; >+ } >+ ArrayList<ChartExpression> row; >+ if (rowIndex == size) { >+ row = new ArrayList<BugzillaSearchPage.ChartExpression>(); >+ expressions.add(rowIndex, row); >+ } else { >+ row = expressions.get(rowIndex); >+ } >+ if (row != null) { >+ int size1 = expressions.size(); >+ if (columnIndex > size1 + 1) { >+ columnIndex = size1 + 1; >+ } >+ if (columnIndex < 0) { >+ columnIndex = 0; >+ } >+ row.add(columnIndex, expression); >+ } >+ >+ } >+ >+ public void addRow(int index) { >+ int size = expressions.size(); >+ if (index > size) { >+ index = size; >+ } >+ if (index < 0) { >+ index = 0; >+ } >+ addRow(index); >+ } >+ >+ public int getRowSize() { >+ return expressions.size(); >+ } >+ >+ public int getColumnSize(int row) { >+ int size = expressions.size(); >+ if (row > size) { >+ row = size; >+ } >+ if (row < 0) { >+ row = 0; >+ } >+ return expressions.get(row).size(); >+ } >+ >+ public ChartExpression getChartExpression(int row, int column) { >+ ChartExpression result = null; >+ int rowSize = expressions.size(); >+ if (row > rowSize) { >+ row = rowSize; >+ } >+ if (row < 0) { >+ row = 0; >+ } >+ >+ int columnSize = getColumnSize(row); >+ if (column > columnSize) { >+ column = columnSize; >+ } >+ if (column < 0) { >+ column = 0; >+ } >+ return expressions.get(row).get(column); >+ } >+ } >+ >+ private final ArrayList<Chart> charts = new ArrayList<BugzillaSearchPage.Chart>(1); >+ >+ private class ChartControls { >+ private final Combo field; >+ >+ private final Combo operation; >+ >+ private final Combo value; >+ >+ private final Button orButton; >+ >+ public ChartControls(Combo field, Combo operation, Combo value, Button orButton) { >+ super(); >+ this.field = field; >+ this.operation = operation; >+ this.value = value; >+ this.orButton = orButton; >+ } >+ >+ public Combo getField() { >+ return field; >+ } >+ >+ public Combo getOperation() { >+ return operation; >+ } >+ >+ public Combo getValue() { >+ return value; >+ } >+ >+ public Button getOrButton() { >+ return orButton; >+ } >+ } >+ >+ private final ArrayList<ArrayList<ArrayList<ChartControls>>> chartControls = new ArrayList<ArrayList<ArrayList<ChartControls>>>(); >+ > private final SelectionAdapter updateActionSelectionAdapter = new SelectionAdapter() { > @Override > public void widgetSelected(SelectionEvent e) { >@@ -495,8 +710,52 @@ > Dialog.applyDialogFont(moreOptionsComposite); > moreOptionsExpandComposite.setClient(moreOptionsComposite); > >+// #### >+ chartExpandComposite = toolkit.createExpandableComposite(control, ExpandableComposite.COMPACT >+ | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); >+ chartExpandComposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); >+ chartExpandComposite.setBackground(null); >+ chartExpandComposite.setText("Boolean Charts"); >+ chartExpandComposite.setLayout(new GridLayout(1, false)); >+ g = new GridData(GridData.FILL, GridData.FILL, true, true); >+ g.horizontalSpan = 4; >+ g.horizontalIndent = INDENT; >+ chartExpandComposite.setLayoutData(g); >+ chartExpandComposite.addExpansionListener(new ExpansionAdapter() { >+ @Override >+ public void expansionStateChanged(ExpansionEvent e) { >+ if ((Boolean) e.data == true) { >+ Point minSize = getControl().getShell().getMinimumSize(); >+ minSize.y = 500; >+ getControl().getShell().setMinimumSize(minSize); >+ } else { >+ Point minSize = getControl().getShell().getMinimumSize(); >+ minSize.y = 290; >+ getControl().getShell().setMinimumSize(minSize); >+ } >+ Shell shell = getShell(); >+ shell.pack(); >+ Point shellSize = shell.getSize(); >+ shellSize.x++; >+ shell.setSize(shellSize); >+ shellSize.x--; >+ shell.setSize(shellSize); >+ } >+ }); >+ >+ Composite chartOptionsComposite = new Composite(chartExpandComposite, SWT.NULL); >+ GridLayout chartLayout = new GridLayout(4, false); >+ chartLayout.marginHeight = 0; >+ chartLayout.marginWidth = 0; >+ chartOptionsComposite.setLayout(chartLayout); >+ >+ Dialog.applyDialogFont(chartOptionsComposite); >+ chartExpandComposite.setClient(chartOptionsComposite); >+//#### >+ > createMoreOptionsComposite(moreOptionsComposite); > createSearchGroup(moreOptionsComposite); >+ createChartGroup(chartOptionsComposite); > if (inSearchContainer()) { > control.getShell().setMinimumSize(new Point(610, 450)); > } else { >@@ -974,7 +1233,6 @@ > gd_os.heightHint = HEIGHT_ATTRIBUTE_COMBO; > os.setLayoutData(gd_os); > os.addSelectionListener(updateActionSelectionAdapter); >- > } > > private void createSearchGroup(Composite control) { >@@ -1466,7 +1724,25 @@ > sb.append("&status_whiteboard_type="); //$NON-NLS-1$ > sb.append(patternOperationValues[whiteboardOperation.getSelectionIndex()]); > appendToBuffer(sb, "&status_whiteboard=", whiteboardPattern.getText()); //$NON-NLS-1$ >- >+ int indexMax = charts.size(); >+ for (int index = 0; index < indexMax; index++) { >+ Chart chart = charts.get(index); >+ if (chart.isNegate()) { >+ sb.append("&negate" + index + "=1"); >+ } >+ int rowMax = chart.getRowSize(); >+ for (int row = 0; row < rowMax; row++) { >+ int columnMax = chart.getColumnSize(row); >+ for (int column = 0; column < columnMax; column++) { >+ ChartExpression chartExpression = chart.getChartExpression(row, column); >+ sb.append("&field" + index + "-" + row + "-" + column + "=" >+ + chartFieldValues[chartExpression.getFieldName()]); >+ sb.append("&type" + index + "-" + row + "-" + column + "=" >+ + chartOperationValues[chartExpression.getOperation()]); >+ sb.append("&value" + index + "-" + row + "-" + column + "=" + chartExpression.getValue()); >+ } >+ } >+ } > return sb; > } > >@@ -2159,4 +2435,185 @@ > return currentSize.x < newSize.x || currentSize.y != newSize.y; > } > >+ private void createChartGroup(final Composite parent) { >+ GridLayout layout; >+ GridData gd; >+ >+ chartGroup = new Group(parent, SWT.NONE); >+ layout = new GridLayout(1, false); >+ chartGroup.setLayout(layout); >+ gd = new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); >+ chartGroup.setLayoutData(gd); >+ >+ Group chartGroup0 = new Group(chartGroup, SWT.NONE); >+ layout = new GridLayout(2, false); >+ chartGroup0.setLayout(layout); >+ gd = new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); >+ chartGroup0.setLayoutData(gd); >+ >+ Group chartGroup1 = new Group(chartGroup0, SWT.NONE); >+ layout = new GridLayout(4, false); >+ chartGroup1.setLayout(layout); >+ gd = new GridData(SWT.LEFT, SWT.CENTER, true, true, 2, 1); >+ chartGroup1.setLayoutData(gd); >+ >+ Chart chart = new Chart(0); >+ charts.add(chart); >+ createChartControls(chartGroup1, 0, 0, 0); >+ >+// Button clearButton = new Button(chartGroup, SWT.PUSH); >+// clearButton.setText("Charts"); >+// clearButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); >+// clearButton.addSelectionListener(new SelectionAdapter() { >+// @Override >+// public void widgetSelected(SelectionEvent e) { >+ // Comment pattern combo >+ >+ parent.layout(true); >+ parent.redraw(); >+ } >+ >+ private void createChartControls(final Group chartGroup, final int chartNumber, final int row, final int column) { >+ final Combo comboField = new Combo(chartGroup, SWT.SINGLE | SWT.BORDER); >+ comboField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); >+ comboField.addModifyListener(new ModifyListenerImplementation()); >+ comboField.setItems(chartFieldText); >+ comboField.setText(chartFieldText[0]); >+ comboField.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ ChartExpression chartExpression = charts.get(chartNumber).getChartExpression(row, column); >+ chartExpression.setFieldName(comboField.getSelectionIndex()); >+ chartGroup.getShell().layout(true); >+ chartGroup.getShell().redraw(); >+ } >+ }); >+ >+ final Combo comboOperation = new Combo(chartGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER); >+ comboOperation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); >+ comboOperation.setItems(chartOperationText); >+ comboOperation.setText(chartOperationText[0]); >+ comboOperation.select(0); >+ comboOperation.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ ChartExpression chartExpression = charts.get(chartNumber).getChartExpression(row, column); >+ chartExpression.setOperation(comboOperation.getSelectionIndex()); >+ } >+ }); >+ >+ final Combo comboValue = new Combo(chartGroup, SWT.SINGLE | SWT.BORDER); >+ GridData g = new GridData(GridData.FILL, GridData.CENTER, false, false); >+ g.widthHint = 150; >+ comboValue.setLayoutData(g); >+ comboValue.addModifyListener(new ModifyListener() { >+ >+ public void modifyText(ModifyEvent e) { >+ ChartExpression chartExpression = charts.get(chartNumber).getChartExpression(row, column); >+ chartExpression.setValue(comboValue.getText()); >+ if (isControlCreated()) { >+ setPageComplete(isPageComplete()); >+ } >+ } >+ }); >+ >+ Button orButton = new Button(chartGroup, SWT.PUSH); >+ orButton.setText("OR"); >+ g = new GridData(SWT.LEFT, SWT.CENTER, false, false); >+// g.widthHint = 40; >+ orButton.setLayoutData(g); >+ orButton.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ int y = charts.get(chartNumber).getColumnSize(row); >+ charts.get(chartNumber).addExpression(row, column + 1); >+ createChartControls(chartGroup, chartNumber, row, y); >+ } >+ }); >+ if (column == 0) { >+ final Button andButton = new Button(chartGroup.getParent(), SWT.PUSH); >+ andButton.setText("AND"); >+ g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); >+// g.widthHint = 60; >+ andButton.setLayoutData(g); >+ final Button newButton = new Button(chartGroup.getParent(), SWT.PUSH); >+ newButton.setText("New chart"); >+ g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); >+ newButton.setLayoutData(g); >+ newButton.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ newButton.setVisible(false); >+ newButton.dispose(); >+ >+ final Group chartGroup0 = new Group(chartGroup.getParent().getParent(), SWT.NONE); >+ GridLayout layout = new GridLayout(2, false); >+ chartGroup0.setLayout(layout); >+ >+ Group chartGroup1 = new Group(chartGroup0, SWT.NONE); >+ layout = new GridLayout(4, false); >+ chartGroup1.setLayout(layout); >+ GridData gd = new GridData(SWT.LEFT, SWT.CENTER, true, true, 2, 1); >+ chartGroup1.setLayoutData(gd); >+ >+ charts.add(new Chart(chartNumber + 1)); >+ createChartControls(chartGroup1, chartNumber + 1, 0, 0); >+ } >+ }); >+ andButton.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ Label lable = new Label(chartGroup.getParent(), SWT.NONE); >+ andButton.setVisible(false); >+ andButton.dispose(); >+ if (!newButton.isDisposed()) { >+ newButton.setVisible(false); >+ newButton.dispose(); >+ } >+ lable.setText("AND"); >+ GridData g = new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1); >+ lable.setLayoutData(g); >+ >+ Group chartGroup1 = new Group(chartGroup.getParent(), SWT.NONE); >+ GridLayout layout = new GridLayout(4, false); >+ chartGroup1.setLayout(layout); >+ chartGroup1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ GridData gd = new GridData(SWT.LEFT, SWT.CENTER, true, true, 2, 1); >+ chartGroup1.setLayoutData(gd); >+ >+ charts.get(chartNumber).addExpression(row + 1, 0); >+ createChartControls(chartGroup1, chartNumber, row + 1, 0); >+ } >+ }); >+ } >+ ChartControls chartControl = new ChartControls(comboField, comboOperation, comboValue, orButton); >+ int chart1 = chartControls.size(); >+ if (chart1 < chartNumber + 1) { >+ chartControls.add(new ArrayList<ArrayList<ChartControls>>()); >+ } >+ int chart2 = chartControls.get(chartNumber).size(); >+ if (chart2 < row + 1) { >+ chartControls.get(chartNumber).add(new ArrayList<BugzillaSearchPage.ChartControls>()); >+ } >+ chartControls.get(chartNumber).get(row).add(chartControl); >+ refreshChartControls(); >+ } >+ >+ private void refreshChartControls() { >+ int chartNumMax = chartControls.size(); >+ for (int chartNum = 0; chartNum < chartNumMax; chartNum++) { >+ int chartRowMax = chartControls.get(chartNum).size(); >+ for (int chartRow = 0; chartRow < chartRowMax; chartRow++) { >+ int chartColumnMax = chartControls.get(chartNum).get(chartRow).size(); >+ for (int chartColumn = 0; chartColumn < chartColumnMax; chartColumn++) { >+ ChartExpression expression = charts.get(chartNum).getChartExpression(chartRow, chartColumn); >+ ChartControls controls = chartControls.get(chartNum).get(chartRow).get(chartColumn); >+ controls.getField().setText(chartFieldText[expression.getFieldName()]); >+ controls.getOperation().setText(chartOperationText[expression.getOperation()]); >+ controls.getValue().setText(expression.getValue()); >+ } >+ } >+ } >+ chartGroup.layout(true); >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 283200
:
181786
|
182765
| 182766 |
182767
|
183027
|
188185
|
188187
|
188209
|
188628
|
188629
|
188651
|
189135
|
189136
|
189525