Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2010-03-18 10:06:45 -0400
committerAlena Laskavaia2010-03-18 10:06:45 -0400
commit5cc82d793ac09b5ace108d842a52ad4b92a4e918 (patch)
treeee11cbcbc8d855db6043afd9c7aae11f38720c7a /codan/org.eclipse.cdt.codan.ui.cxx
parentd9629c20b03fadfda72f49a0cdd4fc0b48a4314c (diff)
downloadorg.eclipse.cdt-5cc82d793ac09b5ace108d842a52ad4b92a4e918.tar.gz
org.eclipse.cdt-5cc82d793ac09b5ace108d842a52ad4b92a4e918.tar.xz
org.eclipse.cdt-5cc82d793ac09b5ace108d842a52ad4b92a4e918.zip
separate language specific plugins from general
Diffstat (limited to 'codan/org.eclipse.cdt.codan.ui.cxx')
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/.classpath7
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/.project34
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/.settings/org.eclipse.jdt.core.prefs71
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF16
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/build.properties5
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/plugin.xml11
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Activator.java50
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/CodanCReconciler.java72
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java93
9 files changed, 359 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/.classpath b/codan/org.eclipse.cdt.codan.ui.cxx/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/.project b/codan/org.eclipse.cdt.codan.ui.cxx/.project
new file mode 100644
index 0000000000..26bef11106
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.codan.internal.ui.cxx</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.ui.cxx/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..daee5fec67
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,71 @@
+#Thu Mar 18 10:02:38 EDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..ce833547dd
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Codan Analysis UI for C/C++
+Bundle-SymbolicName: org.eclipse.cdt.codan.ui.cxx;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.cdt.codan.internal.ui.cxx.Activator
+Bundle-Vendor: CDT
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.cdt.codan.core;bundle-version="1.0.0",
+ org.eclipse.cdt.codan.core.cxx;bundle-version="1.0.0",
+ org.eclipse.ui.editors;bundle-version="3.6.0",
+ org.eclipse.cdt.core;bundle-version="5.2.0",
+ org.eclipse.cdt.ui;bundle-version="5.2.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/build.properties b/codan/org.eclipse.cdt.codan.ui.cxx/build.properties
new file mode 100644
index 0000000000..e9863e281e
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/plugin.xml b/codan/org.eclipse.cdt.codan.ui.cxx/plugin.xml
new file mode 100644
index 0000000000..ed16e30809
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/plugin.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.eclipse.cdt.codan.internal.ui.cxx.Startup"></startup>
+ </extension>
+
+</plugin>
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Activator.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Activator.java
new file mode 100644
index 0000000000..e046c528e4
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.cdt.codan.internal.ui.cxx;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.cdt.codan.internal.ui.cxx"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/CodanCReconciler.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/CodanCReconciler.java
new file mode 100644
index 0000000000..a94143c273
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/CodanCReconciler.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Alena Laskavaia
+ * 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
+ *
+ * Contributors:
+ * Alena Laskavaia - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.codan.internal.ui.cxx;
+
+import org.eclipse.cdt.codan.core.cxx.internal.model.CxxCodanRenciler;
+import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
+import org.eclipse.cdt.internal.ui.editor.CEditor;
+import org.eclipse.cdt.internal.ui.text.ICReconcilingListener;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * @author Alena
+ *
+ */
+public class CodanCReconciler implements ICReconcilingListener {
+ private CxxCodanRenciler reconsiler = new CxxCodanRenciler();
+
+ void install(ITextEditor editor) {
+ if (editor instanceof CEditor) {
+ initialize();
+ ((CEditor) editor).addReconcileListener(this);
+ }
+ }
+
+ void uninstall(ITextEditor editor) {
+ if (editor instanceof CEditor) {
+ initialize();
+ ((CEditor) editor).removeReconcileListener(this);
+ }
+ }
+
+ /**
+ *
+ */
+ private void initialize() {
+ // nothing?
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.cdt.internal.ui.text.ICReconcilingListener#aboutToBeReconciled
+ * ()
+ */
+ public void aboutToBeReconciled() {
+ // nothing
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.cdt.internal.ui.text.ICReconcilingListener#reconciled(org
+ * .eclipse.cdt.core.dom.ast.IASTTranslationUnit, boolean,
+ * org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void reconciled(IASTTranslationUnit ast, boolean force,
+ IProgressMonitor progressMonitor) {
+ reconsiler.reconciledAst(ast, progressMonitor);
+ // System.err.println("ast reconsiled");
+ }
+}
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
new file mode 100644
index 0000000000..b17fed1bd5
--- /dev/null
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Alena Laskavaia
+ * 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
+ *
+ * Contributors:
+ * Alena Laskavaia - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.codan.internal.ui.cxx;
+
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IStartup;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * @author Alena
+ *
+ */
+public class Startup implements IStartup {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IStartup#earlyStartup()
+ */
+ public void earlyStartup() {
+ registerListeners();
+ }
+
+ /**
+ * Register part listener for editor to install c ast reconcile listener
+ */
+ private void registerListeners() {
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ workbench.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchWindow active = workbench.getActiveWorkbenchWindow();
+ final IWorkbenchPage page = active.getActivePage();
+ IPartListener2 partListener = new IPartListener2() {
+ CodanCReconciler reconsiler = new CodanCReconciler();
+
+ public void partActivated(IWorkbenchPartReference partRef) {
+ }
+
+ public void partDeactivated(IWorkbenchPartReference partRef) {
+ }
+
+ public void partOpened(IWorkbenchPartReference partRef) {
+ IWorkbenchPart editor = partRef.getPart(false);
+ if (editor instanceof ITextEditor) {
+ reconsiler.install((ITextEditor) editor);
+ }
+ }
+
+ public void partHidden(IWorkbenchPartReference partRef) {
+ }
+
+ public void partVisible(IWorkbenchPartReference partRef) {
+ }
+
+ public void partClosed(IWorkbenchPartReference partRef) {
+ IWorkbenchPart part = partRef.getPart(false);
+ if (part instanceof ITextEditor) {
+ reconsiler.uninstall((ITextEditor) part);
+ }
+ }
+
+ public void partBroughtToTop(IWorkbenchPartReference partRef) {
+ }
+
+ public void partInputChanged(IWorkbenchPartReference partRef) {
+ }
+ };
+ page.addPartListener(partListener);
+ // check current open editors
+ IEditorReference[] editorReferences = page
+ .getEditorReferences();
+ for (int i = 0; i < editorReferences.length; i++) {
+ IEditorReference ref = editorReferences[i];
+ partListener.partOpened(ref);
+ }
+ }
+ });
+ }
+}

Back to the top