diff options
author | Elliott Baron <ebaron@fedoraproject.org> | 2009-08-25 21:01:56 -0400 |
---|---|---|
committer | Elliott Baron <ebaron@fedoraproject.org> | 2009-08-25 21:01:56 -0400 |
commit | 0c290ae7eabb8cb32e1eb28f55cceb9e6350d596 (patch) | |
tree | ca8dda9f30ed2be55b5f06cbf59c3d29e82a8832 /org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui | |
download | codan-0c290ae7eabb8cb32e1eb28f55cceb9e6350d596.tar.gz codan-0c290ae7eabb8cb32e1eb28f55cceb9e6350d596.tar.xz codan-0c290ae7eabb8cb32e1eb28f55cceb9e6350d596.zip |
Initial commit: New file.
* .gitignore: New file.
* org.eclipse.cdt.codan.checkers.ui/.classpath: New file.
* org.eclipse.cdt.codan.checkers.ui/.project: New file.
* org.eclipse.cdt.codan.checkers.ui/.settings/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/.settings/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/.settings/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/.settings/org.eclipse.jdt.core.prefs: New file.
* org.eclipse.cdt.codan.checkers.ui/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/CVS/Template: New file.
* org.eclipse.cdt.codan.checkers.ui/META-INF/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/META-INF/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/META-INF/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/META-INF/MANIFEST.MF: New file.
* org.eclipse.cdt.codan.checkers.ui/build.properties: New file.
* org.eclipse.cdt.codan.checkers.ui/plugin.xml: New file.
* org.eclipse.cdt.codan.checkers.ui/src/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/src/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/src/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/CheckersUiActivator.java: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/CodanProblemMarkerResolutionGenerator.java: New file.
* org.eclipse.cdt.codan.checkers.ui/src/org/eclipse/cdt/codan/checkers/ui/quickfix/QuickFixAssignmentInCondition.java: New file.
* org.eclipse.cdt.codan.checkers/.classpath: New file.
* org.eclipse.cdt.codan.checkers/.project: New file.
* org.eclipse.cdt.codan.checkers/.settings/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/.settings/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/.settings/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/.settings/org.eclipse.jdt.core.prefs: New file.
* org.eclipse.cdt.codan.checkers/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/CVS/Template: New file.
* org.eclipse.cdt.codan.checkers/META-INF/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/META-INF/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/META-INF/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/META-INF/MANIFEST.MF: New file.
* org.eclipse.cdt.codan.checkers/build.properties: New file.
* org.eclipse.cdt.codan.checkers/plugin.xml: New file.
* org.eclipse.cdt.codan.checkers/src/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/src/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/src/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/src/org/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/src/org/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/src/org/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/Activator.java: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/CloseOpenedFilesChecker.java: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/AssignmentInConditionChecker.java: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/CVS/Entries: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/CVS/Repository: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/CVS/Root: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/NonVirtualDestructor.java: New file.
* org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/checkers/sample/StatementHasNoEffectChecker.java: New file.
* org.eclipse.cdt.codan.core/.classpath: New file.
* org.eclipse.cdt.codan.core/.project: New file.
* org.eclipse.cdt.codan.core/.settings/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/.settings/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/.settings/CVS/Root: New file.
* org.eclipse.cdt.codan.core/.settings/org.eclipse.jdt.core.prefs: New file.
* org.eclipse.cdt.codan.core/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/CVS/Root: New file.
* org.eclipse.cdt.codan.core/CVS/Template: New file.
* org.eclipse.cdt.codan.core/META-INF/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/META-INF/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/META-INF/CVS/Root: New file.
* org.eclipse.cdt.codan.core/META-INF/MANIFEST.MF: New file.
* org.eclipse.cdt.codan.core/build.properties: New file.
* org.eclipse.cdt.codan.core/plugin.xml: New file.
* org.eclipse.cdt.codan.core/schema/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/schema/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/schema/CVS/Root: New file.
* org.eclipse.cdt.codan.core/schema/checkers.exsd: New file.
* org.eclipse.cdt.codan.core/src/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/org/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/org/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanApplication.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanCorePlugin.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanPreferencesLoader.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanRuntime.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/PreferenceConstants.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractChecker.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/AbstractIndexAstChecker.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/CodanSeverity.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICAstChecker.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IChecker.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICheckersRegistry.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICodanAstReconciler.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ICodanBuilder.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblem.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemCategory.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemElement.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemLocation.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemProfile.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/IProblemReporter.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemLocation.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/ProblemProfile.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegisry.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodeAnlysisNature.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CVS/Entries: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CVS/Repository: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CVS/Root: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanMarkerProblemReporter.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblem.java: New file.
* org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/CodanProblemCategory.java: New file.
* org.eclipse.cdt.codan.ui/.classpath: New file.
* org.eclipse.cdt.codan.ui/.project: New file.
* org.eclipse.cdt.codan.ui/.settings/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/.settings/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/.settings/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/.settings/org.eclipse.jdt.core.prefs: New file.
* org.eclipse.cdt.codan.ui/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/CVS/Template: New file.
* org.eclipse.cdt.codan.ui/META-INF/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/META-INF/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/META-INF/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/META-INF/MANIFEST.MF: New file.
* org.eclipse.cdt.codan.ui/build.properties: New file.
* org.eclipse.cdt.codan.ui/plugin.xml: New file.
* org.eclipse.cdt.codan.ui/src/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/org/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/org/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/BuildPropertyPage.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/Messages.properties: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Activator.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanCReconciler.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Startup.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Entries: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Repository: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Root: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/RunCodeAnalysis.java: New file.
* org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/ToggleNatureAction.java: New file.
Diffstat (limited to 'org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui')
11 files changed, 471 insertions, 0 deletions
diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Activator.java b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Activator.java new file mode 100644 index 0000000..849993a --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Activator.java @@ -0,0 +1,98 @@ +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/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Entries b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Entries new file mode 100644 index 0000000..4387fb2 --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Entries @@ -0,0 +1,4 @@ +/Activator.java/1.2/Fri Apr 24 12:49:44 2009// +/CodanCReconciler.java/1.3/Sat Aug 22 21:16:50 2009// +/Startup.java/1.1/Fri Apr 24 12:49:44 2009// +D/actions//// diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Repository b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Repository new file mode 100644 index 0000000..c0c10ac --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Repository @@ -0,0 +1 @@ +org.eclipse.cdt/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Root b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Root new file mode 100644 index 0000000..04efa23 --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@dev.eclipse.org:/cvsroot/tools diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanCReconciler.java b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanCReconciler.java new file mode 100644 index 0000000..5bec1c1 --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/CodanCReconciler.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * 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.CodanRuntime; +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) { + CodanRuntime.getInstance().getAstQuickBuilder().reconcileAst(ast, + progressMonitor); + // System.err.println("ast reconsiled"); + } +} diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Startup.java b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Startup.java new file mode 100644 index 0000000..41fbf89 --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/Startup.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2009 Alena Laskavaia + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alena Laskavaia - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.codan.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/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Entries b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Entries new file mode 100644 index 0000000..30cf7ec --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Entries @@ -0,0 +1,2 @@ +/RunCodeAnalysis.java/1.3/Sat Aug 22 21:16:50 2009// +/ToggleNatureAction.java/1.2/Sat Aug 22 21:16:50 2009// diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Repository b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Repository new file mode 100644 index 0000000..09c1aeb --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Repository @@ -0,0 +1 @@ +org.eclipse.cdt/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Root b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Root new file mode 100644 index 0000000..04efa23 --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/CVS/Root @@ -0,0 +1 @@ +:pserver:anonymous@dev.eclipse.org:/cvsroot/tools diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/RunCodeAnalysis.java b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/RunCodeAnalysis.java new file mode 100644 index 0000000..01d7c25 --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/RunCodeAnalysis.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * 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.CodanRuntime; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.core.runtime.jobs.Job; +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) { + // nothing + } + + public void run(IAction action) { + Job job = new Job("Running Code Analysis") { + @SuppressWarnings("unchecked") + @Override + protected IStatus run(final IProgressMonitor monitor) { + IStructuredSelection ss = (IStructuredSelection) sel; + int count = ss.size(); + monitor.beginTask(getName(), count * 100); + if (monitor.isCanceled()) + return Status.CANCEL_STATUS; + for (Iterator iterator = ss.iterator(); iterator.hasNext();) { + Object o = iterator.next(); + if (o instanceof IResource) { + IResource res = (IResource) o; + SubProgressMonitor subMon = new SubProgressMonitor( + monitor, 100); + CodanRuntime.getInstance().getBuilder() + .processResource(res, subMon); + if (subMon.isCanceled()) + return Status.CANCEL_STATUS; + } + if (monitor.isCanceled()) + return Status.CANCEL_STATUS; + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } + + public void selectionChanged(IAction action, ISelection selection) { + this.sel = selection; + } +} diff --git a/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/ToggleNatureAction.java b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/ToggleNatureAction.java new file mode 100644 index 0000000..3993621 --- /dev/null +++ b/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/ui/actions/ToggleNatureAction.java @@ -0,0 +1,130 @@ +/******************************************************************************* + * 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.CodanCorePlugin; +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 (CodanCorePlugin.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 (CodanCorePlugin.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] = CodanCorePlugin.NATURE_ID; + description.setNatureIds(newNatures); + project.setDescription(description, null); + } + } catch (CoreException e) { + } + } +} |