diff --git a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/META-INF/MANIFEST.MF b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/META-INF/MANIFEST.MF index 7d5d74a..59d0a4c 100644 --- a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/META-INF/MANIFEST.MF +++ b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/META-INF/MANIFEST.MF @@ -1,23 +1,60 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: JavaCompilerPlugin.Plugin -Bundle-SymbolicName: JavaCompilerPlugin.Plugin;singleton:=true +Bundle-Name: TypinferenzPlugin +Bundle-SymbolicName: TypinferenzPlugin;singleton:=true Bundle-Version: 0.1.0.qualifier Bundle-Vendor: de.dhbwstuttgart -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: ., - bin, - lib -Automatic-Module-Name: JavaCompilerPlugin.Plugin;singleton:=true +Bundle-Activator: typinferenzplugin.Activator Require-Bundle: org.eclipse.ui, + javax.inject, org.eclipse.core.runtime, org.eclipse.jface.text, + org.eclipse.jdt.ui, org.eclipse.ui.editors, org.eclipse.ui.workbench, org.eclipse.core.resources, + org.eclipse.swt, + org.eclipse.osgi, + org.eclipse.jface, + org.eclipse.e4.ui.services, + org.eclipse.e4.ui.workbench, + org.eclipse.e4.ui.di, + org.eclipse.e4.core.di.annotations, + org.eclipse.equinox.p2.core, + org.eclipse.equinox.p2.operations, + org.eclipse.equinox.p2.engine, + org.eclipse.equinox.ds, + org.eclipse.equinox.event, + org.eclipse.equinox.p2.repository;bundle-version="2.3.200", + org.eclipse.equinox.p2.metadata;bundle-version="2.3.100", org.eclipse.ui.ide, org.eclipse.ui.views, - org.eclipse.equinox.ds;visibility:=reexport + org.eclipse.equinox.ds; visibility:=reexport Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Provide-Capability: osgi.ee;osgi.ee="JavaSE";version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9" -Bundle-Activator: typinferenzplugin.Activator +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: ., + lib/animal-sniffer-annotations.jar, + lib/antlr4.jar, + lib/antlr4-runtime.jar, + lib/antlr-runtime.jar, + lib/asm.jar, + lib/bcel.jar, + lib/checker-qual.jar, + lib/commons-io.jar, + lib/error_prone_annotations.jar, + lib/failureaccess.jar, + lib/guava.jar, + lib/icu4j.jar, + lib/j2objc-annotations.jar, + lib/javassist.jar, + lib/JavaTXcompiler.jar, + lib/javax.json.jar, + lib/jsr305.jar, + lib/listenablefuture.jar, + lib/org.abego.treelayout.core.jar, + lib/reflections.jar, + lib/ST4.jar, + bin, + typinferenzplugin +Import-Package: javax.annotation;version="1.2.0" +Automatic-Module-Name: TypinferenzPlugin diff --git a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/plugin.xml b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/plugin.xml index 19c83ed..1b55516 100644 --- a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/plugin.xml +++ b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/plugin.xml @@ -2,7 +2,7 @@ - + - - - - - + + + + + - - + - - + + diff --git a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java index 890222c..a475b53 100644 --- a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java +++ b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java @@ -38,7 +38,7 @@ import typinferenzplugin.error.ErrorOutput; //Example from: http://help.eclipse.org/indigo/index.jsp /** * Editor für .jav-Dateien - * Anmerkung: Für jede geöffnete Datei wird eine Instanz des Editors erstellt + * Anmerkung: Für jede geöffntete Datei wird eine Instanz des Editors erstellt * @author janulrich * */ @@ -115,7 +115,7 @@ public class JavEditor extends TextEditor{ }catch(TypeinferenceException texc){ markers.add(new ErrorMarker(texc.getMessage(),new CodePoint(texc.getOffset()))); } - //Anschließend die TypeReplaceMarker im Quellcode anzeigen: https://stackoverflow.com/questions/8945371/how-to-implement-quick-fix-quick-assist-for-custom-eclipse-editor + //Anschließend die TypeReplaceMarker im Quellcode anzeigen: https://stackoverflow.com/questions/8945371/how-to-implement-quick-fix-quick-assist-for-custom-eclipse-editor System.out.println("Typinferez durchgeführt. Berechnete Marker:\n"+markers); IResource activeDocument = extractResource(); @@ -182,7 +182,7 @@ public class JavEditor extends TextEditor{ } /** - * Löscht die zu marker gehörende Annotation + * Löscht die zu marker gehörende Annotation * @param marker */ private void deleteAnnotation(JavMarker marker){ @@ -211,7 +211,7 @@ public class JavEditor extends TextEditor{ /** - * Diese Funktion führt einen ReplaceMarker aus. + * Diese Funktion führt einen ReplaceMarker aus. * @param typeReplaceMarker */ public void runReplaceMarker(TypeReplaceMarker typeReplaceMarker) { @@ -239,7 +239,7 @@ public class JavEditor extends TextEditor{ /** * Aktualisiert die OutlinePage, falls vorhanden. - * Muss nach Änderungen an markers aufgerufen werden. + * Muss nach Änderungen an markers aufgerufen werden. */ private void updateOutlinePage() { if(this.outlinePage!= null && this.sourceFile != null && this.errorMarkers != null) @@ -255,7 +255,7 @@ public class JavEditor extends TextEditor{ } /** - * Ermittelt die momentan an dem Dokument, für welches dieser Editor zuständig ist, angebrachten TypeReplaceMarker. + * Ermittelt die momentan an dem Dokument, für welches dieser Editor zuständig ist, angebrachten TypeReplaceMarker. * Dabei werden die ReplaceMarker herausgefiltert, welche mindestens einen Typ an dem übergebenen offset einsetzen. * @param offset * @return diff --git a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavViewerConfiguration.java b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavViewerConfiguration.java index 322651c..a3a239d 100644 --- a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavViewerConfiguration.java +++ b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavViewerConfiguration.java @@ -14,6 +14,7 @@ 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.presentation.IPresentationReconciler; @@ -44,8 +45,9 @@ public class JavViewerConfiguration extends SourceViewerConfiguration { private JavEditor editor; - public JavViewerConfiguration(JavEditor parentEditor){ + public JavViewerConfiguration(JavEditor editor){ super(); + this.editor = editor; } @@ -125,6 +127,16 @@ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceVie ret.setInformationControlCreator(getInformationControlCreator(sourceViewer)); return ret; } + + @Override + public IContentAssistant getContentAssistant(ISourceViewer sv) { + ContentAssistant ca = new ContentAssistant(); + IContentAssistProcessor pr = new JafCompletionProcess(); + ca.setContentAssistProcessor(pr, IDocument.DEFAULT_CONTENT_TYPE); + ca.setInformationControlCreator(getInformationControlCreator(sv)); + return ca; + } + } diff --git a/JavaCompilerPlugin/features/JavaCompilerPlugin.Feature/feature.xml b/JavaCompilerPlugin/features/JavaCompilerPlugin.Feature/feature.xml index 3081cfc..d498041 100644 --- a/JavaCompilerPlugin/features/JavaCompilerPlugin.Feature/feature.xml +++ b/JavaCompilerPlugin/features/JavaCompilerPlugin.Feature/feature.xml @@ -17,7 +17,7 @@ + 4.0.0 - de.dhbwstuttgart JavaCompilerPlugin - 0.1.0-SNAPSHOT pom de.dhbwstuttgart diff --git a/JavaCompilerPlugin/releng/JavaCompilerPlugin.Configuration/pom.xml b/JavaCompilerPlugin/releng/JavaCompilerPlugin.Configuration/pom.xml index e0e479d..18dec15 100644 --- a/JavaCompilerPlugin/releng/JavaCompilerPlugin.Configuration/pom.xml +++ b/JavaCompilerPlugin/releng/JavaCompilerPlugin.Configuration/pom.xml @@ -7,8 +7,10 @@ 1.2.0 - UTF-8 http://download.eclipse.org/releases/oxygen + UTF-8 + true + true