Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-03-08 15:39:39 -0500
committerspingel2008-03-08 15:39:39 -0500
commitf5db7e10605d2b41a165da20bd38c619909cc6ec (patch)
tree151e8423c114b7f38c61d83cfbaff7e800c75142
parent7c9f6fc9185744f74bd26d4c7fcce1fc30d0964b (diff)
downloadorg.eclipse.mylyn.tasks-f5db7e10605d2b41a165da20bd38c619909cc6ec.tar.gz
org.eclipse.mylyn.tasks-f5db7e10605d2b41a165da20bd38c619909cc6ec.tar.xz
org.eclipse.mylyn.tasks-f5db7e10605d2b41a165da20bd38c619909cc6ec.zip
Version update
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskFormPage.java25
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskTextViewerConfiguration.java68
2 files changed, 1 insertions, 92 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskFormPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskFormPage.java
index af865fd97..9b796cbff 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskFormPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskFormPage.java
@@ -100,8 +100,6 @@ public class TaskFormPage extends FormPage {
private IHandlerActivation handlerActivation;
- private IHandlerActivation handlerCompletion;
-
private void addTextViewer(TextViewer viewer) {
textViewers.add(viewer);
}
@@ -384,12 +382,6 @@ public class TaskFormPage extends FormPage {
createQuickFixActionHandler(commentViewer), new ActiveShellExpression(
commentViewer.getTextWidget().getShell()));
}
- if (handlerCompletion == null) {
- handlerCompletion = handlerService.activateHandler(
- ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, //
- createContentAssistActionHandler(commentViewer), //
- new ActiveShellExpression(commentViewer.getTextWidget().getShell()));
- }
}
private void deactivate() {
@@ -397,10 +389,6 @@ public class TaskFormPage extends FormPage {
handlerService.deactivateHandler(handlerActivation);
handlerActivation = null;
}
- if (handlerCompletion != null) {
- handlerService.deactivateHandler(handlerCompletion);
- handlerCompletion = null;
- }
}
});
@@ -458,19 +446,6 @@ public class TaskFormPage extends FormPage {
return new ActionHandler(quickFixAction);
}
-
- private IHandler createContentAssistActionHandler(final SourceViewer viewer) {
- Action quickFixAction = new Action() {
- public void run() {
- if (viewer.canDoOperation(ISourceViewer.CONTENTASSIST_PROPOSALS)) {
- viewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
- }
- }
- };
- quickFixAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- return new ActionHandler(quickFixAction);
- }
-
@Override
public boolean isDirty() {
return isDirty;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskTextViewerConfiguration.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskTextViewerConfiguration.java
index 343b5b3c7..155bbc7dd 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskTextViewerConfiguration.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskTextViewerConfiguration.java
@@ -8,11 +8,8 @@
package org.eclipse.mylyn.tasks.ui.editors;
-import java.text.MessageFormat;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IAdaptable;
@@ -20,17 +17,8 @@ import org.eclipse.jface.preference.JFacePreferences;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.TextPresentation;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.ContextInformation;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
@@ -45,10 +33,8 @@ import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.rules.SingleLineRule;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.TaskListColorsAndFonts;
import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTextViewer;
-import org.eclipse.mylyn.internal.tasks.ui.views.TaskActivationHistory;
import org.eclipse.mylyn.tasks.core.AbstractTask;
import org.eclipse.mylyn.tasks.core.TaskList;
import org.eclipse.mylyn.tasks.core.TaskRepository;
@@ -60,6 +46,7 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
+
/**
* @author Rob Elves
* @since 2.1
@@ -248,57 +235,4 @@ public class TaskTextViewerConfiguration extends TextSourceViewerConfiguration {
}
- public class TaskCompletionProcessor implements IContentAssistProcessor {
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
- TaskActivationHistory taskHistory = TasksUiPlugin.getTaskListManager().getTaskActivationHistory();
- List<AbstractTask> tasks = new ArrayList<AbstractTask>(taskHistory.getPreviousTasks());
- ICompletionProposal[] result= new ICompletionProposal[tasks.size()];
- int i = 0;
- for (Iterator<AbstractTask> iterator = tasks.iterator(); iterator.hasNext();) {
- AbstractTask abstractTask = iterator.next();
- IContextInformation info= new ContextInformation(abstractTask.getSummary(), MessageFormat.format("<{0}>", new Object[] { abstractTask.getSummary() })); //$NON-NLS-1$
- String aa;
- if (abstractTask instanceof LocalTask) {
- aa = "local: " + abstractTask.getSummary();
- } else {
- aa = "bug #"+ abstractTask.getTaskKey();
- }
- result[i++]= new CompletionProposal(aa, offset, 0, abstractTask.getSummary().length(), null, abstractTask.getSummary(), info, MessageFormat.format("<<{0}<<", new Object[] {abstractTask.getSummary()})); //$NON-NLS-1$
- }
- return result;
- }
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- // ignore
- return null;
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator() {
- // ignore
- return null;
- }
-
- public String getErrorMessage() {
- // ignore
- return null;
- }
-
- }
-
- @Override
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- ContentAssistant assistant= new ContentAssistant();
- assistant.setContentAssistProcessor(new TaskCompletionProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
- return assistant;
- }
-
-
}

Back to the top