Class AbstractAnalysisExportHandler
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
be.kuleuven.cs.distrinet.sparta.analysis.handlers.AbstractAnalysisExportHandler
- All Implemented Interfaces:
org.eclipse.core.commands.IHandler,org.eclipse.core.commands.IHandler2
- Direct Known Subclasses:
AbstractThreatTableExportHandler,ReportExportHandler
public abstract class AbstractAnalysisExportHandler
extends org.eclipse.core.commands.AbstractHandler
Base for the export commands. Exports read the current results from
ThreatAnalysisService rather than from the ThreatAnalysis view, so they work from
the main menu and toolbar even when the view is closed.
The commands are only enabled while results exist (see
AnalysisStateSourceProvider); checkResultsAvailable(Shell) is the
fallback for a handler executed without consulting enablement.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static org.eclipse.core.resources.IProjectprotected static List<ObservableThreat> protected static booleancheckResultsAvailable(org.eclipse.swt.widgets.Shell shell) Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabledMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.commands.IHandler
execute, getHandlerLabel
-
Constructor Details
-
AbstractAnalysisExportHandler
public AbstractAnalysisExportHandler()
-
-
Method Details
-
checkResultsAvailable
protected static boolean checkResultsAvailable(org.eclipse.swt.widgets.Shell shell) - Returns:
trueif analysis results are available; otherwise tells the user to run the analysis first and returnsfalse.
-
analysedProject
protected static org.eclipse.core.resources.IProject analysedProject()- Returns:
- the project containing the analysed model. Requires results to be available.
-
analysedThreats
- Returns:
- a snapshot of the current threats. Requires results to be available.
-