Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/ContentProposal.java53
-rw-r--r--org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexSearchHandler.java9
2 files changed, 57 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/ContentProposal.java b/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/ContentProposal.java
new file mode 100644
index 00000000..6c0fd362
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/ContentProposal.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.index.ui;
+
+import org.eclipse.jface.fieldassist.IContentProposal;
+
+class ContentProposal implements IContentProposal {
+
+ private final String content;
+
+ private final int cursorPosition;
+
+ private final String label;
+
+ private final String description;
+
+ public ContentProposal(String content, String label, String description) {
+ this(content, label, description, content.length());
+ }
+
+ public ContentProposal(String content, String label, String description, int cursorPosition) {
+ this.content = content;
+ this.cursorPosition = cursorPosition;
+ this.label = label;
+ this.description = description;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public int getCursorPosition() {
+ return cursorPosition;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexSearchHandler.java b/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexSearchHandler.java
index 0821120f..1b71b3af 100644
--- a/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexSearchHandler.java
+++ b/org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexSearchHandler.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.mylyn.internal.tasks.index.ui;
+import java.io.File;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
@@ -20,8 +21,6 @@ import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicInteger;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.fieldassist.ContentProposal;
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
import org.eclipse.jface.fieldassist.IContentProposal;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
@@ -83,9 +82,8 @@ public class IndexSearchHandler extends AbstractSearchHandler {
synchronized (IndexSearchHandler.class) {
if (index == null) {
if (theIndex == null) {
- // FIXME: multiple instances
theIndex = new TaskListIndex(TasksUiPlugin.getTaskList(), TasksUiPlugin.getTaskDataManager(),
- Platform.getBundle(TasksIndexUi.BUNDLE_ID).getDataFile(".taskListIndex")); //$NON-NLS-1$
+ new File(TasksUiPlugin.getDefault().getDataDirectory(), ".taskListIndex")); //$NON-NLS-1$
}
index = theIndex;
referenceCount.incrementAndGet();
@@ -188,7 +186,8 @@ public class IndexSearchHandler extends AbstractSearchHandler {
description = NLS.bind(Messages.IndexSearchHandler_Generic_date_range_search_1_week,
field.fieldName());
- String label = NLS.bind(Messages.IndexSearchHandler_Past_week_date_range_label, field.fieldName());
+ String label = NLS.bind(Messages.IndexSearchHandler_Past_week_date_range_label,
+ field.fieldName());
String queryText = index.computeQueryFieldDateRange(field, dateSearchOneWeekLowerBound,
dateSearchUpperBound);

Back to the top