diff options
author | cvs2svn | 2009-05-06 14:41:49 +0000 |
---|---|---|
committer | cvs2svn | 2009-05-06 14:41:49 +0000 |
commit | 02fd386cfc27bd7b9dd48f5bcfa8c5797c7a190a (patch) | |
tree | 5b0d54eed1c7d4e2eae65b03d6249eefc5259a46 | |
parent | 1054b43f5b83428fc33a86b66eccdce785adf389 (diff) | |
download | org.eclipse.cdt-200905061052.tar.gz org.eclipse.cdt-200905061052.tar.xz org.eclipse.cdt-200905061052.zip |
This commit was manufactured by cvs2svn to create tag 'v200905061052'.v200905061052
Sprout from master 2009-05-06 14:41:48 UTC Doug Schaefer <doug.schaefer@windriver.com> 'Fixed up project settings for java 1.5.'
Delete:
codan/org.eclipse.cdt.codan.checkers.ui/.classpath
codan/org.eclipse.cdt.codan.checkers.ui/.project
codan/org.eclipse.cdt.codan.checkers.ui/.settings/org.eclipse.jdt.core.prefs
codan/org.eclipse.cdt.codan.checkers.ui/META-INF/MANIFEST.MF
codan/org.eclipse.cdt.codan.checkers.ui/build.properties
codan/org.eclipse.cdt.codan.checkers.ui/plugin.xml
codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CheckersUiActivator.java
codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java
codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixAssignmentInCondition.java
codan/org.eclipse.cdt.codan.checkers/.classpath
codan/org.eclipse.cdt.codan.checkers/.project
codan/org.eclipse.cdt.codan.checkers/.settings/org.eclipse.jdt.core.prefs
codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF
codan/org.eclipse.cdt.codan.checkers/build.properties
codan/org.eclipse.cdt.codan.checkers/plugin.xml
codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java
codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/AssignmentInConditionChecker.java
codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/StatementHasNoEffectChecker.java
codan/org.eclipse.cdt.codan.core/.classpath
codan/org.eclipse.cdt.codan.core/.project
codan/org.eclipse.cdt.codan.core/.settings/org.eclipse.jdt.core.prefs
codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF
codan/org.eclipse.cdt.codan.core/build.properties
codan/org.eclipse.cdt.codan.core/plugin.xml
codan/org.eclipse.cdt.codan.core/schema/checkers.exsd
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/PreferenceConstants.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodanBuilder.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodanPreferencesLoader.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodeAnlysisNature.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CheckersRegisry.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblem.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblemCategory.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblemReporter.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanRuntime.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanSeverity.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICAstChecker.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IChecker.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblem.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemCategory.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemElement.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java
codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfile.java
codan/org.eclipse.cdt.codan.ui/.classpath
codan/org.eclipse.cdt.codan.ui/.project
codan/org.eclipse.cdt.codan.ui/.settings/org.eclipse.jdt.core.prefs
codan/org.eclipse.cdt.codan.ui/META-INF/MANIFEST.MF
codan/org.eclipse.cdt.codan.ui/build.properties
codan/org.eclipse.cdt.codan.ui/plugin.xml
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.properties
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Activator.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanCReconciler.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Startup.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/RunCodeAnalysis.java
codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/ToggleNatureAction.java
p2/org.eclipse.cdt.p2.generator/.classpath
p2/org.eclipse.cdt.p2.generator/.project
p2/org.eclipse.cdt.p2.generator/.settings/org.eclipse.jdt.core.prefs
p2/org.eclipse.cdt.p2.generator/META-INF/MANIFEST.MF
p2/org.eclipse.cdt.p2.generator/about.html
p2/org.eclipse.cdt.p2.generator/build.properties
p2/org.eclipse.cdt.p2.generator/plugin.xml
p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/Activator.java
p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/MinGWGenerator.java
windows/org.eclipse.cdt.msw.build/.classpath
windows/org.eclipse.cdt.msw.build/.cvsignore
windows/org.eclipse.cdt.msw.build/.project
windows/org.eclipse.cdt.msw.build/.settings/org.eclipse.jdt.core.prefs
windows/org.eclipse.cdt.msw.build/META-INF/MANIFEST.MF
windows/org.eclipse.cdt.msw.build/build.properties
windows/org.eclipse.cdt.msw.build/plugin.properties
windows/org.eclipse.cdt.msw.build/plugin.xml
windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/Activator.java
windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java
windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java
windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinScannerInfoCollector.java
85 files changed, 0 insertions, 5798 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/.classpath b/codan/org.eclipse.cdt.codan.checkers.ui/.classpath deleted file mode 100644 index 1fa3e6803d3..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <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.checkers.ui/.project b/codan/org.eclipse.cdt.codan.checkers.ui/.project deleted file mode 100644 index 4c298688616..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.cdt.codan.checkers.ui</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> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.checkers.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 5edb6f2ff88..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Fri Apr 17 21:55:42 EDT 2009 -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.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.checkers.ui/META-INF/MANIFEST.MF deleted file mode 100644 index faffd30dfcf..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Checkers Ui -Bundle-SymbolicName: org.eclipse.cdt.codan.checkers.ui;singleton:=true -Bundle-Version: 1.0.0 -Bundle-Activator: org.eclipse.cdt.codan.checkers.ui.CheckersUiActivator -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.ui.ide;bundle-version="3.5.0", - org.eclipse.jface.text;bundle-version="3.5.0", - org.eclipse.ui.editors;bundle-version="3.5.0", - org.eclipse.core.resources;bundle-version="3.5.0", - org.eclipse.cdt.codan.checkers;bundle-version="1.0.0" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/build.properties b/codan/org.eclipse.cdt.codan.checkers.ui/build.properties deleted file mode 100644 index 34d2e4d2dad..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/plugin.xml b/codan/org.eclipse.cdt.codan.checkers.ui/plugin.xml deleted file mode 100644 index 783ff1d88d6..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui/plugin.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - <extension - point="org.eclipse.ui.ide.markerResolution"> - <markerResolutionGenerator - class="org.eclipse.cdt.codan.checkers.ui.quickfix.CodanProblemMarkerResolutionGenerator" - markerType="org.eclipse.cdt.codan.core.codanProblem"> - </markerResolutionGenerator> - </extension> -</plugin> diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CheckersUiActivator.java b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CheckersUiActivator.java deleted file mode 100644 index 16356844b98..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CheckersUiActivator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.cdt.codan.checkers.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class CheckersUiActivator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.cdt.codan.checkers.ui"; - - // The shared instance - private static CheckersUiActivator plugin; - - /** - * The constructor - */ - public CheckersUiActivator() { - } - - /* - * (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 CheckersUiActivator getDefault() { - return plugin; - } - -} diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java deleted file mode 100644 index 1470e7fb0e5..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Andrew Gvozdev - * 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: - * Andrew Gvozdev - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.codan.checkers.ui.quickfix; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.ui.IMarkerResolution; -import org.eclipse.ui.IMarkerResolutionGenerator; - -public class CodanProblemMarkerResolutionGenerator implements IMarkerResolutionGenerator { - public IMarkerResolution[] getResolutions(IMarker marker) { - final Pattern patternBuildDependsAdd = Pattern.compile("Possible assignment in condition.*"); - String description = marker.getAttribute(IMarker.MESSAGE, "no message"); - Matcher matcherBuildDependsAdd = patternBuildDependsAdd.matcher(description); - if (matcherBuildDependsAdd.matches()) { - return new IMarkerResolution[] { new QuickFixAssignmentInCondition() }; - } - return new IMarkerResolution[0]; - } -}
\ No newline at end of file diff --git a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixAssignmentInCondition.java b/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixAssignmentInCondition.java deleted file mode 100644 index 5c28d53ca01..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixAssignmentInCondition.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Andrew Gvozdev - * 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: - * Andrew Gvozdev - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.codan.checkers.ui.quickfix; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.FindReplaceDocumentAdapter; -import org.eclipse.jface.text.IDocument; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IMarkerResolution; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.texteditor.ITextEditor; - -public class QuickFixAssignmentInCondition implements IMarkerResolution { - public String getLabel() { - return "Change to '=='"; - } - - public void run(IMarker marker) { - // See if there is an open editor on the file containing the marker - IWorkbenchWindow w = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow(); - if (w == null) { - return; - } - IWorkbenchPage page = w.getActivePage(); - if (page == null) { - return; - } - IFileEditorInput input = new FileEditorInput((IFile) marker - .getResource()); - IEditorPart editorPart = page.findEditor(input); - if (editorPart == null) { - // open an editor - try { - editorPart = IDE.openEditor(page, (IFile) marker.getResource(), - true); - } catch (PartInitException e) { - e.printStackTrace(); - } - } - if (editorPart == null) { - return; - } - if (editorPart instanceof ITextEditor) { - ITextEditor editor = (ITextEditor) editorPart; - IDocument doc = editor.getDocumentProvider().getDocument( - editor.getEditorInput()); - int line = marker.getAttribute(IMarker.LINE_NUMBER, -1) - 1; - FindReplaceDocumentAdapter dad = new FindReplaceDocumentAdapter(doc); - try { - dad.find(doc.getLineOffset(line), "=", /* forwardSearch */ - true, /* caseSensitive */false, - /* wholeWord */false, /* regExSearch */false); - dad.replace("==", /* regExReplace */false); - marker.delete(); - } catch (BadLocationException e) { - // TODO: log the error - e.printStackTrace(); - } catch (CoreException e) { - // TODO: log the error - e.printStackTrace(); - } - } - } -} diff --git a/codan/org.eclipse.cdt.codan.checkers/.classpath b/codan/org.eclipse.cdt.codan.checkers/.classpath deleted file mode 100644 index 1fa3e6803d3..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <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.checkers/.project b/codan/org.eclipse.cdt.codan.checkers/.project deleted file mode 100644 index 6b76138faa3..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.cdt.codan.checkers</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> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/codan/org.eclipse.cdt.codan.checkers/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.checkers/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 4e9c2546d9a..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Sun Apr 05 18:00:01 EDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF deleted file mode 100644 index 50e70f6890b..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF +++ /dev/null @@ -1,12 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Checkers -Bundle-SymbolicName: org.eclipse.cdt.codan.checkers;singleton:=true -Bundle-Version: 1.0.0 -Bundle-Activator: org.eclipse.cdt.codan.checkers.Activator -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources;bundle-version="3.5.0", - org.eclipse.cdt.core;bundle-version="5.1.0", - org.eclipse.cdt.codan.core;bundle-version="1.0.0" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/codan/org.eclipse.cdt.codan.checkers/build.properties b/codan/org.eclipse.cdt.codan.checkers/build.properties deleted file mode 100644 index e9863e281ea..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml diff --git a/codan/org.eclipse.cdt.codan.checkers/plugin.xml b/codan/org.eclipse.cdt.codan.checkers/plugin.xml deleted file mode 100644 index e526112453b..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers/plugin.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - <extension - point="org.eclipse.cdt.codan.core.checkers" - id="org.eclipse.cdt.codan.core.checkers.sample"> - - <checker - class="org.eclipse.cdt.codan.checkers.sample.AssignmentInConditionChecker" - id="org.eclipse.cdt.codan.checkers.sample.AssignmentInConditionChecker" - name="Assignment in condition"> - <problem - defaultSeverity="Warning" - id="org.eclipse.cdt.codan.checkers.sample.AssignmentInConditionProblem" - name="Assignment in condition"> - </problem> - - - </checker> - <checker - class="org.eclipse.cdt.codan.checkers.sample.StatementHasNoEffectChecker" - id="org.eclipse.cdt.codan.checkers.sample.StatementHasNoEffectChecker" - name="StatementHasNoEffectChecker"> - <problem - category="org.eclipse.cdt.codan.core.categories.ProgrammingProblems" - defaultSeverity="Warning" - id="org.eclipse.cdt.codan.checkers.sample.StatementHasNoEffectProblem" - name="Statement has no effect"> - </problem> - </checker> - </extension> -</plugin> diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java deleted file mode 100644 index bc60feb72fd..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.cdt.codan.checkers; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.cdt.codan.checkers"; - // 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.checkers/src/org/eclipse/cdt/codan/checkers/sample/AssignmentInConditionChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/AssignmentInConditionChecker.java deleted file mode 100644 index 7452f01a098..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/AssignmentInConditionChecker.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * 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.checkers.sample; - -import org.eclipse.cdt.codan.core.model.AbstractIndexAstChecker; -import org.eclipse.cdt.core.dom.ast.ASTNodeProperty; -import org.eclipse.cdt.core.dom.ast.ASTVisitor; -import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression; -import org.eclipse.cdt.core.dom.ast.IASTExpression; -import org.eclipse.cdt.core.dom.ast.IASTForStatement; -import org.eclipse.cdt.core.dom.ast.IASTIfStatement; -import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; - -public class AssignmentInConditionChecker extends AbstractIndexAstChecker { - private static final String ER_ID = "org.eclipse.cdt.codan.checkers.sample.AssignmentInConditionProblem"; - - @Override - public void processAst(IASTTranslationUnit ast) { - // traverse the ast using the visitor pattern. - ast.accept(new CheckCodeVisitor()); - } - - class CheckCodeVisitor extends ASTVisitor { - CheckCodeVisitor() { - shouldVisitExpressions = true; - } - - public int visit(IASTExpression expression) { - if (isAssignmentExpression(expression) - && isUsedAsCondition(expression)) { - reportProblem(ER_ID, getFile(), expression.getFileLocation() - .getStartingLineNumber(), - "Possible assignment in condition"); - } - return PROCESS_CONTINUE; - } - - private boolean isAssignmentExpression(IASTExpression e) { - if (e instanceof IASTBinaryExpression) { - IASTBinaryExpression binExpr = (IASTBinaryExpression) e; - return binExpr.getOperator() == IASTBinaryExpression.op_assign; - } - return false; - } - - private boolean isUsedAsCondition(IASTExpression expression) { - ASTNodeProperty prop = expression.getPropertyInParent(); - if (prop == IASTForStatement.CONDITION - || prop == IASTIfStatement.CONDITION) - return true; - return false; - } - } -} diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/StatementHasNoEffectChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/StatementHasNoEffectChecker.java deleted file mode 100644 index e961646a02e..00000000000 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/StatementHasNoEffectChecker.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * 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.checkers.sample; - -import org.eclipse.cdt.codan.core.model.AbstractIndexAstChecker; -import org.eclipse.cdt.core.dom.ast.ASTVisitor; -import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression; -import org.eclipse.cdt.core.dom.ast.IASTExpression; -import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement; -import org.eclipse.cdt.core.dom.ast.IASTIdExpression; -import org.eclipse.cdt.core.dom.ast.IASTStatement; -import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; -import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression; -import org.eclipse.cdt.core.dom.ast.IBasicType; -import org.eclipse.cdt.core.dom.ast.IType; -import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction; -import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression; - -/** - * Checker that detects statements without effect such as - * - * a+b; - * - * or - * - * +b; - * - * - */ -public class StatementHasNoEffectChecker extends AbstractIndexAstChecker { - private static final String ER_ID = "org.eclipse.cdt.codan.checkers.sample.StatementHasNoEffectProblem"; - - @Override - public void processAst(IASTTranslationUnit ast) { - // traverse the ast using the visitor pattern. - ast.accept(new CheckStmpVisitor()); - } - - class CheckStmpVisitor extends ASTVisitor { - CheckStmpVisitor() { - shouldVisitStatements = true; - } - - public int visit(IASTStatement stmt) { - if (stmt instanceof IASTExpressionStatement) { - if (hasNoEffect(((IASTExpressionStatement) stmt) - .getExpression())) { - reportProblem(ER_ID, getFile(), stmt.getFileLocation() - .getStartingLineNumber(), "Statement has no effect"); - } - return PROCESS_SKIP; - } - return PROCESS_CONTINUE; - } - - /** - * We consider has not effect binary statements without assignment and - * unary statement which is not dec and inc. If operator is overloaded - * we not going to bother. - * - * @param e - * @return - */ - private boolean hasNoEffect(IASTExpression e) { - if (e instanceof IASTBinaryExpression) { - IASTBinaryExpression binExpr = (IASTBinaryExpression) e; - if (binExpr.getOperator() == IASTBinaryExpression.op_assign) - return false; - if (binExpr instanceof CPPASTBinaryExpression) { - // unfortunately ICPPASTBinaryExpression does not have - // getOverload public method - CPPASTBinaryExpression cppBin = (CPPASTBinaryExpression) binExpr; - ICPPFunction overload = cppBin.getOverload(); - if (overload != null) - return false; - IType expressionType = binExpr.getOperand1() - .getExpressionType(); - if (!(expressionType instanceof IBasicType)) { - return false; // must be overloaded but parser could not - // find it - } - } - return true; - } - if (e instanceof IASTUnaryExpression) { - IASTUnaryExpression unaryExpr = (IASTUnaryExpression) e; - int operator = unaryExpr.getOperator(); - switch (operator) { - case IASTUnaryExpression.op_postFixDecr: - case IASTUnaryExpression.op_prefixDecr: - case IASTUnaryExpression.op_postFixIncr: - case IASTUnaryExpression.op_prefixIncr: - return false; - } - return true; - } - if (e instanceof IASTIdExpression) { - // simply a; - return true; - } - return false; - } - } -} diff --git a/codan/org.eclipse.cdt.codan.core/.classpath b/codan/org.eclipse.cdt.codan.core/.classpath deleted file mode 100644 index 16d067f284a..00000000000 --- a/codan/org.eclipse.cdt.codan.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/codan/org.eclipse.cdt.codan.core/.project b/codan/org.eclipse.cdt.codan.core/.project deleted file mode 100644 index 8ba33e61574..00000000000 --- a/codan/org.eclipse.cdt.codan.core/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.cdt.codan.core</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> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/codan/org.eclipse.cdt.codan.core/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 1c23d3d40c6..00000000000 --- a/codan/org.eclipse.cdt.codan.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Tue Apr 07 21:22:12 EDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF deleted file mode 100644 index c3306a40f90..00000000000 --- a/codan/org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Code Analisys Core -Bundle-SymbolicName: org.eclipse.cdt.codan.core;singleton:=true -Bundle-Version: 1.0.0 -Bundle-Activator: org.eclipse.cdt.codan.core.CodanCorePlugin -Bundle-Vendor: CDT -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.cdt.core -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.cdt.codan.core, - org.eclipse.cdt.codan.core.builder, - org.eclipse.cdt.codan.core.model diff --git a/codan/org.eclipse.cdt.codan.core/build.properties b/codan/org.eclipse.cdt.codan.core/build.properties deleted file mode 100644 index 3595411e85a..00000000000 --- a/codan/org.eclipse.cdt.codan.core/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - schema/ diff --git a/codan/org.eclipse.cdt.codan.core/plugin.xml b/codan/org.eclipse.cdt.codan.core/plugin.xml deleted file mode 100644 index 19f1fba88e8..00000000000 --- a/codan/org.eclipse.cdt.codan.core/plugin.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - <extension-point id="checkers" name="Code Analysis Checkers" schema="schema/checkers.exsd"/> - - <extension - id="codanBuilder" - name="Code Analysis Project Builder" - point="org.eclipse.core.resources.builders"> - <builder - hasNature="true"> - <run - class="org.eclipse.cdt.codan.core.builder.CodanBuilder"> - </run> - </builder> - </extension> - <extension - id="codanNature" - name="CDT Code Analysis Nature" - point="org.eclipse.core.resources.natures"> - <runtime> - <run - class="org.eclipse.cdt.codan.core.builder.CodeAnlysisNature"> - </run> - </runtime> - <builder - id="org.eclipse.cdt.codan.core.codanBuilder"> - </builder> - </extension> - <extension - id="codanProblem" - name="Code Analisys Problem" - point="org.eclipse.core.resources.markers"> - <super - type="org.eclipse.core.resources.problemmarker"> - </super> - <persistent - value="true"> - </persistent> - </extension> - <extension - point="org.eclipse.core.runtime.preferences"> - </extension> - - <extension - point="org.eclipse.cdt.codan.core.checkers" - id="org.eclipse.cdt.codan.core.categories"> - - <category - id="org.eclipse.cdt.codan.core.categories.ProgrammingProblems" - name="Potential programming problems" - > - - </category> - </extension> - -</plugin> diff --git a/codan/org.eclipse.cdt.codan.core/schema/checkers.exsd b/codan/org.eclipse.cdt.codan.core/schema/checkers.exsd deleted file mode 100644 index 71808a5bfa0..00000000000 --- a/codan/org.eclipse.cdt.codan.core/schema/checkers.exsd +++ /dev/null @@ -1,246 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.cdt.codan.ui" xmlns="http://www.w3.org/2001/XMLSchema"> -<annotation> - <appinfo> - <meta.schema plugin="org.eclipse.cdt.codan.ui" id="checkers" name="Code Analysis Checkers"/> - </appinfo> - <documentation> - Define chckers for Code Analysis framework. - </documentation> - </annotation> - - <element name="extension"> - <annotation> - <appinfo> - <meta.element /> - </appinfo> - </annotation> - <complexType> - <sequence minOccurs="1" maxOccurs="unbounded"> - <choice> - <element ref="checker"/> - <element ref="category"/> - </choice> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - - </documentation> - <appinfo> - <meta.attribute translatable="true"/> - </appinfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="checker"> - <annotation> - <documentation> - Checker Element. Sets id, name and class that implements checker - </documentation> - </annotation> - <complexType> - <sequence minOccurs="0" maxOccurs="unbounded"> - <choice> - <element ref="problem"/> - </choice> - </sequence> - <attribute name="id" type="string" use="required"> - <annotation> - <documentation> - Checker id. - </documentation> - </annotation> - </attribute> - <attribute name="class" type="string" use="required"> - <annotation> - <documentation> - Checker class. Must implement IChecker. - </documentation> - <appinfo> - <meta.attribute kind="java" basedOn=":org.eclipse.cdt.codan.core.model.IChecker"/> - </appinfo> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - User Friendly name of the chcker or error. Would be display to enable/disable an error. - </documentation> - <appinfo> - <meta.attribute translatable="true"/> - </appinfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="problem"> - <annotation> - <documentation> - Problem description (Error, Warning, Info produced by a checker) - </documentation> - </annotation> - <complexType> - <attribute name="id" type="string" use="required"> - <annotation> - <documentation> - Error id. Should be prefixed by plugin name in general. - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - User Friendly name of the error. Would be display to enable/disable an error. - </documentation> - <appinfo> - <meta.attribute translatable="true"/> - </appinfo> - </annotation> - </attribute> - <attribute name="defaultSeverity" use="default" value="Warning"> - <annotation> - <documentation> - - </documentation> - </annotation> - <simpleType> - <restriction base="string"> - <enumeration value="Error"> - </enumeration> - <enumeration value="Warning"> - </enumeration> - <enumeration value="Info"> - </enumeration> - </restriction> - </simpleType> - </attribute> - <attribute name="category" type="string"> - <annotation> - <documentation> - - </documentation> - <appinfo> - <meta.attribute kind="identifier" basedOn="org.eclipse.cdt.codan.core.checkers/category/@id"/> - </appinfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="category"> - <complexType> - <attribute name="id" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - <appinfo> - <meta.attribute translatable="true"/> - </appinfo> - </annotation> - </attribute> - <attribute name="parentCategory" type="string"> - <annotation> - <documentation> - - </documentation> - <appinfo> - <meta.attribute kind="identifier" basedOn="org.eclipse.cdt.codan.core.checkers/category/@id"/> - </appinfo> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appinfo> - <meta.section type="since"/> - </appinfo> - <documentation> - 1.0 - </documentation> - </annotation> - - <annotation> - <appinfo> - <meta.section type="examples"/> - </appinfo> - <documentation> - The following is an example of a single checker definition: -<p> -<pre> - <extension - point="org.eclipse.cdt.codan.ui.checkers"> - <checker - class="org.aaa.AssignmentInConditionChecker" - id="org.aaa.AssignmentInConditionChecker" - name="Possible Assignment in Condition instead of comparision"> - </checker> - </extension> -</pre> -</p> -The following is an example of a checker that produces two types of errors: -<p> -<pre> - <extension - point="org.eclipse.cdt.codan.ui.checkers"> - - <checker - class="org.aaa.NullPointerDereferenceChecker" - id="org.aaa.NullPointerDereferenceChecker" - name="Null Pointer Dereference checker"> - <problem id="org.aaa.npe_must" name="Null Pointer Dereference"/ defaultSeverity="Error"> - <problem id="org.aaa.npe_may" name="Possible Null Pointer Dereference"/> - </checker> - </extension> -</pre> -</p> - </documentation> - </annotation> - - <annotation> - <appinfo> - <meta.section type="apiinfo"/> - </appinfo> - <documentation> - [Enter API information here.] - </documentation> - </annotation> - - <annotation> - <appinfo> - <meta.section type="implementation"/> - </appinfo> - <documentation> - [Enter information about supplied implementation of this extension point.] - </documentation> - </annotation> - - -</schema> diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java deleted file mode 100644 index 00b554abd86..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.eclipse.cdt.codan.core; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class CodanCorePlugin extends Plugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.cdt.codan.core"; - // The shared instance - private static CodanCorePlugin plugin; - - /** - * The constructor - */ - public CodanCorePlugin() { - } - - public IEclipsePreferences getStorePreferences() { - return new InstanceScope().getNode(PLUGIN_ID); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.core.runtime.Plugin#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 CodanCorePlugin getDefault() { - return plugin; - } - - /** - * Logs the specified status with this plug-in's log. - * - * @param status - * status to log - */ - public static void log(IStatus status) { - getDefault().getLog().log(status); - } - - /** - * Logs an internal error with the specified throwable - * - * @param e - * the exception to be logged - */ - public static void log(Throwable e) { - log(new Status(IStatus.ERROR, PLUGIN_ID, 1, "Internal Error", e)); //$NON-NLS-1$ - } - - /** - * Logs an internal error with the specified message. - * - * @param message - * the error message to log - */ - public static void log(String message) { - log(new Status(IStatus.ERROR, PLUGIN_ID, 1, message, null)); - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/PreferenceConstants.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/PreferenceConstants.java deleted file mode 100644 index a4a13741a67..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/PreferenceConstants.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * 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.core; - -/** - * Constant definitions for plug-in preferences - */ -public class PreferenceConstants { - public static final String P_RUN_ON_BUILD = "booleanPreference"; - public static final String P_PROBLEMS = "problems"; - public static final String P_USE_PARENT = "useParentScope"; -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodanBuilder.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodanBuilder.java deleted file mode 100644 index 683c7b02dda..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodanBuilder.java +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * 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.core.builder; - -import java.io.File; -import java.net.URI; -import java.util.Map; - -import org.eclipse.cdt.codan.core.CodanCorePlugin; -import org.eclipse.cdt.codan.core.model.CheckersRegisry; -import org.eclipse.cdt.codan.core.model.CodanRuntime; -import org.eclipse.cdt.codan.core.model.ICAstChecker; -import org.eclipse.cdt.codan.core.model.IChecker; -import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -public class CodanBuilder extends IncrementalProjectBuilder { - public static final String BUILDER_ID = "org.eclipse.cdt.codan.core.codanBuilder"; - - public class CodanDeltaVisitor implements IResourceDeltaVisitor { - /* - * (non-Javadoc) - * - * @see - * org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse - * .core.resources.IResourceDelta) - */ - public boolean visit(IResourceDelta delta) throws CoreException { - IResource resource = delta.getResource(); - switch (delta.getKind()) { - case IResourceDelta.ADDED: - // handle added resource - processResource(resource); - break; - case IResourceDelta.REMOVED: - // handle removed resource - break; - case IResourceDelta.CHANGED: - // handle changed resource - processResource(resource); - break; - } - // return true to continue visiting children. - return true; - } - } - - public class CodanResourceVisitor implements IResourceVisitor { - public boolean visit(IResource resource) { - processResource(resource); - // return true to continue visiting children. - return true; - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.internal.events.InternalBuilder#build(int, - * java.util.Map, org.eclipse.core.runtime.IProgressMonitor) - */ - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) - throws CoreException { - if (kind == FULL_BUILD) { - fullBuild(monitor); - } else { - IResourceDelta delta = getDelta(getProject()); - if (delta == null) { - fullBuild(monitor); - } else { - incrementalBuild(delta, monitor); - } - } - return null; - } - - public void processResource(IResource resource) { - // String string = Platform.getPreferencesService().getString( - // CodanCorePlugin.PLUGIN_ID, "problems", "", null); - // System.err.println("set = " + string); - // delete general markers - CodanRuntime.getInstance().getProblemReporter().deleteMarkers(resource); - for (IChecker checker : CheckersRegisry.getInstance()) { - try { - boolean run = false; - if (checker.enabledInContext(resource)) - run = true; - if (run) - checker.processResource(resource); - } catch (Throwable e) { - CodanCorePlugin.log(e); - } - } - } - - public void reconcileAst(IASTTranslationUnit ast, IProgressMonitor monitor) { - String filePath = ast.getFilePath(); - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IWorkspaceRoot root = workspace.getRoot(); - IFile[] resources; - URI uri = new File(filePath).toURI(); - resources = root.findFilesForLocationURI(uri); - if (resources != null && resources.length > 0) { - IFile resource = resources[0]; - CodanRuntime.getInstance().getProblemReporter().deleteMarkers( - resource); - for (IChecker checker : CheckersRegisry.getInstance()) { - try { - boolean run = false; - if (checker.enabledInContext(resource)) - run = true; - if (run && checker instanceof ICAstChecker) - ((ICAstChecker) checker).processAst(ast); - } catch (Throwable e) { - CodanCorePlugin.log(e); - } - } - } - } - - protected void fullBuild(final IProgressMonitor monitor) - throws CoreException { - try { - getProject().accept(new CodanResourceVisitor()); - } catch (CoreException e) { - } - } - - protected void incrementalBuild(IResourceDelta delta, - IProgressMonitor monitor) throws CoreException { - // the visitor does the work. - delta.accept(new CodanDeltaVisitor()); - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodanPreferencesLoader.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodanPreferencesLoader.java deleted file mode 100644 index bf17ba3b362..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodanPreferencesLoader.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * 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.core.builder; - -import org.eclipse.cdt.codan.core.model.CodanProblem; -import org.eclipse.cdt.codan.core.model.CodanSeverity; -import org.eclipse.cdt.codan.core.model.IProblem; -import org.eclipse.cdt.codan.core.model.IProblemProfile; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; - -/** - * @author Alena - * - */ -public class CodanPreferencesLoader { - private IProblemProfile baseModel; - - /** - * @param workspaceProfile - */ - public CodanPreferencesLoader(IProblemProfile profile) { - setInput(profile); - } - - /** - * - */ - public CodanPreferencesLoader() { - } - - public void setInput(Object model) { - baseModel = (IProblemProfile) model; - } - - /** - * @return - */ - public IProblem[] getProblems() { - IProblem[] problems = baseModel.getProblems(); - return problems; - } - - /** - * @param id - * @param s - */ - public void setProperty(String id, String s) { - IProblem prob = baseModel.findProblem(id); - if (!(prob instanceof CodanProblem)) - return; - String sevs = s; - boolean enabled = true; - if (sevs.startsWith("-")) { - sevs = sevs.substring(1); - enabled = false; - } - ((CodanProblem) prob).setEnabled(enabled); - CodanSeverity sev; - try { - sev = CodanSeverity.valueOf(sevs); - } catch (RuntimeException e) { - sev = CodanSeverity.Warning; - } - ((CodanProblem) prob).setSeverity(sev); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return getInput().toString(); - } - - /** - * @return - */ - public IProblemProfile getInput() { - return baseModel; - } - - /** - * @param id - * @return - */ - public String getProperty(String id) { - IProblem prob = baseModel.findProblem(id); - if (!(prob instanceof CodanProblem)) - return null; - String enabled = prob.isEnabled() ? "" : "-"; - String severity = prob.getSeverity().toString(); - String res = enabled + severity; - return res; - } - - /** - * @param storePreferences - */ - public void load(IEclipsePreferences storePreferences) { - IProblem[] probs = getProblems(); - for (int i = 0; i < probs.length; i++) { - String id = probs[i].getId(); - String s = storePreferences.get(id, null); - if (s != null) { - setProperty(id, s); - } - } - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodeAnlysisNature.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodeAnlysisNature.java deleted file mode 100644 index 4f06e716c36..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/builder/CodeAnlysisNature.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * 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.core.builder; - -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.runtime.CoreException; - -public class CodeAnlysisNature implements IProjectNature { - /** - * ID of this project nature - */ - public static final String NATURE_ID = "org.eclipse.cdt.codan.core.codanNature"; - private IProject project; - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.resources.IProjectNature#configure() - */ - public void configure() throws CoreException { - IProjectDescription desc = project.getDescription(); - ICommand[] commands = desc.getBuildSpec(); - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(CodanBuilder.BUILDER_ID)) { - return; - } - } - ICommand[] newCommands = new ICommand[commands.length + 1]; - System.arraycopy(commands, 0, newCommands, 0, commands.length); - ICommand command = desc.newCommand(); - command.setBuilderName(CodanBuilder.BUILDER_ID); - newCommands[newCommands.length - 1] = command; - desc.setBuildSpec(newCommands); - project.setDescription(desc, null); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.resources.IProjectNature#deconfigure() - */ - public void deconfigure() throws CoreException { - IProjectDescription description = getProject().getDescription(); - ICommand[] commands = description.getBuildSpec(); - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(CodanBuilder.BUILDER_ID)) { - ICommand[] newCommands = new ICommand[commands.length - 1]; - System.arraycopy(commands, 0, newCommands, 0, i); - System.arraycopy(commands, i + 1, newCommands, i, - commands.length - i - 1); - description.setBuildSpec(newCommands); - project.setDescription(description, null); - return; - } - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.resources.IProjectNature#getProject() - */ - public IProject getProject() { - return project; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core - * .resources.IProject) - */ - public void setProject(IProject project) { - this.project = project; - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java deleted file mode 100644 index e0aa16437a7..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; - -public abstract class AbstractChecker implements IChecker { - String name; - - public AbstractChecker() { - } - - public boolean enabledInContext(IResource res) { - return true; - } - - public void reportProblem(String id, IFile file, int lineNumber, - String message) { - CodanRuntime.getInstance().getProblemReporter().reportProblem(id, file, - lineNumber, message); - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java deleted file mode 100644 index 070ddca7941..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -import org.eclipse.cdt.codan.core.CodanCorePlugin; -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; -import org.eclipse.cdt.core.index.IIndex; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; - -/** - * @author Alena - * - */ -public abstract class AbstractIndexAstChecker extends AbstractChecker implements - ICAstChecker { - private IFile file; - - public IFile getFile() { - return file; - } - - void processFile(IFile file) throws CoreException, InterruptedException { - this.file = file; - // create translation unit and access index - ICElement model = CoreModel.getDefault().create(file); - if (!(model instanceof ITranslationUnit)) - return; - ITranslationUnit tu = (ITranslationUnit) model; - if (tu == null) - return; // not a C/C++ file - IIndex index = CCorePlugin.getIndexManager().getIndex(tu.getCProject()); - // lock the index for read access - index.acquireReadLock(); - try { - // create index based ast - IASTTranslationUnit ast = tu.getAST(index, - ITranslationUnit.AST_SKIP_INDEXED_HEADERS); - // traverse the ast using the visitor pattern. - processAst(ast); - } finally { - index.releaseReadLock(); - } - } - - public boolean processResource(IResource resource) { - if (resource instanceof IFile) { - IFile file = (IFile) resource; - try { - processFile(file); - } catch (CoreException e) { - CodanCorePlugin.log(e); - } catch (InterruptedException e) { - // ignore - } - return false; - } - return true; - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CheckersRegisry.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CheckersRegisry.java deleted file mode 100644 index e2370c9d86c..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CheckersRegisry.java +++ /dev/null @@ -1,298 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -import org.eclipse.cdt.codan.core.CodanCorePlugin; -import org.eclipse.cdt.codan.core.PreferenceConstants; -import org.eclipse.cdt.codan.core.builder.CodanPreferencesLoader; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ProjectScope; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; - -public class CheckersRegisry implements Iterable<IChecker> { - private static final String EXTENSION_POINT_NAME = "checkers"; - private static final String CHECKER_ELEMENT = "checker"; - private static final String PROBLEM_ELEMENT = "problem"; - private static final String CATEGORY_ELEMENT = "category"; - private static final Object DEFAULT = "DEFAULT"; - private Collection<IChecker> checkers = new ArrayList<IChecker>(); - private static CheckersRegisry instance; - private HashMap<Object, IProblemProfile> profiles = new HashMap<Object, IProblemProfile>(); - - private CheckersRegisry() { - instance = this; - profiles.put(DEFAULT, new ProblemProfile()); - readCheckersRegistry(); - } - - private void readCheckersRegistry() { - IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint( - CodanCorePlugin.PLUGIN_ID, EXTENSION_POINT_NAME); - if (ep == null) - return; - IConfigurationElement[] elements = ep.getConfigurationElements(); - // process categories - for (int i = 0; i < elements.length; i++) { - IConfigurationElement configurationElement = elements[i]; - processCategories(configurationElement); - } - // process shared problems - for (int i = 0; i < elements.length; i++) { - IConfigurationElement configurationElement = elements[i]; - processProblem(configurationElement); - } - // process checkers - for (int i = 0; i < elements.length; i++) { - IConfigurationElement configurationElement = elements[i]; - processChecker(configurationElement); - } - } - - /** - * @param configurationElement - */ - private void processCategories(IConfigurationElement configurationElement) { - if (configurationElement.getName().equals(CATEGORY_ELEMENT)) { - String id = getAtt(configurationElement, "id"); - if (id == null) - return; - String name = getAtt(configurationElement, "name"); - if (name == null) - return; - CodanProblemCategory cat = new CodanProblemCategory(id, name); - String category = getAtt(configurationElement, "parentCategory", - false); - addCategory(cat, category); - } - } - - /** - * @param configurationElement - */ - private void processChecker(IConfigurationElement configurationElement) { - try { - if (configurationElement.getName().equals(CHECKER_ELEMENT)) { - String id = getAtt(configurationElement, "id"); - if (id == null) - return; - String name = getAtt(configurationElement, "name", false); - if (name == null) - name = id; - IChecker checkerObj = null; - try { - Object checker = configurationElement - .createExecutableExtension("class"); - checkerObj = (IChecker) checker; - addChecker(checkerObj); - } catch (CoreException e) { - CodanCorePlugin.log(e); - return; - } - IConfigurationElement[] children1 = configurationElement - .getChildren("problemRef"); - boolean hasRef = false; - IConfigurationElement[] children2 = configurationElement - .getChildren(PROBLEM_ELEMENT); - if (children2 != null) { - for (IConfigurationElement ref : children2) { - IProblem p = processProblem(ref); - addRefProblem(checkerObj, p); - hasRef = true; - } - } - if (children1 != null) { - for (IConfigurationElement ref : children1) { - hasRef = true; - IProblem p = getDefaultProfile().findProblem( - ref.getAttribute("refId")); - addRefProblem(checkerObj, p); - } - } - if (!hasRef) { - addProblem(new CodanProblem(id, name), null); - } - } - } catch (Exception e) { - CodanCorePlugin.log(e); - } - } - - /** - * @param configurationElement - * @return - */ - private CodanProblem processProblem( - IConfigurationElement configurationElement) { - if (configurationElement.getName().equals(PROBLEM_ELEMENT)) { - String id = getAtt(configurationElement, "id"); - if (id == null) - return null; - String name = getAtt(configurationElement, "name"); - if (name == null) - name = id; - CodanProblem p = new CodanProblem(id, name); - String category = getAtt(configurationElement, "category", false); - if (category == null) - category = "org.eclipse.cdt.codan.core.categories.ProgrammingProblems"; - addProblem(p, category); - return p; - } - return null; - } - - private static String getAtt(IConfigurationElement configurationElement, - String name) { - return getAtt(configurationElement, name, true); - } - - private static String getAtt(IConfigurationElement configurationElement, - String name, boolean req) { - String elementValue = configurationElement.getAttribute(name); - if (elementValue == null && req) - CodanCorePlugin.log("Extension " - + configurationElement.getDeclaringExtension() - .getUniqueIdentifier() - + " missing required attribute: " - + configurationElement.getName() + "." + name); - return elementValue; - } - - public Iterator<IChecker> iterator() { - return checkers.iterator(); - } - - public static CheckersRegisry getInstance() { - if (instance == null) - new CheckersRegisry(); - return instance; - } - - public void addChecker(IChecker checker) { - checkers.add(checker); - } - - public void addProblem(IProblem p, String category) { - IProblemCategory cat = getDefaultProfile().findCategory(category); - if (cat == null) - cat = getDefaultProfile().getRoot(); - ((ProblemProfile) getDefaultProfile()).addProblem(p, cat); - } - - public void addCategory(IProblemCategory p, String category) { - IProblemCategory cat = getDefaultProfile().findCategory(category); - if (cat == null) - cat = getDefaultProfile().getRoot(); - ((ProblemProfile) getDefaultProfile()).addCategory(p, cat); - } - - public void addRefProblem(IChecker c, IProblem p) { - } - - /** - * @return - */ - public IProblemProfile getDefaultProfile() { - return profiles.get(DEFAULT); - } - - /** - * @return - */ - public IProblemProfile getWorkspaceProfile() { - IProblemProfile wp = profiles.get(ResourcesPlugin.getWorkspace()); - if (wp == null) { - try { - wp = (IProblemProfile) getDefaultProfile().clone(); - // load default values - CodanPreferencesLoader loader = new CodanPreferencesLoader(wp); - loader.load(CodanCorePlugin.getDefault().getStorePreferences()); - } catch (CloneNotSupportedException e) { - wp = getDefaultProfile(); - } - } - return wp; - } - - public void updateProfile(IResource element, IProblemProfile profile) { - if (profile == null) - profiles.remove(element); - else - profiles.put(element, profile); - } - - /** - * @param element - * @return - */ - public IProblemProfile getResourceProfile(IResource element) { - IProblemProfile prof = profiles.get(element); - if (prof == null) { - if (element instanceof IProject) { - try { - prof = (IProblemProfile) getWorkspaceProfile().clone(); - // load default values - CodanPreferencesLoader loader = new CodanPreferencesLoader( - prof); - IEclipsePreferences node = new ProjectScope( - (IProject) element) - .getNode(CodanCorePlugin.PLUGIN_ID); - boolean useWorkspace = node.getBoolean( - PreferenceConstants.P_USE_PARENT, false); - if (!useWorkspace) { - loader.load(node); - } - updateProfile(element, prof); - } catch (CloneNotSupportedException e) { - // cant - } - } else if (element.getParent() != null) { - prof = getResourceProfile(element.getParent()); - } else { - prof = getResourceProfile(element.getProject()); - } - } else { - } - return prof; - } - - /** - * @param element - * @return - */ - public IProblemProfile getResourceProfileWorkingCopy(IResource element) { - if (element instanceof IProject) { - try { - IProblemProfile prof = (IProblemProfile) getWorkspaceProfile() - .clone(); - // load default values - CodanPreferencesLoader loader = new CodanPreferencesLoader(prof); - IEclipsePreferences node = new ProjectScope((IProject) element) - .getNode(CodanCorePlugin.PLUGIN_ID); - loader.load(node); - return prof; - } catch (CloneNotSupportedException e) { - // cant - } - } - return null; - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblem.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblem.java deleted file mode 100644 index b83ab1509d6..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblem.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -public class CodanProblem implements IProblem { - private String id; - private String name; - private CodanSeverity severity = CodanSeverity.Warning; - private boolean enabled = true; - - public CodanSeverity getSeverity() { - return severity; - } - - public CodanProblem(String id2, String name2) { - this.id = id2; - this.name = name2; - } - - public String getName() { - return name; - } - - public String getId() { - return id; - } - - public IProblemCategory getCategory() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String toString() { - return name; - } - - public boolean isEnabled() { - return enabled; - } - - public void setSeverity(CodanSeverity sev) { - if (sev == null) - throw new NullPointerException(); - this.severity = sev; - } - - public void setEnabled(boolean checked) { - this.enabled = checked; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#clone() - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblemCategory.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblemCategory.java deleted file mode 100644 index efc320476c8..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblemCategory.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -import java.util.ArrayList; -import java.util.Iterator; - -public class CodanProblemCategory implements IProblemCategory, Cloneable { - private String id; - private String name; - private ArrayList<IProblemElement> list = new ArrayList<IProblemElement>(); - - public CodanProblemCategory(String id, String name) { - this.id = id; - this.name = name; - } - - public String getName() { - return name; - } - - public String getId() { - return id; - } - - @Override - public String toString() { - return name; - } - - public Object[] getChildren() { - return list.toArray(); - } - - public void addChild(IProblemElement p) { - list.add(p); - } - - public IProblem findProblem(String id) { - Object[] children = this.getChildren(); - for (Object object : children) { - if (object instanceof IProblemCategory) { - IProblemCategory cat = (IProblemCategory) object; - IProblem found = cat.findProblem(id); - if (found != null) - return found; - } else if (object instanceof IProblem) { - IProblem p = (IProblem) object; - if (p.getId().equals(id)) - return p; - } - } - return null; - } - - public IProblemCategory findCategory(String id) { - if (getId().equals(id)) - return this; - Object[] children = getChildren(); - for (Object object : children) { - if (object instanceof IProblemCategory) { - IProblemCategory cat = (IProblemCategory) object; - IProblemCategory found = cat.findCategory(id); - if (found != null) - return found; - } - } - return null; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#clone() - */ - @Override - public Object clone() { - try { - CodanProblemCategory clone = (CodanProblemCategory) super.clone(); - clone.list = new ArrayList<IProblemElement>(); - for (Iterator<IProblemElement> iterator = this.list.iterator(); iterator - .hasNext();) { - IProblemElement child = iterator.next(); - clone.list.add((IProblemElement) child.clone()); - } - return clone; - } catch (CloneNotSupportedException e) { - return this; - } - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblemReporter.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblemReporter.java deleted file mode 100644 index 1205eac8bd2..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanProblemReporter.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; - -public class CodanProblemReporter { - public static final String GENERIC_CODE_ANALYSIS_MARKER_TYPE = "org.eclipse.cdt.codan.core.codanProblem"; - - public void reportProblem(String id, IFile file, int lineNumber, - String message) { - try { - if (file == null) - throw new NullPointerException("file"); - if (id == null) - throw new NullPointerException("id"); - IProblem problem = CheckersRegisry.getInstance() - .getResourceProfile(file).findProblem(id); - if (problem == null) - throw new IllegalArgumentException("Id is not registered"); - if (problem.isEnabled() == false) - return; // skip - int severity = problem.getSeverity().intValue(); - IMarker marker = file - .createMarker(GENERIC_CODE_ANALYSIS_MARKER_TYPE); - marker.setAttribute(IMarker.MESSAGE, message); - marker.setAttribute(IMarker.SEVERITY, severity); - if (lineNumber == -1) { - lineNumber = 1; - } - marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); - } catch (CoreException e) { - e.printStackTrace(); - } - } - - public void deleteMarkers(IResource file) { - try { - file.deleteMarkers(GENERIC_CODE_ANALYSIS_MARKER_TYPE, false, - IResource.DEPTH_ZERO); - } catch (CoreException ce) { - } - } - - public void deleteAllMarkers() { - try { - // TODO delete contributed markers too - ResourcesPlugin.getWorkspace().getRoot().deleteMarkers( - GENERIC_CODE_ANALYSIS_MARKER_TYPE, false, - IResource.DEPTH_INFINITE); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanRuntime.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanRuntime.java deleted file mode 100644 index 13f8926afb1..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanRuntime.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -/** - * Runtime singleton class to get access to Codan framework parts - * - */ -public class CodanRuntime { - private static CodanRuntime instance = new CodanRuntime(); - private CodanProblemReporter problemReporter = new CodanProblemReporter(); - - public CodanProblemReporter getProblemReporter() { - return problemReporter; - } - - public static CodanRuntime getInstance() { - return instance; - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanSeverity.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanSeverity.java deleted file mode 100644 index acfa4d1c67e..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanSeverity.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -import org.eclipse.core.resources.IMarker; - -public enum CodanSeverity { - Info(IMarker.SEVERITY_INFO), Warning(IMarker.SEVERITY_WARNING), Error( - IMarker.SEVERITY_ERROR); - private int value; - - private CodanSeverity(int value) { - this.value = value; - } - - public int intValue() { - return value; - } - - /** - * @return - */ - public static String[] stringValues() { - CodanSeverity[] values = values(); - String[] svalues = new String[values.length]; - for (int i = 0; i < values.length; i++) { - CodanSeverity sev = values[i]; - svalues[i] = sev.toString(); - } - return svalues; - } -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICAstChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICAstChecker.java deleted file mode 100644 index 461c0fa6f6c..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICAstChecker.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; - -/** - * @author Alena - * - */ -public interface ICAstChecker extends IChecker { - void processAst(IASTTranslationUnit ast); -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IChecker.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IChecker.java deleted file mode 100644 index c1ccd96bea6..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IChecker.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -import org.eclipse.core.resources.IResource; - -public interface IChecker { - public boolean processResource(IResource resource); - - boolean enabledInContext(IResource resource); -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblem.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblem.java deleted file mode 100644 index 5f262a6dedc..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblem.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -public interface IProblem extends IProblemElement { - String getName(); - - String getId(); - - boolean isEnabled(); - - CodanSeverity getSeverity(); - - IProblemCategory getCategory(); -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemCategory.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemCategory.java deleted file mode 100644 index 45a62a0a294..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemCategory.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -public interface IProblemCategory extends IProblemElement { - String getName(); - - String getId(); - - Object[] getChildren(); - - /** - * @param id - * @return - */ - IProblem findProblem(String id); - - /** - * @param id - * @return - */ - IProblemCategory findCategory(String id); -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemElement.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemElement.java deleted file mode 100644 index b9f7fb8a378..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemElement.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -/** - * @author Alena - * - */ -public interface IProblemElement extends Cloneable { - Object clone() throws CloneNotSupportedException; -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java deleted file mode 100644 index 6b4a9c6d875..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -/** - * @author Alena - * - */ -public interface IProblemProfile extends IProblemElement { - IProblemCategory getRoot(); - - IProblem findProblem(String id); - - IProblemCategory findCategory(String id); - - IProblem[] getProblems(); -} diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfile.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfile.java deleted file mode 100644 index bd41e356f1b..00000000000 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfile.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * 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.core.model; - -import java.util.ArrayList; -import java.util.Collection; - -/** - * @author Alena - * - */ -public class ProblemProfile implements IProblemProfile, Cloneable { - private IProblemCategory rootCategory = new CodanProblemCategory("root", - "root"); - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.cdt.codan.core.model.IProblemProfile#getProblem(java.lang - * .String) - */ - @Override - public IProblem findProblem(String id) { - return getRoot().findProblem(id); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.cdt.codan.core.model.IProblemProfile#getProblems() - */ - @Override - public IProblem[] getProblems() { - Collection<IProblem> problems = new ArrayList<IProblem>(); - collectProblems(getRoot(), problems); - return problems.toArray(new IProblem[problems.size()]); - } - - /** - * @param root - * @param problems - */ - protected void collectProblems(IProblemCategory parent, - Collection<IProblem> problems) { - Object[] children = parent.getChildren(); - for (Object object : children) { - if (object instanceof IProblemCategory) { - IProblemCategory cat = (IProblemCategory) object; - collectProblems(cat, problems); - } else if (object instanceof IProblem) { - problems.add((IProblem) object); - } - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.cdt.codan.core.model.IProblemProfile#getRoot() - */ - @Override - public IProblemCategory getRoot() { - return rootCategory; - } - - public void addProblem(IProblem p, IProblemCategory cat) { - if (cat == null) - cat = getRoot(); - ((CodanProblemCategory) cat).addChild(p); - } - - public IProblemCategory findCategory(String id) { - return getRoot().findCategory(id); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#clone() - */ - @Override - public Object clone() { - try { - ProblemProfile clone = (ProblemProfile) super.clone(); - clone.rootCategory = (IProblemCategory) ((CodanProblemCategory) this.rootCategory) - .clone(); - return clone; - } catch (CloneNotSupportedException e) { - return this; - } - } - - /** - * @param p - * @param cat - */ - public void addCategory(IProblemCategory category, IProblemCategory parent) { - ((CodanProblemCategory) parent).addChild(category); - } -} diff --git a/codan/org.eclipse.cdt.codan.ui/.classpath b/codan/org.eclipse.cdt.codan.ui/.classpath deleted file mode 100644 index 64c5e31b7a2..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?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/.project b/codan/org.eclipse.cdt.codan.ui/.project deleted file mode 100644 index 1a97756c65e..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.cdt.codan.ui</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> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/codan/org.eclipse.cdt.codan.ui/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 57703d3f61d..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Fri Apr 03 21:34:42 EDT 2009 -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.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/codan/org.eclipse.cdt.codan.ui/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 9d5357d0a0f..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Code Analyzers Framework -Bundle-SymbolicName: org.eclipse.cdt.codan.ui; singleton:=true -Bundle-Version: 1.0.0 -Bundle-Activator: org.eclipse.cdt.codan.ui.Activator -Bundle-Vendor: Eclipse -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.cdt.core;bundle-version="5.1.0", - org.eclipse.cdt.codan.core;bundle-version="1.0.0", - org.eclipse.cdt.ui;bundle-version="5.1.0", - org.eclipse.ui.workbench.texteditor;bundle-version="3.5.0", - org.eclipse.ui.editors;bundle-version="3.5.0" -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Bundle-ActivationPolicy: lazy - diff --git a/codan/org.eclipse.cdt.codan.ui/build.properties b/codan/org.eclipse.cdt.codan.ui/build.properties deleted file mode 100644 index 2b0d95b6b02..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - . diff --git a/codan/org.eclipse.cdt.codan.ui/plugin.xml b/codan/org.eclipse.cdt.codan.ui/plugin.xml deleted file mode 100644 index eff5ea69576..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/plugin.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - - - <extension - point="org.eclipse.ui.popupMenus"> - <objectContribution - adaptable="true" - objectClass="org.eclipse.core.resources.IProject" - nameFilter="*" - id="org.eclipse.cdt.codan.ui.runaction"> - <action - label="Run Code Analysis" - class="org.eclipse.cdt.codan.ui.actions.RunCodeAnalysis" - menubarPath="additions" - enablesFor="+" - id="org.eclipse.cdt.codan.ui.actions.RunCodeAnalysis"> - </action> - </objectContribution> - </extension> - - <extension - point="org.eclipse.ui.preferencePages"> - <page - category="org.eclipse.cdt.ui.preferences.CPluginPreferencePage" - class="org.eclipse.cdt.codan.internal.ui.preferences.CodanPreferencePage" - id="org.eclipse.cdt.codan.ui.preferences.CodanPreferencePage" - name="Code Analysis"> - </page> - </extension> - <extension - point="org.eclipse.ui.propertyPages"> - <page - name="C/C++ Code Analysis " - - class="org.eclipse.cdt.codan.internal.ui.preferences.CodanPreferencePage" - id="org.eclipse.cdt.codan.ui.properties.codanProblemsPropertyPage"> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - <page - category="org.eclipse.cdt.codan.ui.properties.codanProblemsPropertyPage" - class="org.eclipse.cdt.codan.internal.ui.preferences.BuildPropertyPage" - id="org.eclipse.cdt.codan.ui.properties.buildPropertyPage" - name="Build"> - <enabledWhen> - <instanceof - value="org.eclipse.core.resources.IProject"> - </instanceof> - </enabledWhen> - </page> - </extension> - - - <extension - point="org.eclipse.core.runtime.preferences"> - <initializer - class="org.eclipse.cdt.codan.internal.ui.preferences.PreferenceInitializer"> - </initializer> - </extension> - <extension - point="org.eclipse.ui.startup"> - <startup - class="org.eclipse.cdt.codan.ui.Startup"></startup> - </extension> -</plugin> diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java deleted file mode 100644 index 2f2a2de473d..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.eclipse.cdt.codan.internal.ui.preferences; - -import org.eclipse.cdt.codan.core.CodanCorePlugin; -import org.eclipse.cdt.codan.core.PreferenceConstants; -import org.eclipse.cdt.codan.ui.actions.ToggleNatureAction; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ProjectScope; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.preferences.IScopeContext; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.ui.IWorkbenchPropertyPage; -import org.eclipse.ui.preferences.ScopedPreferenceStore; - -public class BuildPropertyPage extends FieldEditorPreferencePage implements - IWorkbenchPropertyPage { - private IAdaptable element; - - /** - * - */ - public BuildPropertyPage() { - setPreferenceStore(org.eclipse.cdt.codan.ui.Activator.getDefault() - .getPreferenceStore()); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors - * () - */ - @Override - protected void createFieldEditors() { - addField(new BooleanFieldEditor(PreferenceConstants.P_RUN_ON_BUILD, - "&Run with Build", getFieldEditorParent())); - } - - @Override - public boolean performOk() { - boolean result = super.performOk(); - if (result) { - IAdaptable res = getElement(); - if (res instanceof IProject) { - boolean runOnBuild = getPreferenceStore().getBoolean( - PreferenceConstants.P_RUN_ON_BUILD); - new ToggleNatureAction().toggleNature((IProject) res, - runOnBuild); - // if (runOnBuild == false) { - // boolean openQuestion = MessageDialog - // .openQuestion( - // getShell(), - // "Confirmation", - // "Do you want to remove existing problems? If build is disabled they won't be updated anymore."); - // if (openQuestion == true) { - // CodanProblemReporter.deleteAllMarkers(); - // } - // } - return true; - } - } - return result; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IWorkbenchPropertyPage#getElement() - */ - public IAdaptable getElement() { - return element; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime - * .IAdaptable) - */ - public void setElement(IAdaptable element) { - this.element = element; - ProjectScope ps = new ProjectScope((IProject) getElement()); - ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, - CodanCorePlugin.PLUGIN_ID); - scoped - .setSearchContexts(new IScopeContext[] { ps, - new InstanceScope() }); - setPreferenceStore(scoped); - } - - protected String getPageId() { - return "org.eclipse.cdt.codan.internal.ui.preferences.CodanPreferencePage"; - } -} diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java deleted file mode 100644 index 7c98ef48d00..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java +++ /dev/null @@ -1,330 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 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 - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.cdt.codan.internal.ui.preferences; - -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTreeViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Tree; - -/** - * An abstract field editor that manages a checked tree. Values in the tree - * should be set outside by setting getTreeViewer().setContentProvider() and - * getTreeViewer().setInput() Control stores checked elements only in preference - * storage. - * - * <p> - * Subclasses may implement the <code>parseString</code>, - * <code>createList</code>, <code>storeValue</code> and - * <code>getListSeparator</code> framework methods. - * </p> - */ -public abstract class CheckedTreeEditor extends FieldEditor implements - ICheckStateListener { - /** - * The list widget; <code>null</code> if none (before creation or after - * disposal). - */ - private CheckboxTreeViewer treeViewer; - private Composite listParent; - private boolean isValid; - private boolean emptySelectionAllowed = false; - - /** - * Creates a new list field editor - */ - protected CheckedTreeEditor() { - } - - /** - * Creates a list field editor. - * - * @param name - * the name of the preference this field editor works on - * @param labelText - * the label text of the field editor - * @param parent - * the parent of the field editor's control - */ - public CheckedTreeEditor(String name, String labelText, Composite parent) { - init(name, labelText); - createControl(parent); - } - - /* - * (non-Javadoc) Method declared on FieldEditor. - */ - protected void adjustForNumColumns(int numColumns) { - Control control = getLabelControl(); - if (control != null) { - ((GridData) control.getLayoutData()).horizontalSpan = numColumns; - ((GridData) getTreeControl().getLayoutData()).horizontalSpan = numColumns; - } else { - ((GridData) getTreeControl().getLayoutData()).horizontalSpan = numColumns; - } - } - - /* - * (non-Javadoc) Method declared on FieldEditor. - */ - protected void doFillIntoGrid(Composite parent, int numColumns) { - doFillLabelIntoGrid(parent, numColumns); - doFillBoxIntoGrid(parent, numColumns); - } - - protected void doFillLabelIntoGrid(Composite parent, int numColumns) { - String text = getLabelText(); - if (text != null && text.length() > 0) { - Control control = getLabelControl(parent); - GridData gd = new GridData(); - gd.horizontalSpan = numColumns; - control.setLayoutData(gd); - } - } - - protected void doFillBoxIntoGrid(Composite parent, int numColumns) { - GridData gd; - Control list = createListControl(parent); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.verticalAlignment = GridData.FILL; - gd.horizontalSpan = numColumns; - gd.grabExcessHorizontalSpace = true; - gd.grabExcessVerticalSpace = true; - list.setLayoutData(gd); - } - - /* - * (non-Javadoc) Method declared on FieldEditor. - */ - protected void doLoad() { - if (getTreeControl() != null) { - String s = getPreferenceStore().getString(getPreferenceName()); - getViewer().setInput(modelFromString(s)); - } - } - - /** - * @param s - * @return - */ - protected abstract Object modelFromString(String s); - - Control getTreeControl() { - if (treeViewer == null) - return null; - return treeViewer.getControl(); - } - - public CheckboxTreeViewer getTreeViewer() { - return treeViewer; - } - - /** - * @Override - * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent) - */ - public void checkStateChanged(CheckStateChangedEvent event) { - Object element = event.getElement(); - treeViewer.setGrayed(element, false); - treeViewer.setSubtreeChecked(element, event.getChecked()); - Object parent = getContentProvider().getParent(element); - if (parent != null) { - updateCheckedState(parent); - treeViewer.setParentsGrayed(parent, true); - } - refreshValidState(); - } - - private ITreeContentProvider getContentProvider() { - return ((ITreeContentProvider) treeViewer.getContentProvider()); - } - - /** - * @param parent - * @param event - */ - private void updateCheckedState(Object parent) { - Object[] children = getContentProvider().getChildren(parent); - int i, count = 0; - for (i = 0; i < children.length; i++) { - Object object = children[i]; - if (treeViewer.getChecked(object)) { - count++; - } - } - if (count > 0) { - treeViewer.setChecked(parent, true); - } - if (count == 0) { - treeViewer.setGrayed(parent, false); - treeViewer.setChecked(parent, false); - return; - } - if (count < i) { - treeViewer.setGrayed(parent, true); - } - } - - /* - * (non-Javadoc) Method declared on FieldEditor. - */ - protected void doLoadDefault() { - if (getTreeControl() != null) { - String s = getPreferenceStore().getDefaultString( - getPreferenceName()); - getViewer().setInput(modelFromString(s)); - } - } - - /* - * (non-Javadoc) Method declared on FieldEditor. - */ - protected void doStore() { - String s = modelToString(getViewer().getInput()); - if (s != null) { - getPreferenceStore().setValue(getPreferenceName(), s); - } - } - - /** - * Returns this field editor's list control. - * - * @param parent - * the parent control - * @return the list control - */ - public Tree createListControl(Composite parent) { - Tree table = (Tree) getTreeControl(); - if (table == null) { - listParent = parent; - treeViewer = new CheckboxTreeViewer(parent, SWT.BORDER | SWT.MULTI - | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION); - table = treeViewer.getTree(); - table.setFont(parent.getFont()); - treeViewer.addCheckStateListener(this); - } else { - checkParent(table, parent); - } - return table; - } - - public StructuredViewer getViewer() { - return treeViewer; - } - - /* - * (non-Javadoc) Method declared on FieldEditor. - */ - public int getNumberOfControls() { - return 2; - } - - /** - * Returns this field editor's shell. - * <p> - * This method is internal to the framework; subclassers should not call - * this method. - * </p> - * - * @return the shell - */ - protected Shell getShell() { - return treeViewer.getControl().getShell(); - } - - /* - * (non-Javadoc) Method declared on FieldEditor. - */ - public void setFocus() { - if (getTreeControl() != null) { - getTreeControl().setFocus(); - } - } - - /* - * @see FieldEditor.setEnabled(boolean,Composite). - */ - public void setEnabled(boolean enabled, Composite parent) { - super.setEnabled(enabled, parent); - createListControl(parent).setEnabled(enabled); - } - - /** - * Combines the given list of items into a single string. This method is the - * converse of <code>parseString</code>. - * <p> - * Subclasses may implement this method. - * </p> - * - * @return the combined string - * @see #stringToModel - */ - protected abstract String modelToString(Object model); - - protected void createControl(Composite parent) { - GridLayout ly = (GridLayout) parent.getLayout(); - doFillIntoGrid(parent, ly.numColumns); - } - - /** - * @param b - */ - public void setEnabled(boolean b) { - setEnabled(b, listParent); - } - - public Composite getTreeParent() { - return listParent; - } - - /* - * (non-Javadoc) Method declared on FieldEditor. - */ - public boolean isValid() { - return isValid; - } - - /* - * (non-Javadoc) Method declared on FieldEditor. - */ - protected void refreshValidState() { - isValid = checkState(); - } - - protected boolean checkState() { - if (!emptySelectionAllowed) { - Object[] checkedElements = getTreeViewer().getCheckedElements(); - if (checkedElements.length == 0) { - showErrorMessage("Selection cannot be empty"); - return false; - } - } - clearErrorMessage(); - return true; - } - - public final boolean isEmptySelectionAllowed() { - return emptySelectionAllowed; - } - - public final void setEmptySelectionAllowed(boolean emptySelectionAllowed) { - this.emptySelectionAllowed = emptySelectionAllowed; - } -} diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java deleted file mode 100644 index 412b6f06a6c..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * 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.preferences; - -import org.eclipse.cdt.codan.core.CodanCorePlugin; -import org.eclipse.cdt.codan.core.model.CheckersRegisry; -import org.eclipse.cdt.codan.core.model.IProblemProfile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.preferences.ScopedPreferenceStore; - -/** - * This class represents a preference page that is contributed to the - * Preferences dialog. By subclassing <samp>FieldEditorPreferencePage</samp>, we - * can use the field support built into JFace that allows us to create a page - * that is small and knows how to save, restore and apply itself. - * <p> - * This page is used to modify preferences only. They are stored in the - * preference store that belongs to the main plug-in class. That way, - * preferences can be accessed directly via the preference store. - */ -public class CodanPreferencePage extends FieldEditorOverlayPage implements - IWorkbenchPreferencePage { - private IProblemProfile profile; - - public CodanPreferencePage() { - super(GRID); - setPreferenceStore(new ScopedPreferenceStore(new InstanceScope(), - CodanCorePlugin.PLUGIN_ID)); - setDescription("Code Analyzers Preference Page"); - } - - protected String getPageId() { - return "org.eclipse.cdt.codan.internal.ui.preferences.CodanPreferencePage"; - } - - /** - * Creates the field editors. Field editors are abstractions of the common - * GUI blocks needed to manipulate various types of preferences. Each field - * editor knows how to save and restore itself. - */ - public void createFieldEditors() { - profile = isPropertyPage() ? CheckersRegisry.getInstance() - .getResourceProfileWorkingCopy((IResource) getElement()) - : CheckersRegisry.getInstance().getWorkspaceProfile(); - CheckedTreeEditor checkedTreeEditor = new ProblemsTreeEditor( - getFieldEditorParent(), profile); - addField(checkedTreeEditor); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.preference.PreferencePage#performApply() - */ - @Override - public boolean performOk() { - if (isPropertyPage()) - CheckersRegisry.getInstance().updateProfile( - (IResource) getElement(), null); - return super.performOk(); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - public void init(IWorkbench workbench) { - } -}
\ No newline at end of file diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java deleted file mode 100644 index e617a7541f0..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java +++ /dev/null @@ -1,363 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 Berthold Daum. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * Berthold Daum - *******************************************************************************/ -package org.eclipse.cdt.codan.internal.ui.preferences; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.cdt.codan.core.CodanCorePlugin; -import org.eclipse.cdt.codan.core.PreferenceConstants; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ProjectScope; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.preferences.IScopeContext; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceNode; -import org.eclipse.jface.preference.IPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceDialog; -import org.eclipse.jface.preference.PreferenceManager; -import org.eclipse.jface.preference.PreferenceNode; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.IWorkbenchPropertyPage; -import org.eclipse.ui.preferences.ScopedPreferenceStore; - -/** - * @author Berthold Daum - */ -public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage - implements IWorkbenchPropertyPage { - // Stores all created field editors - private List editors = new ArrayList(); - // Stores owning element of properties - private IAdaptable element; - // Additional buttons for property pages - private Button useWorkspaceSettingsButton, useProjectSettingsButton, - configureButton; - // Overlay preference store for property pages - private IPreferenceStore overlayStore; - // The image descriptor of this pages title image - private ImageDescriptor image; - // Cache for page id - private String pageId; - - /** - * Constructor - * - * @param style - * - layout style - */ - public FieldEditorOverlayPage(int style) { - super(style); - } - - /** - * Constructor - * - * @param title - * - title string - * @param style - * - layout style - */ - public FieldEditorOverlayPage(String title, int style) { - super(title, style); - } - - /** - * Constructor - * - * @param title - * - title string - * @param image - * - title image - * @param style - * - layout style - */ - public FieldEditorOverlayPage(String title, ImageDescriptor image, int style) { - super(title, image, style); - this.image = image; - } - - /** - * Returns the id of the current preference page as defined in plugin.xml - * Subclasses must implement. - * - * @return - the qualifier - */ - protected abstract String getPageId(); - - /** - * Receives the object that owns the properties shown in this property page. - * - * @see org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime.IAdaptable) - */ - public void setElement(IAdaptable element) { - this.element = element; - } - - /** - * Delivers the object that owns the properties shown in this property page. - * - * @see org.eclipse.ui.IWorkbenchPropertyPage#getElement() - */ - public IAdaptable getElement() { - return element; - } - - /** - * Returns true if this instance represents a property page - * - * @return - true for property pages, false for preference pages - */ - public boolean isPropertyPage() { - return getElement() != null; - } - - /** - * We override the addField method. This allows us to store each field - * editor added by subclasses in a list for later processing. - * - * @see org.eclipse.jface.preference.FieldEditorPreferencePage#addField(org.eclipse.jface.preference.FieldEditor) - */ - protected void addField(FieldEditor editor) { - editors.add(editor); - super.addField(editor); - } - - /** - * We override the createControl method. In case of property pages we create - * a new PropertyStore as local preference store. After all control have - * been create, we enable/disable these controls. - * - * @see org.eclipse.jface.preference.PreferencePage#createControl() - */ - public void createControl(Composite parent) { - // Special treatment for property pages - if (isPropertyPage()) { - // Cache the page id - pageId = getPageId(); - // Create an overlay preference store and fill it with properties - ProjectScope ps = new ProjectScope((IProject) getElement()); - ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, - CodanCorePlugin.PLUGIN_ID); - scoped.setSearchContexts(new IScopeContext[] { ps, - new InstanceScope() }); - overlayStore = scoped; - // Set overlay store as current preference store - } - super.createControl(parent); - // Update state of all subclass controls - if (isPropertyPage()) - updateFieldEditors(); - } - - /** - * We override the createContents method. In case of property pages we - * insert two radio buttons at the top of the page. - * - * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) - */ - protected Control createContents(Composite parent) { - if (isPropertyPage()) - createSelectionGroup(parent); - return super.createContents(parent); - } - - /** - * Creates and initializes a selection group with two choice buttons and one - * push button. - * - * @param parent - * - the parent composite - */ - private void createSelectionGroup(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(2, false); - layout.marginHeight = 0; - layout.marginWidth = 0; - comp.setLayout(layout); - comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Composite radioGroup = new Composite(comp, SWT.NONE); - radioGroup.setLayout(new GridLayout()); - radioGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - useWorkspaceSettingsButton = createRadioButton(radioGroup, Messages - .getString("OverlayPage.Use_Workspace_Settings")); //$NON-NLS-1$ - useProjectSettingsButton = createRadioButton(radioGroup, Messages - .getString("OverlayPage.Use_Project_Settings")); //$NON-NLS-1$ - configureButton = new Button(comp, SWT.PUSH); - configureButton.setText(Messages - .getString("OverlayPage.Configure_Workspace_Settings")); //$NON-NLS-1$ - configureButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - configureWorkspaceSettings(); - } - }); - // Set workspace/project radio buttons - try { - Boolean useWorkspace = getPreferenceStore().getBoolean( - PreferenceConstants.P_USE_PARENT); - if (useWorkspace) { - useWorkspaceSettingsButton.setSelection(true); - } else { - useProjectSettingsButton.setSelection(true); - configureButton.setEnabled(false); - } - } catch (Exception e) { - useWorkspaceSettingsButton.setSelection(true); - } - } - - /** - * Convenience method creating a radio button - * - * @param parent - * - the parent composite - * @param label - * - the button label - * @return - the new button - */ - private Button createRadioButton(Composite parent, String label) { - final Button button = new Button(parent, SWT.RADIO); - button.setText(label); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - configureButton - .setEnabled(button == useWorkspaceSettingsButton); - updateFieldEditors(); - } - }); - return button; - } - - /** - * Returns in case of property pages the overlay store, in case of - * preference pages the standard preference store - * - * @see org.eclipse.jface.preference.PreferencePage#getPreferenceStore() - */ - public IPreferenceStore getPreferenceStore() { - if (isPropertyPage()) - return overlayStore; - return super.getPreferenceStore(); - } - - /* - * Enables or disables the field editors and buttons of this page - */ - private void updateFieldEditors() { - // We iterate through all field editors - boolean enabled = useProjectSettingsButton.getSelection(); - updateFieldEditors(enabled); - } - - /** - * Enables or disables the field editors and buttons of this page Subclasses - * may override. - * - * @param enabled - * - true if enabled - */ - protected void updateFieldEditors(boolean enabled) { - Composite parent = getFieldEditorParent(); - Iterator it = editors.iterator(); - while (it.hasNext()) { - FieldEditor editor = (FieldEditor) it.next(); - editor.setEnabled(enabled, parent); - } - } - - /** - * We override the performOk method. In case of property pages we copy the - * values in the overlay store into the property values of the selected - * project. We also save the state of the radio buttons. - * - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() { - boolean result = super.performOk(); - if (result && isPropertyPage()) { - // Save state of radiobuttons in project properties - getPreferenceStore().setValue(PreferenceConstants.P_USE_PARENT, - !useProjectSettingsButton.getSelection()); - } - return result; - } - - /** - * We override the performDefaults method. In case of property pages we - * switch back to the workspace settings and disable the field editors. - * - * @see org.eclipse.jface.preference.PreferencePage#performDefaults() - */ - protected void performDefaults() { - if (isPropertyPage()) { - useWorkspaceSettingsButton.setSelection(true); - useProjectSettingsButton.setSelection(false); - configureButton.setEnabled(true); - updateFieldEditors(); - } - super.performDefaults(); - } - - /** - * Creates a new preferences page and opens it - */ - protected void configureWorkspaceSettings() { - try { - // create a new instance of the current class - IPreferencePage page = (IPreferencePage) this.getClass() - .newInstance(); - page.setTitle(getTitle()); - page.setImageDescriptor(image); - // and show it - showPreferencePage(pageId, page); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - - /** - * Show a single preference pages - * - * @param id - * - the preference page identification - * @param page - * - the preference page - */ - protected void showPreferencePage(String id, IPreferencePage page) { - final IPreferenceNode targetNode = new PreferenceNode(id, page); - PreferenceManager manager = new PreferenceManager(); - manager.addToRoot(targetNode); - final PreferenceDialog dialog = new PreferenceDialog(getControl() - .getShell(), manager); - BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { - public void run() { - dialog.create(); - dialog.setMessage(targetNode.getLabelText()); - dialog.open(); - } - }); - } -} diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.java deleted file mode 100644 index 4ef5f89be83..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 Berthold Daum. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * Berthold Daum - *******************************************************************************/ - -package org.eclipse.cdt.codan.internal.ui.preferences; - -import java.util.ResourceBundle; - - -public class Messages { - - private final static String RESOURCE_BUNDLE = "org.eclipse.cdt.codan.internal.ui.preferences.Messages";//$NON-NLS-1$ - - private static ResourceBundle fgResourceBundle = null; - - private static boolean notRead = true; - - public Messages() { - } - public static ResourceBundle getResourceBundle() { - if (notRead) { - notRead = false; - try { - fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE); - } - catch (Exception e) { - } - } - - return fgResourceBundle; - } - public static String getString(String key) { - try { - return getResourceBundle().getString(key); - } catch (Exception e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - } -} - diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.properties b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.properties deleted file mode 100644 index 689b7ee63a9..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.properties +++ /dev/null @@ -1,4 +0,0 @@ -OverlayPage.Use_Workspace_Settings=Use &workspace settings -OverlayPage.Use_Project_Settings=Use pr&oject settings -OverlayPage.Configure_Workspace_Settings=&Configure Workspace Settings ... -PropertyStore.Cannot_write_resource_property=Cannot write resource property diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java deleted file mode 100644 index 43620980c77..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * 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.preferences; - -import org.eclipse.cdt.codan.core.PreferenceConstants; -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; - -/** - * Class used to initialize default preference values. - */ -public class PreferenceInitializer extends AbstractPreferenceInitializer { - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - public void initializeDefaultPreferences() { - IPreferenceStore store = org.eclipse.cdt.codan.ui.Activator - .getDefault().getPreferenceStore(); - store.setDefault(PreferenceConstants.P_RUN_ON_BUILD, false); - } - -} diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java deleted file mode 100644 index 533d7390bc2..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java +++ /dev/null @@ -1,306 +0,0 @@ -/******************************************************************************* - * 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.preferences; - -import org.eclipse.cdt.codan.core.PreferenceConstants; -import org.eclipse.cdt.codan.core.builder.CodanPreferencesLoader; -import org.eclipse.cdt.codan.core.model.CodanProblem; -import org.eclipse.cdt.codan.core.model.CodanSeverity; -import org.eclipse.cdt.codan.core.model.IProblem; -import org.eclipse.cdt.codan.core.model.IProblemCategory; -import org.eclipse.cdt.codan.core.model.IProblemProfile; -import org.eclipse.jface.viewers.BaseLabelProvider; -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.ColumnLabelProvider; -import org.eclipse.jface.viewers.ComboBoxCellEditor; -import org.eclipse.jface.viewers.EditingSupport; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.ICheckStateProvider; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.TreeViewerColumn; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; - -public class ProblemsTreeEditor extends CheckedTreeEditor { - private CodanPreferencesLoader codanPreferencesLoader = new CodanPreferencesLoader(); - - public ProblemsTreeEditor() { - super(); - } - - class ProblemsCheckStateProvider implements ICheckStateProvider { - /* - * (non-Javadoc) - * - * @see - * org.eclipse.jface.viewers.ICheckStateProvider#isChecked(java.lang - * .Object) - */ - public boolean isChecked(Object element) { - if (element instanceof IProblem) { - IProblem p = (IProblem) element; - return p.isEnabled(); - } - if (element instanceof IProblemCategory) { - // checked if at least one is checked (buy grayed) - IProblemCategory p = (IProblemCategory) element; - Object[] children = p.getChildren(); - for (int i = 0; i < children.length; i++) { - Object object = children[i]; - if (isChecked(object)) { - return true; - } - } - } - return false; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.jface.viewers.ICheckStateProvider#isGrayed(java.lang. - * Object) - */ - public boolean isGrayed(Object element) { - if (element instanceof IProblem) { - return false; - } - if (element instanceof IProblemCategory) { - // checked if at least one is checked (buy grayed) - IProblemCategory p = (IProblemCategory) element; - Object[] children = p.getChildren(); - boolean all_checked = true; - boolean all_unchecked = true; - for (int i = 0; i < children.length; i++) { - Object object = children[i]; - if (isChecked(object)) { - all_unchecked = false; - } else { - all_checked = false; - } - } - if (all_checked || all_unchecked) - return false; - return true; - } - return false; - } - } - - class ProblemsContentProvider implements IContentProvider, - ITreeContentProvider { - public void dispose() { - // TODO Auto-generated method stub - } - - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - // TODO Auto-generated method stub - } - - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof Object[]) - return (Object[]) parentElement; - if (parentElement instanceof IProblemCategory) { - return ((IProblemCategory) parentElement).getChildren(); - } - if (parentElement instanceof IProblemProfile) { - return ((IProblemProfile) parentElement).getRoot() - .getChildren(); - } - return new Object[0]; - } - - public Object getParent(Object element) { - return null; - } - - public boolean hasChildren(Object element) { - return getChildren(element).length > 0; - } - - public Object[] getElements(Object inputElement) { - return getChildren(inputElement); - } - } - - public void checkStateChanged(CheckStateChangedEvent event) { - Object element = event.getElement(); - if (element instanceof CodanProblem) { - ((CodanProblem) element).setEnabled(event.getChecked()); - } - } - - class ProblemsLabelProvider extends BaseLabelProvider implements - IBaseLabelProvider, ITableLabelProvider { - public Image getColumnImage(Object element, int columnIndex) { - // TODO Auto-generated method stub - return null; - } - - public String getColumnText(Object element, int columnIndex) { - if (element instanceof IProblem) { - IProblem p = (IProblem) element; - if (columnIndex == 0) - return p.getName(); - if (columnIndex == 1) - return p.getSeverity().toString(); - } - if (element instanceof IProblemCategory) { - IProblemCategory p = (IProblemCategory) element; - if (columnIndex == 0) - return p.getName(); - } - return null; - } - } - - public ProblemsTreeEditor(Composite parent, IProblemProfile profile) { - super(PreferenceConstants.P_PROBLEMS, "Problems", parent); - setEmptySelectionAllowed(true); - getTreeViewer().getTree().setHeaderVisible(true); - // getTreeViewer().getTree(). - getTreeViewer().setContentProvider(new ProblemsContentProvider()); - getTreeViewer().setCheckStateProvider(new ProblemsCheckStateProvider()); - // column Name - TreeViewerColumn column1 = new TreeViewerColumn(getTreeViewer(), - SWT.NONE); - column1.getColumn().setWidth(300); - column1.getColumn().setText("Name"); - column1.setLabelProvider(new ColumnLabelProvider() { - public String getText(Object element) { - if (element instanceof IProblem) { - IProblem p = (IProblem) element; - return p.getName(); - } - if (element instanceof IProblemCategory) { - IProblemCategory p = (IProblemCategory) element; - return p.getName(); - } - return null; - } - }); - // column Severity - TreeViewerColumn column2 = new TreeViewerColumn(getTreeViewer(), - SWT.NONE); - column2.getColumn().setWidth(100); - column2.getColumn().setText("Severity"); - column2.setLabelProvider(new ColumnLabelProvider() { - public String getText(Object element) { - if (element instanceof IProblem) { - IProblem p = (IProblem) element; - return p.getSeverity().toString(); - } - return null; - } - }); - column2.setEditingSupport(new EditingSupport(getTreeViewer()) { - protected boolean canEdit(Object element) { - return element instanceof CodanProblem; - } - - protected CellEditor getCellEditor(Object element) { - return new ComboBoxCellEditor(getTreeViewer().getTree(), - CodanSeverity.stringValues()); - } - - protected Object getValue(Object element) { - return ((CodanProblem) element).getSeverity().intValue(); - } - - protected void setValue(Object element, Object value) { - int index = ((Integer) value).intValue(); - CodanSeverity val = CodanSeverity.values()[index]; - ((CodanProblem) element).setSeverity(val); - getTreeViewer().update(element, null); - } - }); - codanPreferencesLoader.setInput(profile); - getViewer().setInput(profile); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor#doLoad() - */ - @Override - protected void doLoad() { - if (getTreeControl() != null) { - IProblem[] probs = codanPreferencesLoader.getProblems(); - for (int i = 0; i < probs.length; i++) { - String id = probs[i].getId(); - String s = getPreferenceStore().getString(id); - codanPreferencesLoader.setProperty(id, s); - } - getViewer().setInput(codanPreferencesLoader.getInput()); - } - } - - @Override - protected void doLoadDefault() { - if (getTreeControl() != null) { - IProblem[] probs = codanPreferencesLoader.getProblems(); - for (int i = 0; i < probs.length; i++) { - String id = probs[i].getId(); - String s = getPreferenceStore().getDefaultString(id); - codanPreferencesLoader.setProperty(id, s); - } - getViewer().setInput(codanPreferencesLoader.getInput()); - } - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor#doStore() - */ - @Override - protected void doStore() { - codanPreferencesLoader.setInput(getViewer().getInput()); - IProblem[] probs = codanPreferencesLoader.getProblems(); - for (int i = 0; i < probs.length; i++) { - String id = probs[i].getId(); - String s = codanPreferencesLoader.getProperty(id); - getPreferenceStore().setValue(id, s); - } - } - - /* - * (non-Javadoc) - * - * @seeorg.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor# - * modelFromString(java.lang.String) - */ - @Override - protected Object modelFromString(String s) { - return codanPreferencesLoader.getInput(); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.cdt.codan.internal.ui.preferences.CheckedTreeEditor#modelToString - * (java.lang.Object) - */ - @Override - protected String modelToString(Object model) { - return ""; - } -} diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Activator.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Activator.java deleted file mode 100644 index 849993afa61..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Activator.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.eclipse.cdt.codan.ui; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.resource.ImageDescriptor; -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.ui"; - // 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; - } - - /** - * Returns an image descriptor for the image file at the given plug-in - * relative path - * - * @param path - * the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } - - /** - * Logs the specified status with this plug-in's log. - * - * @param status - * status to log - */ - public static void log(IStatus status) { - getDefault().getLog().log(status); - } - - /** - * Logs an internal error with the specified throwable - * - * @param e - * the exception to be logged - */ - public static void log(Throwable e) { - log(new Status(IStatus.ERROR, PLUGIN_ID, 1, "Internal Error", e)); //$NON-NLS-1$ - } - - /** - * Logs an internal error with the specified message. - * - * @param message - * the error message to log - */ - public static void log(String message) { - log(new Status(IStatus.ERROR, PLUGIN_ID, 1, message, null)); - } -} diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanCReconciler.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanCReconciler.java deleted file mode 100644 index 23394d4d821..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanCReconciler.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * 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.ui; - -import org.eclipse.cdt.codan.core.builder.CodanBuilder; -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 { - 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() { - // TODO Auto-generated method stub - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.cdt.internal.ui.text.ICReconcilingListener#aboutToBeReconciled - * () - */ - public void aboutToBeReconciled() { - // TODO Auto-generated method stub - } - - /* - * (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) { - new CodanBuilder().reconcileAst(ast, progressMonitor); - System.err.println("ast reconsiled"); - } -} diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Startup.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Startup.java deleted file mode 100644 index 41fbf89fdc6..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Startup.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * 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.ui; - -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); - } - } - }); - } -} diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/RunCodeAnalysis.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/RunCodeAnalysis.java deleted file mode 100644 index 39f52b6e0ce..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/RunCodeAnalysis.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * 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.ui.actions; - -import java.util.Iterator; - -import org.eclipse.cdt.codan.core.builder.CodanBuilder; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -public class RunCodeAnalysis implements IObjectActionDelegate { - private ISelection sel; - - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - // TODO Auto-generated method stub - } - - public void run(IAction action) { - for (Iterator iterator = ((IStructuredSelection) sel).iterator(); iterator - .hasNext();) { - Object o = iterator.next(); - if (o instanceof IResource) { - IResource res = (IResource) o; - try { - res.accept(new CodanBuilder().new CodanResourceVisitor()); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - } - - public void selectionChanged(IAction action, ISelection selection) { - this.sel = selection; - } -} diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/ToggleNatureAction.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/ToggleNatureAction.java deleted file mode 100644 index efc9f756cc6..00000000000 --- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/ToggleNatureAction.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * 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.ui.actions; - -import java.util.Iterator; - -import org.eclipse.cdt.codan.core.builder.CodeAnlysisNature; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -public class ToggleNatureAction implements IObjectActionDelegate { - private ISelection selection; - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - public void run(IAction action) { - if (selection instanceof IStructuredSelection) { - for (Iterator it = ((IStructuredSelection) selection).iterator(); it - .hasNext();) { - Object element = it.next(); - IProject project = null; - if (element instanceof IProject) { - project = (IProject) element; - } else if (element instanceof IAdaptable) { - project = (IProject) ((IAdaptable) element) - .getAdapter(IProject.class); - } - if (project != null) { - toggleNature(project, !hasCodanNature(project)); - } - } - } - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action - * .IAction, org.eclipse.jface.viewers.ISelection) - */ - public void selectionChanged(IAction action, ISelection selection) { - this.selection = selection; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface. - * action.IAction, org.eclipse.ui.IWorkbenchPart) - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - } - - public boolean hasCodanNature(IProject project) { - IProjectDescription description; - try { - description = project.getDescription(); - String[] natures = description.getNatureIds(); - for (int i = 0; i < natures.length; ++i) { - if (CodeAnlysisNature.NATURE_ID.equals(natures[i])) { - return true; - } - } - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return false; - } - - /** - * Toggles sample nature on a project - * - * @param project - * to have sample nature added or removed - */ - public void toggleNature(IProject project, boolean add) { - try { - IProjectDescription description = project.getDescription(); - String[] natures = description.getNatureIds(); - for (int i = 0; i < natures.length; ++i) { - if (CodeAnlysisNature.NATURE_ID.equals(natures[i])) { - if (add == false) { - // Remove the nature - String[] newNatures = new String[natures.length - 1]; - System.arraycopy(natures, 0, newNatures, 0, i); - System.arraycopy(natures, i + 1, newNatures, i, - natures.length - i - 1); - description.setNatureIds(newNatures); - project.setDescription(description, null); - return; - } else { - // already there no need to add - add = false; - break; - } - } - } - if (add) { - // Add the nature - String[] newNatures = new String[natures.length + 1]; - System.arraycopy(natures, 0, newNatures, 0, natures.length); - newNatures[natures.length] = CodeAnlysisNature.NATURE_ID; - description.setNatureIds(newNatures); - project.setDescription(description, null); - } - } catch (CoreException e) { - } - } -} diff --git a/p2/org.eclipse.cdt.p2.generator/.classpath b/p2/org.eclipse.cdt.p2.generator/.classpath deleted file mode 100644 index 67889f3aadb..00000000000 --- a/p2/org.eclipse.cdt.p2.generator/.classpath +++ /dev/null @@ -1,11 +0,0 @@ -<?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/JavaSE-1.6"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"> - <accessrules> - <accessrule kind="accessible" pattern="**/internal/provisional/**"/> - </accessrules> - </classpathentry> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/p2/org.eclipse.cdt.p2.generator/.project b/p2/org.eclipse.cdt.p2.generator/.project deleted file mode 100644 index fc1c628df0e..00000000000 --- a/p2/org.eclipse.cdt.p2.generator/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.cdt.p2.generator</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> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/p2/org.eclipse.cdt.p2.generator/.settings/org.eclipse.jdt.core.prefs b/p2/org.eclipse.cdt.p2.generator/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f313740144f..00000000000 --- a/p2/org.eclipse.cdt.p2.generator/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Mon Dec 01 20:43:28 EST 2008 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/p2/org.eclipse.cdt.p2.generator/META-INF/MANIFEST.MF b/p2/org.eclipse.cdt.p2.generator/META-INF/MANIFEST.MF deleted file mode 100644 index 852ecba5552..00000000000 --- a/p2/org.eclipse.cdt.p2.generator/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Generator Plug-in -Bundle-SymbolicName: org.eclipse.cdt.p2.generator;singleton:=true -Bundle-Version: 5.0.0.qualifier -Bundle-Activator: org.eclipse.cdt.p2.generator.Activator -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.cdt.p2;bundle-version="1.0.0", - org.eclipse.equinox.p2.artifact.repository;bundle-version="1.0.2", - org.eclipse.equinox.p2.core;bundle-version="1.0.0", - org.eclipse.equinox.p2.metadata;bundle-version="1.0.0", - org.eclipse.equinox.p2.engine;bundle-version="1.0.1", - org.eclipse.equinox.p2.metadata.repository;bundle-version="1.0.0", - org.eclipse.equinox.p2.metadata.generator;bundle-version="1.0.1", - org.eclipse.equinox.p2.publisher;bundle-version="1.0.0", - org.eclipse.equinox.p2.repository;bundle-version="1.0.0" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/p2/org.eclipse.cdt.p2.generator/about.html b/p2/org.eclipse.cdt.p2.generator/about.html deleted file mode 100644 index d7c511887d6..00000000000 --- a/p2/org.eclipse.cdt.p2.generator/about.html +++ /dev/null @@ -1,24 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head> - -<body lang="EN-US"> -<h2>About This Content</h2> - -<p>June 22, 2007</p> -<h3>License</h3> - -<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. -For purposes of the EPL, "Program" will mean the Content.</p> - -<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> - -</body></html>
\ No newline at end of file diff --git a/p2/org.eclipse.cdt.p2.generator/build.properties b/p2/org.eclipse.cdt.p2.generator/build.properties deleted file mode 100644 index e9863e281ea..00000000000 --- a/p2/org.eclipse.cdt.p2.generator/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml diff --git a/p2/org.eclipse.cdt.p2.generator/plugin.xml b/p2/org.eclipse.cdt.p2.generator/plugin.xml deleted file mode 100644 index 73a72853ed2..00000000000 --- a/p2/org.eclipse.cdt.p2.generator/plugin.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.2"?> -<plugin> - <extension - id="mingwGenerator" - name="MinGW Generator" - point="org.eclipse.core.runtime.applications"> - <application - cardinality="singleton-global" - thread="main" - visible="true"> - <run - class="org.eclipse.cdt.p2.generator.MinGWGenerator"> - </run> - </application> - </extension> - -</plugin> diff --git a/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/Activator.java b/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/Activator.java deleted file mode 100644 index eabd95beb7c..00000000000 --- a/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/Activator.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.eclipse.cdt.p2.generator; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.cdt.p2.generator"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#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; - } - - @SuppressWarnings("unchecked") - public <T> T getService(Class<T> clazz) { - BundleContext context = plugin.getBundle().getBundleContext(); - ServiceReference ref = context.getServiceReference(clazz.getName()); - return (ref != null) ? (T)context.getService(ref) : null; - } - - public Bundle getBundle(String symbolicName) { - PackageAdmin packageAdmin = getService(PackageAdmin.class); - if (packageAdmin == null) - return null; - Bundle[] bundles = packageAdmin.getBundles(symbolicName, null); - if (bundles == null) - return null; - //Return the first bundle that is not installed or uninstalled - for (int i = 0; i < bundles.length; i++) { - if ((bundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) { - return bundles[i]; - } - } - return null; - } - -} diff --git a/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/MinGWGenerator.java b/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/MinGWGenerator.java deleted file mode 100644 index 725bbc259bf..00000000000 --- a/p2/org.eclipse.cdt.p2.generator/src/org/eclipse/cdt/p2/generator/MinGWGenerator.java +++ /dev/null @@ -1,387 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Wind River Systems, Inc. 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 - * - * Contributors: - * Doug Schaefer - initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.p2.generator; - -import java.io.File; -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.equinox.app.IApplication; -import org.eclipse.equinox.app.IApplicationContext; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.ArtifactDescriptor; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; -import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.Version; -import org.eclipse.equinox.internal.provisional.p2.core.VersionRange; -import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey; -import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; -import org.eclipse.equinox.internal.provisional.p2.metadata.ILicense; -import org.eclipse.equinox.internal.provisional.p2.metadata.IProvidedCapability; -import org.eclipse.equinox.internal.provisional.p2.metadata.IRequiredCapability; -import org.eclipse.equinox.internal.provisional.p2.metadata.ITouchpointType; -import org.eclipse.equinox.internal.provisional.p2.metadata.IUpdateDescriptor; -import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory; -import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription; -import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; -import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepositoryManager; -import org.eclipse.equinox.spi.p2.publisher.PublisherHelper; -import org.osgi.framework.Bundle; - -/** - * @author DSchaefe - * - */ -public class MinGWGenerator implements IApplication { - - private static final String REPO_NAME = "Wascana"; - - private static final ITouchpointType NATIVE_TOUCHPOINT - = MetadataFactory.createTouchpointType("org.eclipse.equinox.p2.native", new Version("1.0.0")); - private static final String GZ_COMPRESSION = "gz"; - private static final String BZ2_COMPRESSION = "bz2"; - private static final String ZIP_COMPRESSION = "zip"; - - IMetadataRepository metaRepo; - IArtifactRepository artiRepo; - - @Override - public Object start(IApplicationContext context) throws Exception { - context.applicationRunning(); - - Activator.getDefault().getBundle("org.eclipse.equinox.p2.exemplarysetup").start(Bundle.START_TRANSIENT); //$NON-NLS-1$ - - String[] args = (String[])context.getArguments().get(IApplicationContext.APPLICATION_ARGS); - if (args.length < 1) { - System.err.println("usage: <repoDir>"); - return EXIT_OK; - } - - File repoDir = new File(args[0]); - repoDir.mkdirs(); - - new File(repoDir, "artifacts.xml").delete(); - new File(repoDir, "content.xml").delete(); - - URI repoLocation = repoDir.toURI(); - - IMetadataRepositoryManager metaRepoMgr = Activator.getDefault().getService(IMetadataRepositoryManager.class); - IArtifactRepositoryManager artiRepoMgr = Activator.getDefault().getService(IArtifactRepositoryManager.class); - - metaRepo = metaRepoMgr.createRepository(repoLocation, REPO_NAME, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null); - artiRepo = artiRepoMgr.createRepository(repoLocation, REPO_NAME, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, null); - - ILicense publicDomainLic = MetadataFactory.createLicense(null, publicDomain); - ILicense gplLic = MetadataFactory.createLicense(new URI(gplURL), gpl); - ILicense lgplLic = MetadataFactory.createLicense(new URI(lgplURL), lgpl); - ILicense zlibLic = MetadataFactory.createLicense(new URI(zlibLicURL), zlibLicText); - ILicense wxLic = MetadataFactory.createLicense(new URI(wxLicURL), wxLicText); - - Version wascanaVersion = new Version("1.0.0"); - - String mingwSubdir = "mingw"; - - boolean toolGroups = true; - - // MinGW Runtime DLL - Version runtimeVersion = new Version("4.15.2"); - IInstallableUnit runtimeDLLIU = createIU( - "wascana.mingw.mingwrt.dll", - runtimeVersion, - "Wascana MinGW Runtime DLL", - "http://downloads.sourceforge.net/mingw/mingwrt-3.15.2-mingw32-dll.tar.gz", - mingwSubdir, - GZ_COMPRESSION, - null, - publicDomainLic, - toolGroups); - - // MinGW Runtime Library - IInstallableUnit runtimeLibIU = createIU( - "wascana.mingw.mingwrt.lib", - runtimeVersion, - "Wascana MinGW Runtime Library", - "http://downloads.sourceforge.net/mingw/mingwrt-3.15.2-mingw32-dev.tar.gz", - mingwSubdir, - GZ_COMPRESSION, - new IRequiredCapability[] { - createStrictRequiredCap(runtimeDLLIU) - }, - publicDomainLic, - toolGroups); - - // w32api - IInstallableUnit w32apiIU = createIU( - "wascana.mingw.w32api", - new Version("3.13"), - "Wascana MinGW Windows Library", - "http://downloads.sourceforge.net/mingw/w32api-3.13-mingw32-dev.tar.gz", - mingwSubdir, - GZ_COMPRESSION, - null, - publicDomainLic, - toolGroups); - - // binutils - IInstallableUnit binutilsIU = createIU( - "wascana.mingw.binutils", - new Version("2.19.1"), - "Wascana MinGW binutils", - "http://downloads.sourceforge.net/mingw/binutils-2.19.1-mingw32-bin.tar.gz", - mingwSubdir, - GZ_COMPRESSION, - null, - gplLic, - toolGroups); - - // gcc-4 core - Version gcc4version = new Version("4.3.3.tdm-1"); - IInstallableUnit gcc4coreIU = createIU( - "wascana.mingw.tdm.gcc4.core", - gcc4version, - "Wascana MinGW TDM gcc-4 core", - "http://downloads.sourceforge.net/tdm-gcc/gcc-4.3.3-tdm-1-core.tar.gz", - mingwSubdir, - GZ_COMPRESSION, - new IRequiredCapability[] { - createRequiredCap(runtimeDLLIU), - createRequiredCap(runtimeLibIU), - createRequiredCap(w32apiIU), - createRequiredCap(binutilsIU) - }, - gplLic, - toolGroups); - - // gcc-4 g++ - IInstallableUnit gcc4gppIU = createIU( - "wascana.mingw.tdm.gcc4.g++", - gcc4version, - "Wascana MinGW TDM gcc-4 g++", - "http://downloads.sourceforge.net/tdm-gcc/gcc-4.3.3-tdm-1-g++.tar.gz", - mingwSubdir, - GZ_COMPRESSION, - new IRequiredCapability[] { - createStrictRequiredCap(gcc4coreIU) - }, - gplLic, - toolGroups); - - // gdb - IInstallableUnit gdbIU = createIU( - "wascana.mingw.gdb", - new Version("6.8.0.3"), - "Wascana MinGW gdb", - "http://downloads.sourceforge.net/mingw/gdb-6.8-mingw-3.tar.bz2", - mingwSubdir, - BZ2_COMPRESSION, - null, - gplLic, - toolGroups); - - InstallableUnitDescription toolchainIUDesc = createIUDesc( - "wascana.toolchain", - new Version("4.3.3"), // Same as gcc - "Wascana Toolchain (gcc, gdb, runtime libs)", - null); - toolchainIUDesc.setProperty(IInstallableUnit.PROP_TYPE_GROUP, Boolean.TRUE.toString()); - toolchainIUDesc.setRequiredCapabilities(new IRequiredCapability[] { - createRequiredCap(runtimeDLLIU), - createRequiredCap(runtimeLibIU), - createRequiredCap(w32apiIU), - createRequiredCap(binutilsIU), - createRequiredCap(gcc4coreIU), - createRequiredCap(gcc4gppIU), - createRequiredCap(gdbIU), - }); - IInstallableUnit toolchainIU = MetadataFactory.createInstallableUnit(toolchainIUDesc); - - // msys - IInstallableUnit msysIU = createIU( - "wascana.msys.core", - new Version("1.0.11.20080826"), - "Wascana Shell (MSYS)", - "http://downloads.sourceforge.net/mingw/msysCORE-1.0.11-20080826.tar.gz", - "msys", - GZ_COMPRESSION, - null, - gplLic, - true); - - // zlib - IInstallableUnit zlibIU = createIU( - "wascana.zlib", - new Version("1.2.3"), - "Wascana zlib Library", - "http://downloads.sourceforge.net/wascana/zlib-mingw-1.2.3.zip", - mingwSubdir, - ZIP_COMPRESSION, - null, - zlibLic, - true); - - // SDL - IInstallableUnit sdlIU = createIU( - "wascana.sdl", - new Version("1.2.13"), - "Wascana SDL (Simple Directmedia Layer) Library", - "http://downloads.sourceforge.net/wascana/SDL-mingw-1.2.13.zip", - mingwSubdir, - ZIP_COMPRESSION, - null, - lgplLic, - true); - - // wxWidgets - IInstallableUnit wxIU = createIU( - "wascana.wxWidgets", - new Version("2.8.9"), - "Wascana wxWidgets Library", - "http://downloads.sourceforge.net/wascana/wxMSW-mingw-2.8.9.zip", - mingwSubdir, - ZIP_COMPRESSION, - null, - wxLic, - true); - - InstallableUnitDescription libsIUDesc = createIUDesc( - "wascana.libraries", - wascanaVersion, - "Wascana Libraries", - null); - libsIUDesc.setProperty(IInstallableUnit.PROP_TYPE_CATEGORY, Boolean.TRUE.toString()); - libsIUDesc.setRequiredCapabilities(new IRequiredCapability[] { - createRequiredCap(zlibIU), - createRequiredCap(sdlIU), - createRequiredCap(wxIU), - }); - IInstallableUnit libsIU = MetadataFactory.createInstallableUnit(libsIUDesc); - - // Libraries toolchain category - InstallableUnitDescription wascanaIUDesc = createIUDesc("wascana", wascanaVersion, "Wascana Desktop Developer", null);; - wascanaIUDesc.setProperty(IInstallableUnit.PROP_TYPE_CATEGORY, Boolean.TRUE.toString()); - wascanaIUDesc.setRequiredCapabilities(new IRequiredCapability[] { - createRequiredCap(toolchainIU), - createRequiredCap(msysIU), - createRequiredCap(libsIU), - }); - IInstallableUnit wascanaIU = MetadataFactory.createInstallableUnit(wascanaIUDesc); - - metaRepo.addInstallableUnits(new IInstallableUnit[] { - runtimeDLLIU, - runtimeLibIU, - w32apiIU, - binutilsIU, - gcc4coreIU, - gcc4gppIU, - gdbIU, - msysIU, - - toolchainIU, - - wxIU, - zlibIU, - sdlIU, - - libsIU, - - wascanaIU - }); - - System.out.println("done"); - - return EXIT_OK; - } - - @Override - public void stop() { - } - - private InstallableUnitDescription createIUDesc(String id, Version version, String name, ILicense license) throws ProvisionException { - InstallableUnitDescription iuDesc = new MetadataFactory.InstallableUnitDescription(); - iuDesc.setId(id); - iuDesc.setVersion(version); - iuDesc.setLicense(license); - iuDesc.setSingleton(true); - iuDesc.setProperty(IInstallableUnit.PROP_NAME, name); - iuDesc.setCapabilities(new IProvidedCapability[] { - MetadataFactory.createProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, id, version) - }); - iuDesc.setUpdateDescriptor(MetadataFactory.createUpdateDescriptor(id, new VersionRange(null), IUpdateDescriptor.NORMAL, "")); - return iuDesc; - } - - private IInstallableUnit createIU(String id, Version version, String name, String location, String subdir, String compression, - IRequiredCapability[] reqs, ILicense license, boolean group) throws ProvisionException { - InstallableUnitDescription iuDesc = createIUDesc(id, version, name, license); - if (reqs != null) - iuDesc.setRequiredCapabilities(reqs); - - iuDesc.setProperty(IInstallableUnit.PROP_TYPE_GROUP, String.valueOf(group)); - iuDesc.setTouchpointType(NATIVE_TOUCHPOINT); - Map<String, String> tpdata = new HashMap<String, String>(); - - String cmd, uncmd; - if (compression.equals(ZIP_COMPRESSION)) { - cmd = "unzip(source:@artifact, target:${installFolder}/" + subdir + ");"; - uncmd = "cleanupzip(source:@artifact, target:${installFolder}/" + subdir + ");"; - } else { - cmd = "untar(source:@artifact, target:${installFolder}/" + subdir - + ", compression:" + compression + ");"; - uncmd = "cleanup" + cmd; - } - - tpdata.put("install", cmd); - tpdata.put("uninstall", uncmd); - - iuDesc.addTouchpointData(MetadataFactory.createTouchpointData(tpdata)); - IArtifactKey artiKey = PublisherHelper.createBinaryArtifactKey(id, version); - ArtifactDescriptor artiDesc = new ArtifactDescriptor(artiKey); - artiDesc.setRepositoryProperty("artifact.reference", location); - artiRepo.addDescriptor(artiDesc); - iuDesc.setArtifacts(new IArtifactKey[] { artiKey }); - return MetadataFactory.createInstallableUnit(iuDesc); - } - - private IRequiredCapability createRequiredCap(IInstallableUnit iu) { - return MetadataFactory.createRequiredCapability( - IInstallableUnit.NAMESPACE_IU_ID, - iu.getId(), new VersionRange(null), null, false, false); - } - - private IRequiredCapability createStrictRequiredCap(IInstallableUnit iu) { - return MetadataFactory.createRequiredCapability( - IInstallableUnit.NAMESPACE_IU_ID, - iu.getId(), new VersionRange(iu.getVersion(), true, iu.getVersion(), true), null, false, false); - } - // TODO make these more legal... - - public static final String publicDomain = "This package is placed in the Public Domain." - + " No warranty is given; refer to the header files within the package."; - - public static final String gplURL = "http://www.gnu.org/copyleft/gpl.html"; - - public static final String gpl = "GNU GENERAL PUBLIC LICENSE\n" + gplURL; - - public static final String lgplURL = "http://www.gnu.org/copyleft/lesser.html"; - - public static final String lgpl = "GNU LESSER GENERAL PUBLIC LICENSE\n" + lgplURL; - - public static final String zlibLicURL = "http://www.zlib.net/zlib_license.html"; - - public static final String zlibLicText = "http://www.zlib.net/zlib_license.html"; - - public static final String wxLicURL = "http://www.wxwidgets.org/about/newlicen.htm"; - - public static final String wxLicText = "wxWindows license\n" + wxLicURL; - -} diff --git a/windows/org.eclipse.cdt.msw.build/.classpath b/windows/org.eclipse.cdt.msw.build/.classpath deleted file mode 100644 index 751c8f2e504..00000000000 --- a/windows/org.eclipse.cdt.msw.build/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/windows/org.eclipse.cdt.msw.build/.cvsignore b/windows/org.eclipse.cdt.msw.build/.cvsignore deleted file mode 100644 index ba077a4031a..00000000000 --- a/windows/org.eclipse.cdt.msw.build/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/windows/org.eclipse.cdt.msw.build/.project b/windows/org.eclipse.cdt.msw.build/.project deleted file mode 100644 index e97910dcff7..00000000000 --- a/windows/org.eclipse.cdt.msw.build/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.cdt.msw.build</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> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/windows/org.eclipse.cdt.msw.build/.settings/org.eclipse.jdt.core.prefs b/windows/org.eclipse.cdt.msw.build/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0f0eb3002b3..00000000000 --- a/windows/org.eclipse.cdt.msw.build/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Mon Jul 23 15:38:07 EDT 2007 -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.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/windows/org.eclipse.cdt.msw.build/META-INF/MANIFEST.MF b/windows/org.eclipse.cdt.msw.build/META-INF/MANIFEST.MF deleted file mode 100644 index 492bcb702be..00000000000 --- a/windows/org.eclipse.cdt.msw.build/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: MSVC Build Integration Plug-in -Bundle-SymbolicName: org.eclipse.cdt.msw.build;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: org.eclipse.cdt.msw.build.Activator -Bundle-Localization: plugin -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.cdt.core, - org.eclipse.cdt.managedbuilder.core -Eclipse-LazyStart: true -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/windows/org.eclipse.cdt.msw.build/build.properties b/windows/org.eclipse.cdt.msw.build/build.properties deleted file mode 100644 index 30b2fc40bd8..00000000000 --- a/windows/org.eclipse.cdt.msw.build/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - plugin.xml diff --git a/windows/org.eclipse.cdt.msw.build/plugin.properties b/windows/org.eclipse.cdt.msw.build/plugin.properties deleted file mode 100644 index 05150db9042..00000000000 --- a/windows/org.eclipse.cdt.msw.build/plugin.properties +++ /dev/null @@ -1,9 +0,0 @@ -toolchain.name=Microsoft Visual C++ - -compiler.name=C/C++ Compiler (cl) -rc.name=Resource Compiler (rc) -linker.name=Linker (link) -lib.name=Library Manager (lib) - -config.debug=Debug -config.release=Release
\ No newline at end of file diff --git a/windows/org.eclipse.cdt.msw.build/plugin.xml b/windows/org.eclipse.cdt.msw.build/plugin.xml deleted file mode 100644 index 982f0a87212..00000000000 --- a/windows/org.eclipse.cdt.msw.build/plugin.xml +++ /dev/null @@ -1,658 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.2"?> -<plugin> - <extension - point="org.eclipse.cdt.managedbuilder.core.buildDefinitions"> - <managedBuildRevision fileVersion="4.0.0"/> - <toolChain - archList="all" - configurationEnvironmentSupplier="org.eclipse.cdt.msw.build.WinEnvironmentVariableSupplier" - id="org.eclipse.cdt.msvc.toolchain.base" - isAbstract="true" - name="%toolchain.name" - osList="win32" - targetTool="org.eclipse.cdt.msvc.link;org.eclipse.cdt.msvc.lib"> - <targetPlatform - archList="all" - binaryParser="org.eclipse.cdt.core.PE" - id="org.eclipse.cdt.msvc.targetPlatform" - osList="win32"> - </targetPlatform> - <builder - id="org.eclipse.cdt.msvc.builder" - isVariableCaseSensitive="false" - superClass="org.eclipse.cdt.build.core.internal.builder"> - </builder> - <tool - command="cl /c" - errorParsers="org.eclipse.cdt.core.VCErrorParser" - id="org.eclipse.cdt.msvc.cl" - name="%compiler.name" - natureFilter="both" - outputFlag="/Fo"> - <supportedProperties> - <property - id="org.eclipse.cdt.build.core.buildType"> - <value - id="org.eclipse.cdt.build.core.buildType.debug"> - </value> - <value - id="org.eclipse.cdt.build.core.buildType.release"> - </value> - </property> - </supportedProperties> - <optionCategory - id="org.eclipse.cdt.msvc.cl.optionCategory.optimization" - name="Optimization"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.optimization" - id="org.eclipse.cdt.msvc.cl.option.optimization" - name="Optimization" - resourceFilter="all" - valueType="enumerated"> - <enumeratedOptionValue - id="org.eclipse.cdt.msvc.cl.option.optimization.default" - isDefault="false" - name="Default"/> - <enumeratedOptionValue - command="/O1" - id="org.eclipse.cdt.msvc.cl.option.optimization.1" - isDefault="false" - name="Minimize Size (/O1)"/> - <enumeratedOptionValue - command="/O2" - id="org.eclipse.cdt.msvc.cl.option.optimization.2" - isDefault="true" - name="Maximize Speed (/O2)"/> - <enablement - attribute="value" - extensionAdjustment="false" - type="CONTAINER_ATTRIBUTE" - value="org.eclipse.cdt.msvc.cl.option.optimization.2"> - <checkBuildProperty - property="org.eclipse.cdt.build.core.buildType" - value="org.eclipse.cdt.build.core.buildType.release"> - </checkBuildProperty> - </enablement> - <enablement - attribute="value" - extensionAdjustment="false" - type="CONTAINER_ATTRIBUTE" - value="org.eclipse.cdt.msvc.cl.option.optimization.default"> - <checkBuildProperty - property="org.eclipse.cdt.build.core.buildType" - value="org.eclipse.cdt.build.core.buildType.debug"> - </checkBuildProperty> - </enablement> - </option> - <optionCategory - id="org.eclipse.cdt.msvc.cl.optionCategory.codegen" - name="Code Generation"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.codegen" - id="org.eclipse.cdt.msvc.cl.option.arch" - name="Minimum CPU Architecture" - resourceFilter="all" - valueType="enumerated"> - <enumeratedOptionValue - id="org.eclipse.cdt.msvc.cl.option.arch.default" - isDefault="true" - name="Default"/> - <enumeratedOptionValue - command="/arch:SSE" - id="org.eclipse.cdt.msvc.cl.option.arch.sse" - isDefault="false" - name="SSE (/arch:SSE)"/> - <enumeratedOptionValue - id="org.eclipse.cdt.msvc.cl.option.arch.sse2" - isDefault="false" - name="SSE2 (/arch:SSE2)"/> - </option> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.codegen" - command="/clr" - defaultValue="false" - id="org.eclipse.cdt.msvc.cl.option.clr" - name="Common Language Runtime (/clr)" - resourceFilter="all" - valueType="boolean"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.codegen" - command="/EHs" - defaultValue="true" - id="org.eclipse.cdt.msvc.cl.option.exceptions" - name="Enable C++ Exception Handling (/EHs)" - resourceFilter="all" - valueType="boolean"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.codegen" - commandFalse="/GR-" - defaultValue="true" - id="org.eclipse.cdt.msvc.cl.option.rtti" - name="Enable Run-Time Type Information (/GR)" - resourceFilter="all" - valueType="boolean"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.codegen" - id="org.eclipse.cdt.msvc.cl.option.runtime" - name="Run-Time Library" - resourceFilter="all" - valueType="enumerated"> - <enumeratedOptionValue - command="/MT" - id="org.eclipse.cdt.msvc.cl.option.runtime.mt" - isDefault="false" - name="Multi-Threaded Static (/MT)"/> - <enumeratedOptionValue - command="/MTd" - id="org.eclipse.cdt.msvc.cl.option.runtime.mtd" - isDefault="false" - name="Multi-Threaded Static Debug (/MTd)"/> - <enumeratedOptionValue - command="/MD" - id="org.eclipse.cdt.msvc.cl.option.runtime.md" - isDefault="true" - name="Multi-Threaded DLL (/MD)"/> - <enumeratedOptionValue - command="/MDd" - id="org.eclipse.cdt.msvc.cl.option.runtime.mdd" - isDefault="false" - name="Multi-Threaded DLL Debug (/MDd)"/> - </option> - <optionCategory - id="org.eclipse.cdt.msvc.cl.optionCategory.debug" - name="Debugging"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.debug" - id="org.eclipse.cdt.msvc.cl.option.debugFormat" - name="Debug Information Format" - resourceFilter="all" - valueType="enumerated"> - <enumeratedOptionValue - id="org.eclipse.cdt.msvc.cl.option.debugFormat.none" - isDefault="true" - name="None"/> - <enumeratedOptionValue - command="/Z7" - id="org.eclipse.cdt.msvc.cl.option.debugFormat.c7" - isDefault="false" - name="C7 Compatible (/Z7)"/> - <enumeratedOptionValue - command="/Zi" - id="org.eclipse.cdt.msvc.cl.option.debugFormat.complete" - isDefault="false" - name="Complete (/Zi)"/> - <enablement - attribute="value" - extensionAdjustment="false" - type="CONTAINER_ATTRIBUTE" - value="org.eclipse.cdt.msvc.cl.option.debugFormat.none"> - <checkBuildProperty - property="org.eclipse.cdt.build.core.buildType" - value="org.eclipse.cdt.build.core.buildType.release"> - </checkBuildProperty> - </enablement> - <enablement - attribute="value" - extensionAdjustment="false" - type="CONTAINER_ATTRIBUTE" - value="org.eclipse.cdt.msvc.cl.option.debugFormat.complete"> - <checkBuildProperty - property="org.eclipse.cdt.build.core.buildType" - value="org.eclipse.cdt.build.core.buildType.debug"> - </checkBuildProperty> - </enablement> - </option> - <optionCategory - id="org.eclipse.cdt.msvc.cl.optionCategory.preprocessor" - name="Preprocessor"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.preprocessor" - command="/D" - id="org.eclipse.cdt.msvc.cl.option.macros" - name="Defines (/D)" - resourceFilter="all" - valueType="definedSymbols"/> - <option - browseType="directory" - category="org.eclipse.cdt.msvc.cl.optionCategory.preprocessor" - command="/I" - id="org.eclipse.cdt.msvc.cl.option.includes" - name="Include Path (/I)" - resourceFilter="all" - valueType="includePath"/> - <optionCategory - id="org.eclipse.cdt.msvc.cl.optionCategory.language" - name="Language"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.language" - command="/openmp" - defaultValue="false" - id="org.eclipse.cdt.msvc.cl.option.openmp" - name="Enable OpenMP (/openmp)" - resourceFilter="all" - valueType="boolean"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.language" - commandFalse="/Za" - defaultValue="true" - id="org.eclipse.cdt.msvc.cl.option.langExtensions" - name="Enable Language Extensions (/Ze,/Za)" - resourceFilter="all" - valueType="boolean"/> - <optionCategory - id="org.eclipse.cdt.msvc.cl.optionCategory.miscellaneous" - name="Miscellaneous"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.miscellaneous" - command="/nologo" - defaultValue="true" - id="org.eclipse.cdt.msvc.cl.option.nologo" - name="Suppress Banner (/nologo)" - resourceFilter="all" - valueType="boolean"/> - <option - category="org.eclipse.cdt.msvc.cl.optionCategory.miscellaneous" - id="org.eclipse.cdt.msvc.cl.option.others" - name="Other Options" - resourceFilter="all" - valueType="stringList"/> - <inputType - dependencyContentType="org.eclipse.cdt.core.cxxHeader" - id="org.eclipse.cdt.msvc.cl.inputType" - scannerConfigDiscoveryProfileId="org.eclipse.cdt.msw.build.clScannerInfo" - sourceContentType="org.eclipse.cdt.core.cxxSource"> - </inputType> - <outputType - id="org.eclipse.cdt.msvc.cl.outputType" - outputs="obj"> - </outputType> - </tool> - <tool - command="rc" - errorParsers="org.eclipse.cdt.core.VCErrorParser" - id="org.eclipse.cdt.msvc.rc" - name="%rc.name" - natureFilter="both" - outputFlag="/Fo" - > - <optionCategory - id="org.eclipse.cdt.msvc.rc.optionCategory.preprocessor" - name="Preprocessor"/> - <option - browseType="directory" - category="org.eclipse.cdt.msvc.rc.optionCategory.preprocessor" - command="/I" - id="org.eclipse.cdt.msvc.rc.option.includes" - name="Include Path (/I)" - resourceFilter="all" - valueType="includePath"/> - <option - category="org.eclipse.cdt.msvc.rc.optionCategory.preprocessor" - command="/D" - id="org.eclipse.cdt.msvc.rc.option.defines" - name="Defines (/D)" - resourceFilter="all" - valueType="definedSymbols"/> - <optionCategory - id="org.eclipse.cdt.msvc.rc.optionCategory.misc" - name="Miscellaneous"/> - <option - category="org.eclipse.cdt.msvc.rc.optionCategory.misc" - id="org.eclipse.cdt.msvc.rc.option.others" - name="Other Options" - resourceFilter="all" - valueType="stringList"/> - <inputType - id="org.eclipse.cdt.msvc.rc.inputType" - sources="rc"> - </inputType> - <outputType - id="org.eclipse.cdt.msvc.rc.outputType" - outputs="res"> - </outputType> - </tool> - <tool - command="link" - errorParsers="org.eclipse.cdt.core.VCErrorParser" - id="org.eclipse.cdt.msvc.link" - name="%linker.name" - natureFilter="both" - outputFlag="/OUT:" - > - <supportedProperties> - <property - id="org.eclipse.cdt.build.core.buildArtefactType"> - <value - id="org.eclipse.cdt.build.core.buildArtefactType.exe"></value> - <value - id="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"> - </value> - </property> - </supportedProperties> - <option - command="/DLL" - defaultValue="false" - id="org.eclipse.cdt.msvc.link.option.dll" - name="Build a DLL" - resourceFilter="all" - valueType="boolean"> - <enablement - attribute="defaultValue" - extensionAdjustment="false" - type="CONTAINER_ATTRIBUTE" - value="true"> - <checkBuildProperty - property="org.eclipse.cdt.build.core.buildArtefactType" - value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"> - </checkBuildProperty> - </enablement> - </option> - <optionCategory - id="org.eclipse.cdt.msvc.link.optionCategory.general" - name="General"/> - <option - category="org.eclipse.cdt.msvc.link.optionCategory.general" - command="/debug" - defaultValue="false" - id="org.eclipse.cdt.msvc.link.option.debug" - name="Generate Debug Info (/debug)" - resourceFilter="all" - valueType="boolean"> - <enablement - attribute="value" - type="CONTAINER_ATTRIBUTE" - value="true"> - <checkBuildProperty - property="org.eclipse.cdt.build.core.buildType" - value="org.eclipse.cdt.build.core.buildType.debug"> - </checkBuildProperty> - </enablement> - </option> - <option - category="org.eclipse.cdt.msvc.link.optionCategory.general" - command="/nologo" - defaultValue="true" - id="org.eclipse.cdt.msvc.link.option.nologo" - name="Suppress Banner (/nologo)" - resourceFilter="all" - valueType="boolean"/> - <option - category="org.eclipse.cdt.msvc.link.optionCategory.general" - id="org.eclipse.cdt.msvc.link.option.others" - name="Other Options" - resourceFilter="all" - valueType="stringList"/> - <optionCategory - id="org.eclipse.cdt.msvc.link.optionCategory.libraries" - name="Libraries"/> - <option - browseType="directory" - category="org.eclipse.cdt.msvc.link.optionCategory.libraries" - command="/libpath:" - id="org.eclipse.cdt.msvc.link.option.libpath" - name="Additional Libpath (/libpath)" - resourceFilter="all" - valueType="stringList"/> - <option - browseType="file" - category="org.eclipse.cdt.msvc.link.optionCategory.libraries" - id="org.eclipse.cdt.msvc.link.option.libraries" - name="Libraries" - resourceFilter="all" - valueType="libs"/> - <inputType - id="org.eclipse.cdt.msvc.link.inputType" - multipleOfType="true" - sources="res,obj"> - </inputType> - <outputType - id="org.eclipse.cdt.msvc.link.outputType" - outputs="exe"> - </outputType> - <outputType - id="org.eclipse.cdt.msvc.link.outputType.dll" - outputs="dll"> - </outputType> - </tool> - <tool - command="lib" - id="org.eclipse.cdt.msvc.lib" - name="%lib.name" - natureFilter="both" - outputFlag="/OUT:" - > - <supportedProperties> - <property - id="org.eclipse.cdt.build.core.buildArtefactType"> - <value - id="org.eclipse.cdt.build.core.buildArtefactType.staticLib"> - </value> - </property> - </supportedProperties> - <optionCategory - id="org.eclipse.cdt.msvc.lib.optionCategory.general" - name="General"/> - <option - category="org.eclipse.cdt.msvc.lib.optionCategory.general" - command="/nologo" - defaultValue="true" - id="org.eclipse.cdt.msvc.lib.option.nologo" - name="Suppress Banner (/nologo)" - resourceFilter="all" - valueType="boolean"/> - <inputType - id="org.eclipse.cdt.msvc.lib.inputType" - sources="obj,res"> - </inputType> - <outputType - id="org.eclipse.cdt.msvc.lib.outputType" - outputs="lib"> - </outputType> - </tool> - </toolChain> - <configuration - artifactExtension="exe" - id="org.eclipse.cdt.msvc.configuration"> - <enablement - attribute="artifactExtension" - extensionAdjustment="false" - type="CONTAINER_ATTRIBUTE" - value="dll"> - <checkBuildProperty - property="org.eclipse.cdt.build.core.buildArtefactType" - value="org.eclipse.cdt.build.core.buildArtefactType.sharedLib"></checkBuildProperty> - </enablement> - <enablement - attribute="artifactExtension" - extensionAdjustment="false" - type="CONTAINER_ATTRIBUTE" - value="lib"> - <checkBuildProperty - property="org.eclipse.cdt.build.core.buildArtefactType" - value="org.eclipse.cdt.build.core.buildArtefactType.staticLib"></checkBuildProperty> - </enablement> - </configuration> - <projectType - buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" - id="org.eclipse.cdt.msvc.projectType.exe" - projectEnvironmentSupplier="org.eclipse.cdt.msw.build.WinEnvironmentVariableSupplier"> - <configuration - buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" - id="org.eclipse.cdt.msvc.exe.debug" - name="%config.debug" - parent="org.eclipse.cdt.msvc.configuration"> - <toolChain - id="org.eclipse.cdt.msvc.toolchain.exe.debug" - superClass="org.eclipse.cdt.msvc.toolchain.base"> - <targetPlatform - id="org.eclipse.cdt.msvc.targetPlatform.exe.debug" - superClass="org.eclipse.cdt.msvc.targetPlatform"> - </targetPlatform> - <tool - id="org.eclipse.cdt.msvc.cl.exe.debug" - superClass="org.eclipse.cdt.msvc.cl"> - </tool> - <tool - id="org.eclipse.cdt.msvc.rc.exe.debug" - superClass="org.eclipse.cdt.msvc.rc"> - </tool> - <tool - id="org.eclipse.cdt.msvc.link.exe.debug" - superClass="org.eclipse.cdt.msvc.link"> - </tool> - </toolChain> - </configuration> - <configuration - buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" - id="org.eclipse.cdt.msvc.exe.release" - name="%config.release" - parent="org.eclipse.cdt.msvc.configuration"> - <toolChain - id="org.eclipse.cdt.msvc.toolchain.exe.release" - superClass="org.eclipse.cdt.msvc.toolchain.base"> - <targetPlatform - id="org.eclipse.cdt.msvc.targetPlatform.exe.release" - superClass="org.eclipse.cdt.msvc.targetPlatform"> - </targetPlatform> - <tool - id="org.eclipse.cdt.msvc.cl.exe.release" - superClass="org.eclipse.cdt.msvc.cl"> - </tool> - <tool - id="org.eclipse.cdt.msvc.rc.exe.release" - superClass="org.eclipse.cdt.msvc.rc"> - </tool> - <tool - id="org.eclipse.cdt.msvc.link.exe.release" - superClass="org.eclipse.cdt.msvc.link"> - </tool> - </toolChain> - </configuration> - </projectType> - <projectType - buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" - id="org.eclipse.cdt.msvc.projectType.dll" - projectEnvironmentSupplier="org.eclipse.cdt.msw.build.WinEnvironmentVariableSupplier"> - <configuration - buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" - id="org.eclipse.cdt.msvc.dll.debug" - name="%config.debug" - parent="org.eclipse.cdt.msvc.configuration"> - <toolChain - id="org.eclipse.cdt.msvc.toolchain.dll.debug" - superClass="org.eclipse.cdt.msvc.toolchain.base"> - <targetPlatform - id="org.eclipse.cdt.msvc.targetPlatform.dll.debug" - superClass="org.eclipse.cdt.msvc.targetPlatform"> - </targetPlatform> - <tool - id="org.eclipse.cdt.msvc.cl.dll.debug" - superClass="org.eclipse.cdt.msvc.cl"> - </tool> - <tool - id="org.eclipse.cdt.msvc.rc.dll.debug" - superClass="org.eclipse.cdt.msvc.rc"> - </tool> - <tool - id="org.eclipse.cdt.msvc.link.dll.debug" - superClass="org.eclipse.cdt.msvc.link"> - </tool> - </toolChain> - </configuration> - <configuration - buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" - id="org.eclipse.cdt.msvc.dll.release" - name="%config.release" - parent="org.eclipse.cdt.msvc.configuration"> - <toolChain - id="org.eclipse.cdt.msvc.toolchain.dll.release" - superClass="org.eclipse.cdt.msvc.toolchain.base"> - <targetPlatform - id="org.eclipse.cdt.msvc.targetPlatform.dll.release" - superClass="org.eclipse.cdt.msvc.targetPlatform"> - </targetPlatform> - <tool - id="org.eclipse.cdt.msvc.cl.dll.release" - superClass="org.eclipse.cdt.msvc.cl"> - </tool> - <tool - id="org.eclipse.cdt.msvc.rc.dll.release" - superClass="org.eclipse.cdt.msvc.rc"> - </tool> - <tool - id="org.eclipse.cdt.msvc.link.dll.release" - superClass="org.eclipse.cdt.msvc.link"> - </tool> - </toolChain> - </configuration> - </projectType> - <projectType - buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" - id="org.eclipse.cdt.msvc.projectType.lib" - projectEnvironmentSupplier="org.eclipse.cdt.msw.build.WinEnvironmentVariableSupplier"> - <configuration - buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" - id="org.eclipse.cdt.msvc.lib.debug" - name="%config.debug" - parent="org.eclipse.cdt.msvc.configuration"> - <toolChain - id="org.eclipse.cdt.msvc.toolchain.lib.debug" - superClass="org.eclipse.cdt.msvc.toolchain.base"> - <targetPlatform - id="org.eclipse.cdt.msvc.targetPlatform.lib.debug" - superClass="org.eclipse.cdt.msvc.targetPlatform"> - </targetPlatform> - <tool - id="org.eclipse.cdt.msvc.cl.lib.debug" - superClass="org.eclipse.cdt.msvc.cl"> - </tool> - <tool - id="org.eclipse.cdt.msvc.rc.lib.debug" - superClass="org.eclipse.cdt.msvc.rc"> - </tool> - <tool - id="org.eclipse.cdt.msvc.lib.lib.debug" - superClass="org.eclipse.cdt.msvc.lib"> - </tool> - </toolChain> - </configuration> - <configuration - buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" - id="org.eclipse.cdt.msvc.lib.release" - name="%config.release" - parent="org.eclipse.cdt.msvc.configuration"> - <toolChain - id="org.eclipse.cdt.msvc.toolchain.lib.release" - superClass="org.eclipse.cdt.msvc.toolchain.base"> - <targetPlatform - id="org.eclipse.cdt.msvc.targetPlatform.lib.release" - superClass="org.eclipse.cdt.msvc.targetPlatform"> - </targetPlatform> - <tool - id="org.eclipse.cdt.msvc.cl.lib.release" - superClass="org.eclipse.cdt.msvc.cl"> - </tool> - <tool - id="org.eclipse.cdt.msvc.rc.lib.release" - superClass="org.eclipse.cdt.msvc.rc"> - </tool> - <tool - id="org.eclipse.cdt.msvc.lib.lib.release" - superClass="org.eclipse.cdt.msvc.lib"> - </tool> - </toolChain> - </configuration> - </projectType> - </extension> - <extension - id="clScannerInfo" - name="Windows SDK Scanner Info Provider" - point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile"> - <scannerInfoCollector - class="org.eclipse.cdt.msw.build.WinScannerInfoCollector" - scope="project"> - </scannerInfoCollector> - </extension> - -</plugin> diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/Activator.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/Activator.java deleted file mode 100644 index c9e6ca453fb..00000000000 --- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.cdt.msw.build; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "net.sf.wascana.msvc.build"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#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/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java deleted file mode 100644 index baae87bd6aa..00000000000 --- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinDiscoveredPathInfo.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.eclipse.cdt.msw.build; - - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo; -import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -/** - * @author Doug Schaefer - * - */ -public class WinDiscoveredPathInfo implements IDiscoveredPathInfo { - - private final IPath[] paths; - private final Map<String, String> symbols = new HashMap<String, String>(); - - public WinDiscoveredPathInfo() { - // Include paths - String sdkDir = WinEnvironmentVariableSupplier.getSDKDir(); - if (sdkDir != null) { - String vcDir = WinEnvironmentVariableSupplier.getVCDir(); - paths = new IPath[] { - new Path(vcDir.concat("Include")), - new Path(vcDir.concat("Include\\Sys")), - new Path(sdkDir.concat("Include")), - new Path(sdkDir.concat("Include\\gl")) - }; - } else - paths = new IPath[0]; - - symbols.put("_M_IX86", "600"); - symbols.put("_WIN32", "1"); - symbols.put("_MSC_VER", "1400"); - } - - public IPath[] getIncludePaths() { - return paths; - } - - public IProject getProject() { - return null; - } - - public IDiscoveredScannerInfoSerializable getSerializable() { - return null; - } - - public Map<String, String> getSymbols() { - return symbols; - } - -} diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java deleted file mode 100644 index e759581b15d..00000000000 --- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinEnvironmentVariableSupplier.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.eclipse.cdt.msw.build; - - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IManagedProject; -import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable; -import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier; -import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider; -import org.eclipse.cdt.managedbuilder.envvar.IProjectEnvironmentVariableSupplier; -import org.eclipse.cdt.utils.WindowsRegistry; - -/** - * @author DSchaefer - * - */ -public class WinEnvironmentVariableSupplier - implements IConfigurationEnvironmentVariableSupplier, IProjectEnvironmentVariableSupplier { - - private Map<String, IBuildEnvironmentVariable> envvars; - - private static class WindowsBuildEnvironmentVariable implements IBuildEnvironmentVariable { - - private final String name; - private final String value; - private final int operation; - - public WindowsBuildEnvironmentVariable(String name, String value, int operation) { - this.name = name; - this.value = value; - this.operation = operation; - } - - public String getDelimiter() { - return ";"; - } - - public String getName() { - return name; - } - - public String getValue() { - return value; - } - - public int getOperation() { - return operation; - } - - } - - public IBuildEnvironmentVariable getVariable(String variableName, - IManagedProject project, IEnvironmentVariableProvider provider) { - if (envvars == null) - initvars(); - return envvars.get(variableName); - } - - public IBuildEnvironmentVariable getVariable(String variableName, - IConfiguration configuration, IEnvironmentVariableProvider provider) { - if (envvars == null) - initvars(); - return envvars.get(variableName); - } - - public IBuildEnvironmentVariable[] getVariables(IManagedProject project, - IEnvironmentVariableProvider provider) { - if (envvars == null) - initvars(); - return envvars.values().toArray(new IBuildEnvironmentVariable[envvars.size()]); - } - - public IBuildEnvironmentVariable[] getVariables( - IConfiguration configuration, IEnvironmentVariableProvider provider) { - if (envvars == null) - initvars(); - return envvars.values().toArray(new IBuildEnvironmentVariable[envvars.size()]); - } - - private void addvar(IBuildEnvironmentVariable var) { - envvars.put(var.getName(), var); - } - - public static String getSDKDir() { - WindowsRegistry reg = WindowsRegistry.getRegistry(); - - String[] keys = { - "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.1", - "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0A", - "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0", - }; - - for (int i = 0; i < keys.length; ++i) { - String sdkDir = reg.getLocalMachineValue(keys[i], "InstallationFolder"); - if (sdkDir != null) - return sdkDir; - } - - return null; - } - - public static String getVCDir() { - WindowsRegistry reg = WindowsRegistry.getRegistry(); - - String vcDir = reg.getLocalMachineValue("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7", "9.0"); - if (vcDir != null) - return vcDir; - - // Try full SDK with compiler - String sdkDir = getSDKDir(); - if (sdkDir != null) - return sdkDir.concat("VC\\"); - - return null; - } - - public static String getVSDir() { - WindowsRegistry reg = WindowsRegistry.getRegistry(); - return reg.getLocalMachineValue("SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7", "9.0"); - } - - private void initvars() { - envvars = new HashMap<String, IBuildEnvironmentVariable>(); - - // The SDK Location - String sdkDir = getSDKDir(); - if (sdkDir == null) - return; - - String vcDir = getVCDir(); - - // INCLUDE - StringBuffer buff = new StringBuffer(); - buff.append(vcDir).append("Include;"); - buff.append(vcDir).append("Include\\Sys;"); - buff.append(sdkDir).append("Include;"); - buff.append(sdkDir).append("Include\\gl;"); - addvar(new WindowsBuildEnvironmentVariable("INCLUDE", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND)); - - // LIB - buff = new StringBuffer(); - buff.append(vcDir).append("Lib;"); - buff.append(sdkDir).append("Lib;"); - addvar(new WindowsBuildEnvironmentVariable("LIB", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND)); - - // PATH - buff = new StringBuffer(); - - String vsDir = getVSDir(); - if (vsDir != null) - buff.append(vsDir).append("Common7\\IDE;"); - - buff.append(vcDir).append("Bin;"); - buff.append(sdkDir).append("Bin;"); - addvar(new WindowsBuildEnvironmentVariable("PATH", buff.toString(), IBuildEnvironmentVariable.ENVVAR_PREPEND)); - } - -} diff --git a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinScannerInfoCollector.java b/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinScannerInfoCollector.java deleted file mode 100644 index e955c512026..00000000000 --- a/windows/org.eclipse.cdt.msw.build/src/org/eclipse/cdt/msw/build/WinScannerInfoCollector.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.eclipse.cdt.msw.build; - - -import java.util.List; -import java.util.Map; - -import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3; -import org.eclipse.cdt.make.core.scannerconfig.InfoContext; -import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes; -import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -/** - * @author Doug Schaefer - * - */ -public class WinScannerInfoCollector implements IScannerInfoCollector3 { - - public void contributeToScannerConfig(Object resource, Map scannerInfo) { - } - - public List getCollectedScannerInfo(Object resource, ScannerInfoTypes type) { - return null; - } - - public IDiscoveredPathInfo createPathInfoObject() { - return new WinDiscoveredPathInfo(); - } - - public void setInfoContext(InfoContext context) { - } - - public void setProject(IProject project) { - } - - public void updateScannerConfiguration(IProgressMonitor monitor) throws CoreException { - } - -} |