*fix
diff --git a/eclipsecon08/org.eclipse.dltk.examples.python.part3/src/org/eclipse/dltk/examples/python/internal/ui/editor/ExamplePythonCompletionProcessor.java b/eclipsecon08/org.eclipse.dltk.examples.python.part3/src/org/eclipse/dltk/examples/python/internal/ui/editor/ExamplePythonCompletionProcessor.java
new file mode 100644
index 0000000..7eb242e
--- /dev/null
+++ b/eclipsecon08/org.eclipse.dltk.examples.python.part3/src/org/eclipse/dltk/examples/python/internal/ui/editor/ExamplePythonCompletionProcessor.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation 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
+ *******************************************************************************/
+package org.eclipse.dltk.examples.python.internal.ui.editor;
+
+import org.eclipse.dltk.examples.internal.python.core.ExamplePythonNature;
+import org.eclipse.dltk.examples.internal.python.core.PythonCorePlugin;
+import org.eclipse.dltk.ui.text.completion.CompletionProposalLabelProvider;
+import org.eclipse.dltk.ui.text.completion.ScriptCompletionProcessor;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * Tcl completion processor
+ */
+public class ExamplePythonCompletionProcessor extends ScriptCompletionProcessor {
+
+ public ExamplePythonCompletionProcessor(IEditorPart editor,
+ ContentAssistant assistant, String partition) {
+ super(editor, assistant, partition);
+ }
+
+ /*
+ * @see org.eclipse.dltk.ui.text.completion.ScriptCompletionProcessor#getNatureId()
+ */
+ protected String getNatureId() {
+ return ExamplePythonNature.PYTHON_NATURE;
+ }
+
+ /*
+ * @see org.eclipse.dltk.ui.text.completion.ScriptCompletionProcessor#getProposalLabelProvider()
+ */
+ protected CompletionProposalLabelProvider getProposalLabelProvider() {
+ return new CompletionProposalLabelProvider();
+ }
+
+ /*
+ * @see org.eclipse.dltk.ui.text.completion.ContentAssistProcessor#getPreferenceStore()
+ */
+ protected IPreferenceStore getPreferenceStore() {
+ return PythonCorePlugin.getDefault().getPreferenceStore();
+ }
+}
diff --git a/eclipsecon08/org.eclipse.dltk.examples.python.part3/src/org/eclipse/dltk/examples/python/internal/ui/editor/ExamplePythonSourceViewerConfiguration.java b/eclipsecon08/org.eclipse.dltk.examples.python.part3/src/org/eclipse/dltk/examples/python/internal/ui/editor/ExamplePythonSourceViewerConfiguration.java
index 090a82e..ad867ca 100644
--- a/eclipsecon08/org.eclipse.dltk.examples.python.part3/src/org/eclipse/dltk/examples/python/internal/ui/editor/ExamplePythonSourceViewerConfiguration.java
+++ b/eclipsecon08/org.eclipse.dltk.examples.python.part3/src/org/eclipse/dltk/examples/python/internal/ui/editor/ExamplePythonSourceViewerConfiguration.java
@@ -13,6 +13,8 @@
import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
import org.eclipse.jface.text.IAutoEditStrategy;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.information.IInformationPresenter;
import org.eclipse.jface.text.presentation.IPresentationReconciler;
import org.eclipse.jface.text.presentation.PresentationReconciler;
@@ -102,4 +104,12 @@
return this.fCodeScanner.affectsBehavior(event)
|| this.fStringScanner.affectsBehavior(event);
}
+
+ protected void alterContentAssistant(ContentAssistant assistant) {
+ // IDocument.DEFAULT_CONTENT_TYPE
+ IContentAssistProcessor scriptProcessor = new ExamplePythonCompletionProcessor(
+ getEditor(), assistant, IDocument.DEFAULT_CONTENT_TYPE);
+ assistant.setContentAssistProcessor(scriptProcessor,
+ IDocument.DEFAULT_CONTENT_TYPE);
+ }
}