Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-03-14 20:52:51 +0000
committerSteffen Pingel2012-03-14 20:55:44 +0000
commitd8adca998b37c37f09c8363713c2edd163fff815 (patch)
tree3733e9075cd189f0954aace9eb34b2b9f40728c9 /org.eclipse.mylyn.tasks.index.ui
parent43a1f32f2ef4bab9623fbf70651fcf36bc138782 (diff)
downloadorg.eclipse.mylyn.tasks-d8adca998b37c37f09c8363713c2edd163fff815.tar.gz
org.eclipse.mylyn.tasks-d8adca998b37c37f09c8363713c2edd163fff815.tar.xz
org.eclipse.mylyn.tasks-d8adca998b37c37f09c8363713c2edd163fff815.zip
REOPENED - bug 373275: show "Content Assist Available" decoration in
task list find box https://bugs.eclipse.org/bugs/show_bug.cgi?id=373275 * fix decoration on Windows * fix tooltip
Diffstat (limited to 'org.eclipse.mylyn.tasks.index.ui')
-rw-r--r--org.eclipse.mylyn.tasks.index.ui/src/org/eclipse/mylyn/internal/tasks/index/ui/IndexSearchHandler.java23
1 files changed, 18 insertions, 5 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 0a2dce97c..59f8da32c 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
@@ -74,16 +74,29 @@ public class IndexSearchHandler extends AbstractSearchHandler {
}
@Override
- public void adaptTextSearchControl(Text textControl) {
+ public void adaptTextSearchControl(final Text textControl) {
+ // make room for content assist decoration
+ if (textControl.getParent().getLayout() instanceof GridLayout) {
+ ((GridLayout) textControl.getParent().getLayout()).marginLeft = 6;
+ }
+
+ // delay execution of to avoid empty key-binding in tooltip: The problem is that the binding service hasn't been
+ // initialized when the decoration is created on startup.
+ textControl.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (!textControl.isDisposed()) {
+ adaptTextSearchControlInternal(textControl);
+ }
+ }
+ });
+ }
+
+ private void adaptTextSearchControlInternal(Text textControl) {
IContentProposalProvider proposalProvider = new ContentProposalProvider(TasksUiPlugin.getTaskList(), reference);
final ContentAssistCommandAdapter adapter = new ContentAssistCommandAdapter(textControl,
new TextContentAdapter(), proposalProvider, null, new char[0], true);
adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
- 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
// traverse listener registered by FilteredTree is skipped while content assist is being used.

Back to the top