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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static org.eclipse.core.resources.IProject
     
    protected static List<ObservableThreat>
     
    protected static boolean
    checkResultsAvailable(org.eclipse.swt.widgets.Shell shell)
     

    Methods inherited from class org.eclipse.core.commands.AbstractHandler

    addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled

    Methods inherited from class org.eclipse.core.commands.common.EventManager

    addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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:
      true if analysis results are available; otherwise tells the user to run the analysis first and returns false.
    • analysedProject

      protected static org.eclipse.core.resources.IProject analysedProject()
      Returns:
      the project containing the analysed model. Requires results to be available.
    • analysedThreats

      protected static List<ObservableThreat> analysedThreats()
      Returns:
      a snapshot of the current threats. Requires results to be available.