Commit e445fbe1 authored by Ashmi Banerjee's avatar Ashmi Banerjee
Browse files

Added the handlers and bindings for the security aspects

refs 3238
parent 433fe979
......@@ -27,8 +27,14 @@ import org.fortiss.af3.mira.model.functional.FormalSpecification;
import org.fortiss.af3.mira.model.functional.FunctionalSpecification;
import org.fortiss.af3.mira.model.functional.SignalContainerSpecification;
import org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviourSpecification;
import org.fortiss.af3.mira.model.security.Assets;
import org.fortiss.af3.mira.model.security.CounterMeasuresRequirementSpecification;
import org.fortiss.af3.mira.model.security.ThreatsRequirementSpecification;
import org.fortiss.af3.mira.model.security.VulnerabilitiesRequirementSpecification;
import org.fortiss.af3.mira.model.timing.TimingRequirement;
import org.fortiss.af3.mira.model.usecase.UseCaseSpecification;
import org.fortiss.af3.mira.ui.editor.AssetsEditor;
import org.fortiss.af3.mira.ui.editor.CounterMeasuresEditor;
import org.fortiss.af3.mira.ui.editor.DerivedRequirementEditor;
import org.fortiss.af3.mira.ui.editor.FunctionalRequirementEditor;
import org.fortiss.af3.mira.ui.editor.InterfaceBehaviourAspectEditor;
......@@ -37,8 +43,10 @@ import org.fortiss.af3.mira.ui.editor.ModeDefinitionEditor;
import org.fortiss.af3.mira.ui.editor.ParameterDefinitionEditor;
import org.fortiss.af3.mira.ui.editor.SafetyLevelSectionEditor;
import org.fortiss.af3.mira.ui.editor.SignalDefinitionEditor;
import org.fortiss.af3.mira.ui.editor.ThreatsEditor;
import org.fortiss.af3.mira.ui.editor.TimingRequirementEditor;
import org.fortiss.af3.mira.ui.editor.UseCaseAspectEditor;
import org.fortiss.af3.mira.ui.editor.VulnerabilitiesEditor;
import org.fortiss.af3.project.model.ParameterDefinition;
import org.fortiss.tooling.kernel.ui.extension.base.ModelEditorBindingBase;
......@@ -175,6 +183,108 @@ public class AspectBindings {
}
}
/** Binding for Assets aspect aspect. */
public static class AssetsBinding extends ModelEditorBindingBase<Requirement> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass(Requirement obj) {
if(pickFirstInstanceOf(Assets.class, obj.getSpecifications()) == null) {
return null;
}
return AssetsEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Assets definition";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return SECONDEDITORPRIORITY;
}
}
/** Binding for vulnerabilities definition aspect. */
public static class VulnerabilitiesBinding extends ModelEditorBindingBase<Requirement> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass(Requirement obj) {
if(pickFirstInstanceOf(VulnerabilitiesRequirementSpecification.class,
obj.getSpecifications()) == null) {
return null;
}
return VulnerabilitiesEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Vulnerabilities definition";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return SECONDEDITORPRIORITY;
}
}
/** Binding for Threats aspect. */
public static class ThreatsBinding extends ModelEditorBindingBase<Requirement> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass(Requirement obj) {
if(pickFirstInstanceOf(ThreatsRequirementSpecification.class, obj.getSpecifications()) == null) {
return null;
}
return ThreatsEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Threats definition";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return SECONDEDITORPRIORITY;
}
}
/** Binding for countermeasures aspect. */
public static class CounterMeasuresBinding extends ModelEditorBindingBase<Requirement> {
/** {@inheritDoc} */
@Override
public Class<? extends IEditorPart> getEditorClass(Requirement obj) {
if(pickFirstInstanceOf(CounterMeasuresRequirementSpecification.class,
obj.getSpecifications()) == null) {
return null;
}
return CounterMeasuresEditor.class;
}
/** {@inheritDoc} */
@Override
public String getLabel() {
return "Countermeasures definition";
}
/** {@inheritDoc} */
@Override
public int getPriority() {
return SECONDEDITORPRIORITY;
}
}
/** Binding for interface aspect. */
public static class InterfaceBinding extends ModelEditorBindingBase<Requirement> {
......
......@@ -31,6 +31,10 @@ import org.fortiss.af3.mira.model.functional.FormalSpecification;
import org.fortiss.af3.mira.model.functional.FunctionalSpecification;
import org.fortiss.af3.mira.model.functional.SignalContainerSpecification;
import org.fortiss.af3.mira.model.interfacebehaviour.InterfaceBehaviourSpecification;
import org.fortiss.af3.mira.model.security.Assets;
import org.fortiss.af3.mira.model.security.CounterMeasuresRequirementSpecification;
import org.fortiss.af3.mira.model.security.ThreatsRequirementSpecification;
import org.fortiss.af3.mira.model.security.VulnerabilitiesRequirementSpecification;
import org.fortiss.af3.mira.model.timing.TimingRequirement;
import org.fortiss.af3.mira.model.usecase.UseCaseSpecification;
import org.fortiss.af3.project.model.ParameterDefinition;
......@@ -121,6 +125,49 @@ public class AspectHandlers {
}
}
/** Handler for {@link Assets}'s. */
public static class AssetsHandler extends SpecificationHandlerBase<Assets> {
/** {@inheritDoc} */
@Override
public String getName(Assets element) {
return "Assets aspect";
}
}
/** Handler for {@link Vulnerabilities}'s. */
public static class VulnerabilitiesHandler extends
SpecificationHandlerBase<VulnerabilitiesRequirementSpecification> {
/** {@inheritDoc} */
@Override
public String getName(VulnerabilitiesRequirementSpecification element) {
return "Vulnerabilities aspect";
}
}
/** Handler for {@link Threats}'s. */
public static class ThreatsHandler extends
SpecificationHandlerBase<ThreatsRequirementSpecification> {
/** {@inheritDoc} */
@Override
public String getName(ThreatsRequirementSpecification element) {
return "Threats aspect";
}
}
/** Handler for {@link Countermeasures}'s. */
public static class CounterMeasuresHandler extends
SpecificationHandlerBase<CounterMeasuresRequirementSpecification> {
/** {@inheritDoc} */
@Override
public String getName(CounterMeasuresRequirementSpecification element) {
return "Countermeasures aspect";
}
}
/** Handler for {@link DerivedRequirementSpecification}'s. */
public static class DerivedRequirementHandler extends
SpecificationHandlerBase<DerivedRequirementSpecification> {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment