summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-03-09 05:16:50 (EST)
committer Steffen Pingel2012-03-09 05:16:50 (EST)
commit8366e7cfff01d39d7ac7e3e4f5ddd9bfe284b17d (patch)
tree413f7f9321c2ddbc0e4fc891261d63d4810068b2
parentc634e483d49a17f9642c3a1ab6941283d6da9bed (diff)
downloadorg.eclipse.mylyn.tasks-8366e7cfff01d39d7ac7e3e4f5ddd9bfe284b17d.zip
org.eclipse.mylyn.tasks-8366e7cfff01d39d7ac7e3e4f5ddd9bfe284b17d.tar.gz
org.eclipse.mylyn.tasks-8366e7cfff01d39d7ac7e3e4f5ddd9bfe284b17d.tar.bz2
ASSIGNED - bug 373275: show "Content Assist Available" decoration in
task list find box https://bugs.eclipse.org/bugs/show_bug.cgi?id=373275 Change-Id: I29df0e820a0359bba01dc4d38623173c882de5b5
-rw-r--r--org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexSearchHandler.java13
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java6
2 files changed, 6 insertions, 13 deletions
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 01ef81b..fd50258 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
@@ -36,6 +36,7 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
@@ -231,16 +232,12 @@ public class IndexSearchHandler extends AbstractSearchHandler {
public void adaptTextSearchControl(Text textControl) {
IContentProposalProvider proposalProvider = new ContentProposalProvider();
final ContentAssistCommandAdapter adapter = new ContentAssistCommandAdapter(textControl,
- new TextContentAdapter(), proposalProvider, null, new char[0]);
+ new TextContentAdapter(), proposalProvider, null, new char[0], true);
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
- // if we decorate the control it lets the user know that they can use content assist...
- // BUT it looks pretty bad.
-// ControlDecoration controlDecoration = new ControlDecoration(textControl, (SWT.TOP | SWT.LEFT));
-// controlDecoration.setShowOnlyOnFocus(true);
-// FieldDecoration contentProposalImage = FieldDecorationRegistry.getDefault().getFieldDecoration(
-// FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
-// controlDecoration.setImage(contentProposalImage.getImage());
+ if (textControl.getParent().getLayout() instanceof GridLayout) {
+ ((GridLayout) textControl.getParent().getLayout()).marginLeft = 4;
+ }
// FilteredTree registers a traverse listener that focuses the tree when ENTER is pressed. This
// causes focus to be lost when a content proposal is selected. To avoid transfer of focus the
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
index 64571b1..c4e0143 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
@@ -237,11 +237,8 @@ public class TaskListFilteredTree extends AbstractFilteredTree {
protected Composite createSearchComposite(Composite container) {
searchComposite = new Composite(container, SWT.NONE);
GridLayout searchLayout = new GridLayout(2, false);
- searchLayout.marginWidth = 8;
searchLayout.marginHeight = 0;
- searchLayout.marginBottom = 0;
- searchLayout.horizontalSpacing = 0;
- searchLayout.verticalSpacing = 0;
+ searchLayout.marginWidth = 0;
searchComposite.setLayout(searchLayout);
searchComposite.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 4, 1));
@@ -249,7 +246,6 @@ public class TaskListFilteredTree extends AbstractFilteredTree {
}
private void initSearchComposite() {
-
searchHandler.createSearchComposite(searchComposite);
searchHandler.adaptTextSearchControl(getTextSearchControl().getTextControl());
searchHandler.addFilterChangeListener(new IFilterChangeListener() {