public abstract class RunAnalyseHandlerBase extends RunAnalyseHandler
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancelledByUser |
protected int |
cumulativeArtifacts |
protected boolean |
forceEcho |
protected String |
markerID |
protected String |
name
the type of artifact e.g.
|
protected Shell |
shell |
protected static boolean |
traceOn
This is NOT final because constructor may change this dynamically
if tracing is enabled by user -- see CommonPlugin.getTraceOn();
|
protected ArtifactMarkingVisitor |
visitor |
protected IWorkbenchWindow |
window |
selection
Constructor and Description |
---|
RunAnalyseHandlerBase(String name,
ArtifactMarkingVisitor visitor,
String markerID)
Constructor for the "Run Analysis" action
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
activateArtifactView() |
protected void |
activateProblemsView()
If the analysis has an additional view to bring up, override this
|
ScanReturn |
analyse(IProgressMonitor monitor,
ITranslationUnit tu,
List<String> includes) |
boolean |
areIncludePathsNeeded()
returns true if include paths must be set for this implementation.
|
void |
dispose()
We can use this method to dispose of any system resources we previously
allocated.
|
abstract ScanReturn |
doArtifactAnalysis(ITranslationUnit tu,
List<String> includes)
Returns artifact analysis for file.
|
Object |
execute(ExecutionEvent event)
Implemented for Handler; this replaces run() which is for actions.
|
protected abstract List<String> |
getIncludePath()
Get the include path.
|
String |
getPrefacedName(Object obj)
Provide a human-readable version of what will be analyzed.
|
void |
init(IWorkbenchWindow window)
Cache the window object to be able to provide parent shell for the
message dialog.
|
protected boolean |
isCPPproject(ICElement ce)
Determine if the project is a C++ project
|
protected void |
processResults(ScanReturn results,
IResource resource) |
protected void |
readPreferences()
Read preferences
|
void |
run()
Do the "Run Analysis" on a resource (project, folder, or file).
|
protected ScanReturn |
runArtifactAnalysisFromExtensionPoint(String extensionPointID,
ITranslationUnit tu,
List<String> includes,
boolean allowPrefixOnlyMatch)
Runs an artifact analysis for the given file by searching the given extension point for an
IArtifactAnalysis that matches its language ID. |
boolean |
runResource(IProgressMonitor monitor,
ICElement ce,
int indent,
List<String> includes)
Run analysis on a resource (e.g.
|
protected boolean |
runResources(IProgressMonitor monitor,
int indent,
List<String> includes)
Run the analysis on the current selection (file, container, or
multiple-selection)
|
void |
setActivePart(IAction action,
IWorkbenchPart targetPart) |
protected boolean |
validForAnalysis(String filename,
boolean isCPP)
Default determination of if a given filename is valid for our artifact
analysis
|
countFiles, countFiles, countFilesSelected, countFilesSelected, getSelection
protected static boolean traceOn
protected boolean forceEcho
protected IWorkbenchWindow window
protected boolean cancelledByUser
protected int cumulativeArtifacts
protected String name
protected ArtifactMarkingVisitor visitor
protected String markerID
protected Shell shell
public RunAnalyseHandlerBase(String name, ArtifactMarkingVisitor visitor, String markerID)
name
- the type of artifact e.g. "MPI" or "OpenMP"visitor
- the visitor that will put the markers on the source filesmarkerID
- marker IDpublic ScanReturn analyse(IProgressMonitor monitor, ITranslationUnit tu, List<String> includes)
public boolean areIncludePathsNeeded()
public void dispose()
implemented for toolbar
enablement of this action
public abstract ScanReturn doArtifactAnalysis(ITranslationUnit tu, List<String> includes)
tu
- includes
- header files include pathsprotected ScanReturn runArtifactAnalysisFromExtensionPoint(String extensionPointID, ITranslationUnit tu, List<String> includes, boolean allowPrefixOnlyMatch)
IArtifactAnalysis
that matches its language ID.
This is a utility method generally invoked from doArtifactAnalysis(ITranslationUnit, List)
.
It is assumed that only one extension will be contributed per language ID. If multiple extensions are found, it is unspecified which one will be run.
extensionPointID
- tu
- includes
- allowPrefixOnlyMatch
- ScanReturn
public Object execute(ExecutionEvent event) throws ExecutionException
ExecutionException
public String getPrefacedName(Object obj)
obj
- the file, folder, or projectpublic void init(IWorkbenchWindow window)
implemented for toolbar
enablement of this action NOTE: window object will thus be null for
context menu use!! so...we are not using this, using
Display.getCurrent() and Display.getCurrent().getActiveShell();
public void run()
public boolean runResource(IProgressMonitor monitor, ICElement ce, int indent, List<String> includes) throws InterruptedException
atu
- the resourceindent
- number of levels of nesting/recursion for prettyprintingincludes
- contains header files include paths from the Preference pageInterruptedException
public void setActivePart(IAction action, IWorkbenchPart targetPart)
protected abstract void activateArtifactView()
protected void activateProblemsView()
protected abstract List<String> getIncludePath()
protected boolean isCPPproject(ICElement ce)
ce
- the ICElement representing a fileprotected void processResults(ScanReturn results, IResource resource)
protected void readPreferences()
protected boolean runResources(IProgressMonitor monitor, int indent, List<String> includes) throws InterruptedException
monitor
- progress monitor on which to report progress.indent
- indent amount, in number of spaces, used only for debug
printing.includes
- InterruptedException
protected boolean validForAnalysis(String filename, boolean isCPP)
filename
- isCPP
- is the project a C++ project or notCopyright (c) 2011 IBM Corporation and others. All Rights Reserved.