Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-06-13 05:38:52 +0000
committerspingel2009-06-13 05:38:52 +0000
commit6abb20f30ade073a0d90ebad312136ce1d509375 (patch)
treee94e0181c8ad4ac1bb65b6a7dc6798db0b265284 /org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model
parentbe90b8b20b859913e9c077fdb8ee9fd3e0d9a163 (diff)
downloadorg.eclipse.mylyn.tasks-6abb20f30ade073a0d90ebad312136ce1d509375.tar.gz
org.eclipse.mylyn.tasks-6abb20f30ade073a0d90ebad312136ce1d509375.tar.xz
org.eclipse.mylyn.tasks-6abb20f30ade073a0d90ebad312136ce1d509375.zip
NEW - bug 268427: query only returns first 100 matches
https://bugs.eclipse.org/bugs/show_bug.cgi?id=268427
Diffstat (limited to 'org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model')
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java
index bad670bde..8dfc77e6c 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/model/TracSearch.java
@@ -27,6 +27,7 @@ import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient;
import org.eclipse.mylyn.internal.trac.core.model.TracSearchFilter.CompareOperator;
+import org.eclipse.osgi.util.NLS;
/**
* Represents a Trac search. A search can have multiple {@link TracSearchFilter}s that all need to match.
@@ -43,6 +44,8 @@ public class TracSearch {
private boolean ascending = true;
+ private int max = -1;
+
public TracSearch(String queryParameter) {
fromUrl(queryParameter);
}
@@ -101,6 +104,10 @@ public class TracSearch {
sb.append("&desc=1"); //$NON-NLS-1$
}
}
+ if (max != -1) {
+ sb.append("&max="); //$NON-NLS-1$
+ sb.append(max);
+ }
for (TracSearchFilter filter : filterByFieldName.values()) {
sb.append("&"); //$NON-NLS-1$
sb.append(filter.getFieldName());
@@ -135,6 +142,10 @@ public class TracSearch {
// no results will be returned)
sb.append("&order=id"); //$NON-NLS-1$
}
+ if (max != -1) {
+ sb.append("&max="); //$NON-NLS-1$
+ sb.append(max);
+ }
for (TracSearchFilter filter : filterByFieldName.values()) {
for (String value : filter.getValues()) {
@@ -169,6 +180,13 @@ public class TracSearch {
setAscending(!"1".equals(value)); //$NON-NLS-1$
} else if ("group".equals(key) || "groupdesc".equals(key) || "verbose".equals(key)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// ignore these parameters
+ } else if ("max".equals(key)) { //$NON-NLS-1$
+ try {
+ setMax(Integer.parseInt(value));
+ } catch (NumberFormatException e) {
+ StatusHandler.log(new Status(IStatus.WARNING, TracCorePlugin.ID_PLUGIN, NLS.bind(
+ "Illegal format in URL, expected a number ''{0}''", value), e)); //$NON-NLS-1$
+ }
} else {
addFilter(key, value);
}
@@ -180,4 +198,12 @@ public class TracSearch {
}
}
+ public int getMax() {
+ return max;
+ }
+
+ public void setMax(int max) {
+ this.max = max;
+ }
+
}

Back to the top