OpenCert Dashboard part 2
- Complete all pages, sections and activities anchors (without real
executions)
- System design analysis VV / System Definition:
+ create a Chess project
+ create a requirement diagram
+ import from user model,
+ create block definition diagram
Change-Id: Ic8062c7794147f657f68b732900e24981c55bc2e
Signed-off-by: Thanh Liem PHAN <thanhliem.phan@all4tec.net>
diff --git a/org.eclipse.opencert.infra.dashboard/META-INF/MANIFEST.MF b/org.eclipse.opencert.infra.dashboard/META-INF/MANIFEST.MF
index 35e8c8d..470cebc 100644
--- a/org.eclipse.opencert.infra.dashboard/META-INF/MANIFEST.MF
+++ b/org.eclipse.opencert.infra.dashboard/META-INF/MANIFEST.MF
@@ -7,16 +7,17 @@
Bundle-Vendor: Tecnalia
Require-Bundle: org.eclipse.opencert.pkm.refframework.diagram;bundle-version="1.0.0",
org.eclipse.amalgam.explorer.activity.ui;bundle-version="1.7.0",
- org.eclipse.ui.navigator;bundle-version="3.6.101",
org.eclipse.sirius;bundle-version="4.1.4",
org.apache.commons.lang;bundle-version="2.6.0",
- org.eclipse.ui.ide;bundle-version="3.12.3",
- org.eclipse.emf.common.ui;bundle-version="2.11.0",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.7.0",
org.eclipse.papyrus.infra.onefile;bundle-version="2.0.0",
- org.eclipse.emf.cdo;bundle-version="4.5.0",
org.eclipse.epf.authoring.ui;bundle-version="1.5.0",
org.eclipse.opencert.apm.assurproj.wizards;bundle-version="1.0.0",
- org.polarsys.chess.wizards;bundle-version="0.9.0"
+ org.polarsys.chess.wizards;bundle-version="0.9.0",
+ org.eclipse.papyrus.sysml.diagram.requirement;bundle-version="2.0.0",
+ org.eclipse.papyrus.views.modelexplorer;bundle-version="2.1.0",
+ org.eclipse.papyrus.editor;bundle-version="1.3.0",
+ org.eclipse.papyrus.sysml.diagram.internalblock;bundle-version="2.0.0",
+ org.eclipse.papyrus.sysml.diagram.blockdefinition;bundle-version="2.0.0",
+ org.eclipse.papyrus.uml.profile;bundle-version="2.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.opencert.infra.dashboard/icons/assurancecasemanagement/assurance_case_management_off.png b/org.eclipse.opencert.infra.dashboard/icons/assurancecasemanagement/assurance_case_management_off.png
new file mode 100644
index 0000000..c2909f7
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/assurancecasemanagement/assurance_case_management_off.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/assurancecasemanagement/assurance_case_management_on.png b/org.eclipse.opencert.infra.dashboard/icons/assurancecasemanagement/assurance_case_management_on.png
new file mode 100644
index 0000000..0b4964c
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/assurancecasemanagement/assurance_case_management_on.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/evidencemanagement/evidence_management_off.png b/org.eclipse.opencert.infra.dashboard/icons/evidencemanagement/evidence_management_off.png
new file mode 100644
index 0000000..de83923
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/evidencemanagement/evidence_management_off.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/evidencemanagement/evidence_management_on.png b/org.eclipse.opencert.infra.dashboard/icons/evidencemanagement/evidence_management_on.png
new file mode 100644
index 0000000..d2d6a3e
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/evidencemanagement/evidence_management_on.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/processcompliance/process_compliance_def_off.png b/org.eclipse.opencert.infra.dashboard/icons/processcompliance/process_compliance_def_off.png
new file mode 100644
index 0000000..d722da2
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/processcompliance/process_compliance_def_off.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/processcompliance/process_compliance_def_on.png b/org.eclipse.opencert.infra.dashboard/icons/processcompliance/process_compliance_def_on.png
new file mode 100644
index 0000000..c7fe3c5
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/processcompliance/process_compliance_def_on.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/processreusability/processreusability_off.png b/org.eclipse.opencert.infra.dashboard/icons/processreusability/processreusability_off.png
deleted file mode 100644
index 36601ab..0000000
--- a/org.eclipse.opencert.infra.dashboard/icons/processreusability/processreusability_off.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/processreusability/processreusability_on.png b/org.eclipse.opencert.infra.dashboard/icons/processreusability/processreusability_on.png
deleted file mode 100644
index 7a89f1b..0000000
--- a/org.eclipse.opencert.infra.dashboard/icons/processreusability/processreusability_on.png
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/block_definition_diagram.png b/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/block_definition_diagram.png
new file mode 100644
index 0000000..c4ce74b
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/block_definition_diagram.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/requirement_diagram.png b/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/requirement_diagram.png
new file mode 100644
index 0000000..077f896
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/requirement_diagram.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/system_design_analysis_vv_off.png b/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/system_design_analysis_vv_off.png
new file mode 100644
index 0000000..b9c1d94
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/system_design_analysis_vv_off.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/system_design_analysis_vv_on.png b/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/system_design_analysis_vv_on.png
new file mode 100644
index 0000000..d5bfd8d
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/icons/systemdesignanalysis/system_design_analysis_vv_on.png
Binary files differ
diff --git a/org.eclipse.opencert.infra.dashboard/plugin.xml b/org.eclipse.opencert.infra.dashboard/plugin.xml
index 7a6306d..8e07d1b 100644
--- a/org.eclipse.opencert.infra.dashboard/plugin.xml
+++ b/org.eclipse.opencert.infra.dashboard/plugin.xml
@@ -29,7 +29,7 @@
title="Standard Compliance Definition"
viewer="true">
<Description>
- Standard Compliance Definition in OpenCert
+ Project independent activities capture, digitalize, store and retrieve standard compliance knowledge. Specify reusable compliant process associated with a specific standard.
</Description>
<Predicate
class="org.eclipse.opencert.infra.dashboard.predicates.DashboardPredicate">
@@ -85,7 +85,7 @@
index="0"
name="Modelling of reusable process elements">
<Description>
- Description body text
+ Modelling of reusable process elements.
</Description>
</Activity>
<Activity
@@ -93,7 +93,7 @@
index="1"
name="Modelling of reusable process patterns">
<Description>
- Description body text
+ Modelling of reusable process patterns.
</Description>
</Activity>
<Activity
@@ -118,7 +118,7 @@
title="Assurance Project Definition"
viewer="true">
<Description>
- Assurance Project Definition in OpenCert
+ Define the scope of compliance for a project, project compliance lifecycle, reuse possibilities and compliance means.
</Description>
<Predicate
class="org.eclipse.opencert.infra.dashboard.predicates.DashboardPredicate">
@@ -192,7 +192,7 @@
index="0"
name="Cross system reuse">
<Description>
- Description body text
+ Cross system reuse.
</Description>
</Activity>
<Activity
@@ -200,48 +200,751 @@
index="1"
name="Cross standard reuse">
<Description>
- Description body text
+ Cross standard reuse.
</Description>
</Activity>
</Section>
</Page>
<Page
- class="org.eclipse.opencert.infra.dashboard.pages.ProcessReusabilityDefinitionPage"
- id="org.eclipse.opencert.infra.dashboard.pages.process.reusability.definition.page"
- imageOff="icons/processreusability/processreusability_off.png"
- imageOn="icons/processreusability/processreusability_on.png"
+ class="org.eclipse.opencert.infra.dashboard.pages.ProcessComplianceDefinitionPage"
+ id="org.eclipse.opencert.infra.dashboard.pages.process.compliance.definition.page"
+ imageOff="icons/processcompliance/process_compliance_def_off.png"
+ imageOn="icons/processcompliance/process_compliance_def_on.png"
index="3"
- tabName="Process Reusability Definition"
- title="Process Reusability Definition"
+ tabName="Process Compliance Definition"
+ title="Process Compliance Definition"
viewer="true">
<Description>
- Process Reusability Definition in OpenCert
+ Validate process reusability, deploy executable process.
</Description>
<Predicate
class="org.eclipse.opencert.infra.dashboard.predicates.DashboardPredicate">
</Predicate>
<Overview
- imageOff="icons/processreusability/processreusability_off.png"
- imageOn="icons/processreusability/processreusability_on.png">
+ imageOff="icons/processcompliance/process_compliance_def_off.png"
+ imageOn="icons/processcompliance/process_compliance_def_on.png">
<Description>
- Define the process reusability.
+ Define the process compliance.
</Description>
</Overview>
<Section
expanded="true"
filtering="true"
- id="org.eclipse.opencert.infra.dashboard.section.process.reusability.definition"
+ id="org.eclipse.opencert.infra.dashboard.section.specify.compliance.process"
index="0"
- name="Process Reusability Definition">
+ name="Specify Compliance Process">
<Description>
- Define the process reuseabitlity.
+ The Process Engineer can import existing processes and resolve the variability due to safety/security appliance.
</Description>
<Activity
- id="org.eclipse.opencert.infra.dashboard.activity.define.process.reuseability"
+ id="org.eclipse.opencert.infra.dashboard.activity.export.definition.planning"
index="0"
- name="Define process reuseability">
+ name="Export the definition and planning of processes modelled ">
<Description>
- Define the process reuseability.
+ Export the definition and planning of processes modelled.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.import.definition.planning"
+ index="1"
+ name="Import the definition and planning of processes modelled into an assurance project">
+ <Description>
+ Import the definition and planning of processes modelled into an assurance project.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.reuse.process.development"
+ index="1"
+ name="Reuse Process Development">
+ <Description>
+ The Process Engineer instantiate the reusable generic base process developed to a project specific process. A check is necessary to be sure that the assumptions for the reused activities are valid for the new project.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.derivate.project.specific.process"
+ index="0"
+ name="Derivate project specific process">
+ <Description>
+ Derivate project specific process.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.check.process.reusability"
+ index="1"
+ name="Check process reusability">
+ <Description>
+ Check process reusability.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.coassessment"
+ index="2"
+ name="Co-Assessment">
+ <Description>
+ The Process Engineer takes the modelling the definition and planning of processes already defined in EPF and import it into OpenCert in order to look at post-planning phases.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.coassessment.cross.system.reuse."
+ index="0"
+ name="Cross system reuse">
+ <Description>
+ Cross system reuse.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.coassessment.cross.standard.reuse"
+ index="1"
+ name="Cross standard reuse">
+ <Description>
+ Cross standard reuse.
+ </Description>
+ </Activity>
+ </Section>
+ </Page>
+ <Page
+ class="org.eclipse.opencert.infra.dashboard.pages.SystemDesignAnalysisVVPage"
+ id="org.eclipse.opencert.infra.dashboard.pages.system.design.analysis.vv"
+ imageOff="icons/systemdesignanalysis/system_design_analysis_vv_off.png"
+ imageOn="icons/systemdesignanalysis/system_design_analysis_vv_on.png"
+ index="4"
+ tabName="System Design Analysis and V&V"
+ title="System Design Analysis and V&V"
+ viewer="true">
+ <Description>
+ Define the system architecture, elicit system requirements, define and validate component contracts and execute Safety/Security analyses.
+ </Description>
+ <Predicate
+ class="org.eclipse.opencert.infra.dashboard.predicates.DashboardPredicate">
+ </Predicate>
+ <Overview
+ imageOff="icons/systemdesignanalysis/system_design_analysis_vv_off.png"
+ imageOn="icons/systemdesignanalysis/system_design_analysis_vv_on.png">
+ <Description>
+ System design, analysis, validation and verification
+ </Description>
+ </Overview>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.system.definition"
+ index="0"
+ name="System Definition">
+ <Description>
+ The development engineer uses SysML BDD, IBD and Requirements Diagrams, possibility to import requirements from external tools, formalization of requirements supported with syntax-driven editors.
+ </Description>
+ <Activity
+ class="org.eclipse.opencert.infra.dashboard.pages.adapters.OpenNewChessProjectWizard"
+ id="org.eclipse.opencert.infra.dashboard.activity.create.chess.project"
+ image="icons/assuranceproject/chess_project_icon.png"
+ index="0"
+ name="Create a Papyrus CHESS project">
+ <Description>
+ Create a Papyrus CHESS project.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.create.savona.project"
+ index="1"
+ name="Create a SAVONA project">
+ <Description>
+ Create a SAVONA project.
+ </Description>
+ </Activity>
+ <Activity
+ class="org.eclipse.opencert.infra.dashboard.pages.adapters.CreateNewChessRequirementDiagram"
+ id="org.eclipse.opencert.infra.dashboard.activity.specify.requirements.chess"
+ image="icons/systemdesignanalysis/requirement_diagram.png"
+ index="2"
+ name="Specify requirements in Papyrus CHESS">
+ <Description>
+ Specify requirements in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ class="org.eclipse.opencert.infra.dashboard.pages.adapters.OpenImportUserModelDialogHyperLinkAdapter"
+ id="org.eclipse.opencert.infra.dashboard.activity.import.requirements.chess"
+ image="icons/systemdesignanalysis/requirement_diagram.png"
+ index="3"
+ name="Import requirements in Papyrus CHESS">
+ <Description>
+ Import requirements in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ class="org.eclipse.opencert.infra.dashboard.pages.adapters.CreateNewChessBlockDefinitionDiagram"
+ id="org.eclipse.opencert.infra.dashboard.activity.create.system.components.chess"
+ image="icons/systemdesignanalysis/block_definition_diagram.png"
+ index="4"
+ name="Create system components in Papyrus CHESS">
+ <Description>
+ Create system components in Papyrus CHESS
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.import.savona.model"
+ index="5"
+ name="Import a SAVONA model in Papyrus CHESS">
+ <Description>
+ Import a SAVONA model in Papyrus CHESS.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.requirements.formalization.early.validation"
+ index="1"
+ name="Requirements Formalization and Early Validation">
+ <Description>
+ Formal semantic analysis of formal properties, analysis of requirements quality with machine learning techniques and requirements quality metrics editors.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.analysis.requirements.metric"
+ index="0"
+ name="Analysis of requirements based on quality metrics">
+ <Description>
+ Analysis of requirements based on quality metrics.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.formalize.requirements.temporal.logic"
+ index="1"
+ name="Formalize a requirement into temporal logics in Papyrus CHESS">
+ <Description>
+ Formalize a requirements into temporal logics in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.formalize.requirements.savona"
+ index="2"
+ name="Formalize a requirement in SAVONA">
+ <Description>
+ Formalize a requirement in SAVONA.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.define.contract.component.chess"
+ index="3"
+ name="Define a contract for a component in Papyrus CHESS">
+ <Description>
+ Define a contract for a component in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.analysis.requirements.semantics"
+ index="4"
+ name="Analysis of requirements’ semantics based on their formalisation into temporal logics">
+ <Description>
+ Analysis of requirements’ semantics based on their formalisation into temporal logics.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.functional.refinement"
+ index="2"
+ name="Functional Refinement">
+ <Description>
+ Using SysML IBD extended with contracts.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.decompose.component.chess"
+ index="0"
+ name="Decompose a component in Papyrus CHESS">
+ <Description>
+ Decompose a component in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.decompose.component.savona"
+ index="1"
+ name="Decompose a component in SAVONA">
+ <Description>
+ Decompose a component in SAVONA.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.model.contracts.refinement.chess"
+ index="2"
+ name="Model contracts refinement in Papyrus CHESS">
+ <Description>
+ Model contracts refinement in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.model.contracts.refinement.savona"
+ index="3"
+ name="Model contracts refinement in SAVONA">
+ <Description>
+ Model contracts refinement in SAVONA.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.apply.architectural.patterns.chess"
+ index="4"
+ name="Apply architectural patterns in Papyrus CHESS">
+ <Description>
+ Apply architectural patterns in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.specify.parameters.chess"
+ index="5"
+ name="Specify parameters of the parameterized architecture in Papyrus CHESS">
+ <Description>
+ Specify parameters of the parameterized architecture in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.instantiate.parameterized.architecture.chess"
+ index="6"
+ name="Instantiate a parameterized architecture in Papyrus CHESS">
+ <Description>
+ Instantiate a parameterized architecture in Papyrus CHESS.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.components.nominal.faulty.behaviour.definition"
+ index="3"
+ name="Component's Nominal and Faulty Behaviour Definition">
+ <Description>
+ Using State Machines or Simulink models extended with fault injection.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.define.nominal.statemachine.chess"
+ index="0"
+ name="Define a nominal state machine for a component in Papyrus CHESS">
+ <Description>
+ Define a nominal state machine for a component in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.define.error.statemachine.chess"
+ index="1"
+ name="Define an error state machine for a component in Papyrus CHESS">
+ <Description>
+ Define an error state machine for a component in Papyrus CHESS.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.define.failure.progation.rule.chess"
+ index="2"
+ name="Define a failure propagation rule for a component in Papyrus CHESS">
+ <Description>
+ Define a failure propagation rule for a component in Papyrus CHESS.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.functional.early.verification"
+ index="4"
+ name="Functional Early Verification">
+ <Description>
+ Contract-based Verification of refinement and state-machines, Model Checking, Contract-based Monitoring of Simulink models, Contract-based Verification of Refinement with Strong and Weak Contracts.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.contractbased.verification.refinement"
+ index="0"
+ name="Contract-based verification of refinement">
+ <Description>
+ Contract-based verification of refinement.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.contractbased.verification.statemachines"
+ index="1"
+ name="Contract-based verification of state machines">
+ <Description>
+ Contract-based verification of state machines.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.model.checking"
+ index="2"
+ name="Model checking">
+ <Description>
+ Model checking.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.contractbased.monitoring.simulink"
+ index="3"
+ name="Contract-based monitoring with Simulink">
+ <Description>
+ Contract-based monitoring with Simulink.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.contractbased.verification.refinement.strong.weak"
+ index="4"
+ name="Contract-based verification of refinement for strong and weak contracts">
+ <Description>
+ Contract-based verification of refinement for strong and weak contracts.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.contractbased.tradeoff.analysis"
+ index="5"
+ name="Contract-based trade-off analysis in parameterized architectures">
+ <Description>
+ Contract-based trade-off analysis in parameterized architectures.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.coanalysis"
+ index="5"
+ name="Co-Analysis">
+ <Description>
+ The Development Engineer executes safety and security analysis using: Simulation-based Fault Injection, Model-Based Safety Analysis, Contract-Based Safety Analysis.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.simulationbased.fault.injection"
+ index="0"
+ name="Simulation-based fault injection">
+ <Description>
+ Simulation-based fault injection.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.modelbased.fta"
+ index="1"
+ name="Model-based FTA">
+ <Description>
+ Model-based FTA.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.modelbased.fmea"
+ index="2"
+ name="Model-based FMEA">
+ <Description>
+ Model-based FMEA.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.contractbased.safety.analysis"
+ index="3"
+ name="Contract-based safety analysis">
+ <Description>
+ Contract-based safety analysis.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.concerto.fla.coanalysis"
+ index="4"
+ name="Concerto FLA co-analysis">
+ <Description>
+ Concerto FLA co-analysis.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.model.fmvea"
+ index="5"
+ name="Model failures modes vulnerability & effects analysis">
+ <Description>
+ Model failures modes vulnerability& effects analysis.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.safetysecurity.coanalysis.sa"
+ index="6"
+ name="Safety & Security co-analysis in Safety Architect">
+ <Description>
+ Safety & Security co-analysis in Safety Architect.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.dependability.coanalysis.papyrus.sse"
+ index="7"
+ name="System dependability co-analysis via Papyrus SSE">
+ <Description>
+ System dependability co-analysis via Papyrus SSE.
+ </Description>
+ </Activity>
+ </Section>
+ </Page>
+ <Page
+ class="org.eclipse.opencert.infra.dashboard.pages.AssuranceCaseManagementPage"
+ id="org.eclipse.opencert.infra.dashboard.pages.assurance.case.management"
+ imageOff="icons/assurancecasemanagement/assurance_case_management_off.png"
+ imageOn="icons/assurancecasemanagement/assurance_case_management_on.png"
+ index="5"
+ tabName="Assurance Case Management"
+ title="Assurance Case Management"
+ viewer="true">
+ <Description>
+ Define argumentation using compliance arguments, product arguments. Resolve Safety/Security trade off, link to architecture.
+ </Description>
+ <Predicate
+ class="org.eclipse.opencert.infra.dashboard.predicates.DashboardPredicate">
+ </Predicate>
+ <Overview
+ imageOff="icons/assurancecasemanagement/assurance_case_management_off.png"
+ imageOn="icons/assurancecasemanagement/assurance_case_management_on.png">
+ <Description>
+ Assurance case management.
+ </Description>
+ </Overview>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.create.assurance.case.structure"
+ index="0"
+ name="Create Assurance Case Structure">
+ <Description>
+ The assurance engineer creates and manages assurance cases and link them to the assurance project asset package.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.create.assurance.case"
+ index="0"
+ name="Create a new assurance case">
+ <Description>
+ Create a new assurance case.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.develop.claims.links.evidence"
+ index="1"
+ name="Develop Claims and Links to Evidence">
+ <Description>
+ The assurance engineer defines the argumentation structure, develops claims and links to evidences. The assurance engineer can take advantage of the arguments generation to complete the assurance case arguments.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.import.argumentation.model"
+ index="0"
+ name="Import argumentation model">
+ <Description>
+ Import argumentation model.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.generate.arguments.fragments"
+ index="1"
+ name="Generate arguments fragments from system contracts">
+ <Description>
+ Generate arguments fragments from system contracts.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.generate.process.based.arguments"
+ index="2"
+ name="Generate process based arguments">
+ <Description>
+ Generate process based arguments.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.manage.architecture.assurance.links"
+ index="2"
+ name="Manage Architecture - Assurance Links">
+ <Description>
+ The assurance engineer or the development engineer can explicitly indicate the links between the system architecture components and the assurance cases elements such as argument modules.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.link.architecture.components"
+ index="0"
+ name="Link your architecture components to the assurance case elements">
+ <Description>
+ Link your architecture components to the assurance case elements.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.assurance.case.reuse"
+ index="3"
+ name="Reuse">
+ <Description>
+ The assurance engineer can either create a reusable argument element such as argument patterns or arguments modules or use those elements in the actual argumentation. Assurance engineer can also reuse arguments based on the variability points specified.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.create.argument.pattern.module"
+ index="0"
+ name="Create an argument pattern or argument module">
+ <Description>
+ Create an argument pattern or argument module.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.reuse.assurance.case.patterns.modules"
+ index="1"
+ name="Reuse from assurance case patterns and modules">
+ <Description>
+ Reuse from assurance case patterns and modules.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.assurance.case.related.reuse"
+ index="2"
+ name="Assurance case-related reuse via management of assurance case lines">
+ <Description>
+ Assurance case-related reuse via management of assurance case lines.
+ </Description>
+ </Activity>
+ </Section>
+ </Page>
+ <Page
+ class="org.eclipse.opencert.infra.dashboard.pages.EvidenceManagementPage"
+ id="org.eclipse.opencert.infra.dashboard.pages.evidence.management"
+ imageOff="icons/evidencemanagement/evidence_management_off.png"
+ imageOn="icons/evidencemanagement/evidence_management_on.png"
+ index="6"
+ tabName="Evidence Management"
+ title="Evidence Management"
+ viewer="true">
+ <Description>
+ Define the project evidences, define the traceability between artefacts, execute the process to generate evidence and map them to the compliance needs.
+ </Description>
+ <Predicate
+ class="org.eclipse.opencert.infra.dashboard.predicates.DashboardPredicate">
+ </Predicate>
+ <Overview
+ imageOff="icons/evidencemanagement/evidence_management_off.png"
+ imageOn="icons/evidencemanagement/evidence_management_on.png">
+ <Description>
+ Evidence management.
+ </Description>
+ </Overview>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.create.evidence.specification"
+ index="0"
+ name="Create Evidence Specification">
+ <Description>
+ The assurance engineer can create an evidence model and link it to the assurance project asset package.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.create.evidence.model"
+ index="0"
+ name="Create a new evidence model">
+ <Description>
+ Create a new evidence model.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.create.artiface.traceability"
+ index="1"
+ name="Create Artefact Traceability">
+ <Description>
+ The assurance engineer can specify the traceability between the artefacts and other elements in the models.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.define.traceability.evidences"
+ index="0"
+ name="Define the traceability of your evidences">
+ <Description>
+ Define the traceability of your evidences.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.execute.process.generate.artefacts"
+ index="2"
+ name="Execute Process and Generate Artefacts">
+ <Description>
+ The assurance engineer import evidences either from processes modelled in EPF, from external tools or in a process management tool such as WEFACT execute the processes and retrieve the generated evidences.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.import.process.evidences.epf"
+ index="0"
+ name="Import process and evidences from EPF">
+ <Description>
+ Import process and evidences from EPF.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.import.evidences.external.tool"
+ index="1"
+ name="Import evidences from external tool">
+ <Description>
+ Import evidences from external tool.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.execute.processes.generate.evidences"
+ index="2"
+ name="Execute processes to generate evidences">
+ <Description>
+ Execute processes to generate evidences.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.manage.compliance.process.artefacts"
+ index="3"
+ name="Manage Compliance of Process and Artefacts">
+ <Description>
+ The assurance engineer should create and manage the mapping between what has been done and the needs of compliance from a standard/regulation… The assurance manager or the project manager can show the status of compliance of a project at any time.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.create.new.compliance.maps"
+ index="0"
+ name="Create a new compliance maps">
+ <Description>
+ Create a new compliance maps.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.update.compliance.project"
+ index="1"
+ name="Update the compliance of a project">
+ <Description>
+ Update the compliance of a project.
+ </Description>
+ </Activity>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.show.compliance.status.project"
+ index="2"
+ name="Show the compliance status of a project">
+ <Description>
+ Show the compliance status of a project.
+ </Description>
+ </Activity>
+ </Section>
+ <Section
+ expanded="true"
+ filtering="true"
+ id="org.eclipse.opencert.infra.dashboard.section.evidence.management.reuse"
+ index="4"
+ name="Reuse">
+ <Description>
+ Evidence management reuse.
+ </Description>
+ <Activity
+ id="org.eclipse.opencert.infra.dashboard.activity.manage.evidence.reuse.variability"
+ index="0"
+ name="Manage the evidence reuse variability">
+ <Description>
+ Manage the evidence reuse variability.
</Description>
</Activity>
</Section>
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/dialogs/PackageImportDialog.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/dialogs/PackageImportDialog.java
new file mode 100644
index 0000000..96b73be
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/dialogs/PackageImportDialog.java
@@ -0,0 +1,112 @@
+package org.eclipse.opencert.infra.dashboard.dialogs;
+
+import java.util.Collection;
+
+import org.eclipse.papyrus.uml.profile.ui.dialogs.PackageImportTreeSelectionDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * This class is cloned from org.eclipse.papyrus.uml.importt.ui as it could not be imported directly.
+ */
+public class PackageImportDialog extends PackageImportTreeSelectionDialog {
+
+ /**
+ * Default constructor.
+ *
+ * @param pShell The parent shell
+ * @param pPackage The package to import
+ */
+ public PackageImportDialog(Shell pShell, Package pPackage) {
+ super(pShell, pPackage);
+ }
+
+ /**
+ * Constructor with a collection of packages to import.
+ *
+ * @param pShell The parent shell
+ * @param pPackages The packages to import
+ */
+ public PackageImportDialog(Shell pShell, Collection<? extends Package> pPackages) {
+ super(pShell, pPackages);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Composite createDialogArea(Composite pParent) {
+ Composite vResult = (Composite) super.createDialogArea(pParent);
+
+ Composite vButtons = new Composite(vResult, SWT.NONE);
+ vButtons.setLayout(new RowLayout());
+
+ Button vBtnLoadAll = new Button(vButtons, SWT.PUSH);
+ vBtnLoadAll.setText("Load All"); //$NON-NLS-1$
+ vBtnLoadAll.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(SelectionEvent pEvent) {
+ selectAll(ImportAction.LOAD);
+ }
+ });
+
+ Button vBtnImportAll = new Button(vButtons, SWT.PUSH);
+ vBtnImportAll.setText("Import All");//$NON-NLS-1$
+ vBtnImportAll.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(SelectionEvent pEvent) {
+ selectAll(ImportAction.IMPORT);
+ }
+ });
+
+ Button vBtnCopyAll = new Button(vButtons, SWT.PUSH);
+ vBtnCopyAll.setText("Copy All"); //$NON-NLS-1$
+ vBtnCopyAll.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(SelectionEvent pEvent) {
+ selectAll(ImportAction.COPY);
+ }
+ });
+
+ Button vBtnDeselectAll = new Button(vButtons, SWT.PUSH);
+ vBtnDeselectAll.setText("Deselect All"); //$NON-NLS-1$
+ vBtnDeselectAll.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void widgetSelected(SelectionEvent pEvent) {
+ selectAll(ImportAction.NONE);
+ }
+ });
+
+ return vResult;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean isResizable() {
+ return true;
+ }
+}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/handlers/OpenDashboardHandler.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/handlers/OpenDashboardHandler.java
index 072910e..6b4ba60 100644
--- a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/handlers/OpenDashboardHandler.java
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/handlers/OpenDashboardHandler.java
@@ -43,8 +43,11 @@
import org.eclipse.ui.handlers.HandlerUtil;
/**
- * Concrete implementation for command part in Command pattern. Open the
- * dashboard for the current active project.
+ * Concrete implementation for command part in Command pattern. Open the dashboard for the current active project.
+ *
+ * TODO:
+ * - handle the opened diagram editor for CDO project
+ * - handle multiple graphical editors opened from different CHESS models
*/
public final class OpenDashboardHandler extends AbstractHandler {
@@ -97,15 +100,15 @@
}
} else {
// Otherwise, the selected element could be a CDOResource (for OpenCert project)
- Object selectedObject = getFirstSelectionObject(pEvent);
- if (selectedObject instanceof CDOResource) {
+ Object vSelectedObject = getFirstSelectionObject(pEvent);
+ if (vSelectedObject instanceof CDOResource) {
// TODO: handle the CDO resource
}
}
// Finally, if a session is found or created, open the corresponding activity explorer
if (Objects.nonNull(vSession)) {
- OpenSessionAction.openActivityExplorer(vSession);
+ OpenSessionAction.openActivityExplorer(vSession);
} else {
// Otherwise, open the dashboard for a null session
IWorkbenchPage vActivePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/helpers/ChessPapyrusHelper.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/helpers/ChessPapyrusHelper.java
new file mode 100644
index 0000000..c9af856
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/helpers/ChessPapyrusHelper.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2018 ALL4TEC.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Thanh Liem PHAN (ALL4TEC) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.opencert.infra.dashboard.helpers;
+
+import java.util.Objects;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.papyrus.commands.Activator;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.uml2.uml.Model;
+
+/**
+ * Helper methods to work with Papyrus CHESS Uml model elements.
+ */
+public final class ChessPapyrusHelper {
+
+ /** Singleton instance of this class. */
+ public static final ChessPapyrusHelper INSTANCE = new ChessPapyrusHelper();
+
+ /** Text for warning there is no active Chess editor. */
+ private final String NO_ACTIVE_CHESS_EDITOR_WARNING_TEXT = "Active Papyrus CHESS editor not found"; //$NON-NLS-1$
+
+ /** Message for warning there is no active Chess editor. */
+ private final String NO_ACTIVE_CHESS_EDITOR_WARNING_MESSAGE = "At least one Papyrus CHESS editor must be active to create a new diagram. Please open a Papyrus CHESS model."; //$NON-NLS-1$
+
+ /** Name of the model requirement view. */
+ public static final String MODEL_REQUIREMENT_VIEW_NAME = "modelRequirementView"; //$NON-NLS-1$
+
+ /** Name of the model system view. */
+ public static final String MODEL_SYSTEM_VIEW_NAME = "modelSystemView"; //$NON-NLS-1$
+
+ /**
+ * Default constructor, private to avoid instantiation.
+ */
+ private ChessPapyrusHelper() {
+ super();
+ }
+
+ /**
+ * @return The root UML model element, which is the first node in the resource content
+ */
+ public Model getUmlModelFromResource(final Resource pResource) {
+ Model vModel = null;
+
+ // Get the current Model from the resource content
+ if (!pResource.getContents().isEmpty()) {
+ // Get the root object of the resource
+ EObject vObject = pResource.getContents().get(0);
+
+ if (vObject instanceof Model) {
+ vModel = (Model) vObject;
+ }
+ }
+
+ return vModel;
+ }
+
+ /**
+ * @return The root UML model element, which is the first node in the resource content, or {@code null} if not found
+ */
+ public Model getUmlModelFromModelSet(final ModelSet pModelSet) {
+ Objects.requireNonNull(pModelSet);
+
+ Model vModel = null;
+
+ // Retrieve the Uml URI from the model set
+ URI vUmlURI = pModelSet.getURIWithoutExtension().appendFileExtension("uml"); //$NON-NLS-1$
+ Resource vResource = pModelSet.getResource(vUmlURI, false);
+
+ // Get the current model from the resource content
+ if (Objects.nonNull(vResource) && !vResource.getContents().isEmpty()) {
+ // Get the root object of the resource
+ EObject vObject = vResource.getContents().get(0);
+
+ if (vObject instanceof Model) {
+ vModel = (Model) vObject;
+ }
+ }
+
+ return vModel;
+ }
+
+ /**
+ * Get the root UML model from the diagram editor.
+ *
+ * @return The found UML {@link Model}, otherwise {@code null}
+ */
+ public Model getUmlModelFromDiagramEditor(final IMultiDiagramEditor vPapyrusDiagramEditor) {
+ Model vRootModel = null;
+
+ // Try to goto the right package and create the new diagram there
+ if (Objects.nonNull(vPapyrusDiagramEditor)) {
+ ServicesRegistry vRegistry = vPapyrusDiagramEditor.getServicesRegistry();
+
+ if (Objects.nonNull(vRegistry)) {
+ ModelSet vModelSet = null;
+ try {
+ vModelSet = vRegistry.getService(ModelSet.class);
+ } catch (ServiceException pException) {
+ Activator.log.error(pException);
+ }
+
+ if (Objects.nonNull(vModelSet)) {
+ // Get the root model
+ vRootModel = ChessPapyrusHelper.INSTANCE.getUmlModelFromModelSet(vModelSet);
+ }
+ }
+ }
+
+ return vRootModel;
+ }
+
+ /**
+ * @return The root UML model element, which is the first node in the resource content
+ */
+ public org.eclipse.uml2.uml.Package getPackageFromModelByName(final Model pModel, final String pPackageName) {
+ Objects.requireNonNull(pModel);
+ return pModel.getNestedPackage(pPackageName);
+ }
+
+ /**
+ * Open the message box to warn user that no active Papyrus editor is opened.
+ */
+ public void openNoActivePapyrusEditorMessageBox() {
+ MessageBox vMessageBox = new MessageBox(EclipseHelper.getActiveShell(), SWT.OK | SWT.ICON_WARNING);
+
+ vMessageBox.setText(NO_ACTIVE_CHESS_EDITOR_WARNING_TEXT);
+ vMessageBox.setMessage(NO_ACTIVE_CHESS_EDITOR_WARNING_MESSAGE);
+ vMessageBox.open();
+ }
+}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/helpers/EclipseHelper.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/helpers/EclipseHelper.java
index 860db70..454e652 100644
--- a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/helpers/EclipseHelper.java
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/helpers/EclipseHelper.java
@@ -5,11 +5,17 @@
*/
package org.eclipse.opencert.infra.dashboard.helpers;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.Objects;
+import java.util.Set;
import org.apache.commons.lang.ArrayUtils;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
@@ -30,7 +36,7 @@
}
/**
- * Return the current active workbench window, or if none is active, the first workbench window known by eclipse.
+ * Return the current active workbench window, or if none is active, the first workbench window known by Eclipse.
*
* @return The current workbench window
*/
@@ -138,4 +144,41 @@
return vActiveShell;
}
+
+ /**
+ * Get all the editor references in all pages of all workbench windows.
+ *
+ * @return A set of all the editor references
+ */
+ public static Set<IEditorReference> getAllEditorReferences() {
+ Set<IEditorReference> vAllEditorReferencesSet = new HashSet<>();
+
+ IWorkbench vWorkbench = PlatformUI.getWorkbench();
+
+ for (IWorkbenchWindow vWindow : vWorkbench.getWorkbenchWindows()) {
+ for (IWorkbenchPage vPage : vWindow.getPages()) {
+ vAllEditorReferencesSet.addAll(Arrays.asList(vPage.getEditorReferences()));
+ }
+ }
+
+ return vAllEditorReferencesSet;
+ }
+
+ /**
+ * @return The first Papyrus diagram editor part from all editors, or {@code null} if not found
+ */
+ public static IMultiDiagramEditor getFirstPapyrusDiagramEditorPart() {
+ IMultiDiagramEditor vEditorPart = null;
+ Iterator<IEditorReference> vIter = EclipseHelper.getAllEditorReferences().iterator();
+
+ while (vIter.hasNext() && Objects.isNull(vEditorPart)) {
+ IEditorReference vEditorReference = vIter.next();
+
+ if (vEditorReference.getEditor(false) instanceof IMultiDiagramEditor) {
+ vEditorPart = (IMultiDiagramEditor) vEditorReference.getEditor(false);
+ }
+ }
+
+ return vEditorPart;
+ }
}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/AssuranceCaseManagementPage.java
similarity index 75%
rename from org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java
rename to org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/AssuranceCaseManagementPage.java
index 32f10db..7d96d6f 100644
--- a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/AssuranceCaseManagementPage.java
@@ -14,14 +14,14 @@
package org.eclipse.opencert.infra.dashboard.pages;
/**
- * Page describing the activities related to the process reusability definition.
+ * Page describing the activities related to the assurance case management.
*/
-public class ProcessReusabilityDefinitionPage extends AbstractActivityPage {
+public class AssuranceCaseManagementPage extends AbstractActivityPage {
/**
* Default constructor.
*/
- public ProcessReusabilityDefinitionPage() {
+ public AssuranceCaseManagementPage() {
super();
}
@@ -30,6 +30,6 @@
*/
@Override
protected String getHeaderTitle() {
- return "Process Reusability Definition";
+ return "Assurance Case Management";
}
}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/EvidenceManagementPage.java
similarity index 75%
copy from org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java
copy to org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/EvidenceManagementPage.java
index 32f10db..983dbf4 100644
--- a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/EvidenceManagementPage.java
@@ -14,14 +14,14 @@
package org.eclipse.opencert.infra.dashboard.pages;
/**
- * Page describing the activities related to the process reusability definition.
+ * Page describing the activities related to the evidence management.
*/
-public class ProcessReusabilityDefinitionPage extends AbstractActivityPage {
+public class EvidenceManagementPage extends AbstractActivityPage {
/**
* Default constructor.
*/
- public ProcessReusabilityDefinitionPage() {
+ public EvidenceManagementPage() {
super();
}
@@ -30,6 +30,6 @@
*/
@Override
protected String getHeaderTitle() {
- return "Process Reusability Definition";
+ return "Evidence Management";
}
}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessComplianceDefinitionPage.java
similarity index 75%
copy from org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java
copy to org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessComplianceDefinitionPage.java
index 32f10db..dd9953c 100644
--- a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessComplianceDefinitionPage.java
@@ -14,14 +14,14 @@
package org.eclipse.opencert.infra.dashboard.pages;
/**
- * Page describing the activities related to the process reusability definition.
+ * Page describing the activities related to the process compliance definition.
*/
-public class ProcessReusabilityDefinitionPage extends AbstractActivityPage {
+public class ProcessComplianceDefinitionPage extends AbstractActivityPage {
/**
* Default constructor.
*/
- public ProcessReusabilityDefinitionPage() {
+ public ProcessComplianceDefinitionPage() {
super();
}
@@ -30,6 +30,6 @@
*/
@Override
protected String getHeaderTitle() {
- return "Process Reusability Definition";
+ return "Process Compliance Definition";
}
}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/SystemDesignAnalysisVVPage.java
similarity index 75%
copy from org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java
copy to org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/SystemDesignAnalysisVVPage.java
index 32f10db..f86c04e 100644
--- a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/ProcessReusabilityDefinitionPage.java
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/SystemDesignAnalysisVVPage.java
@@ -14,14 +14,14 @@
package org.eclipse.opencert.infra.dashboard.pages;
/**
- * Page describing the activities related to the process reusability definition.
+ * Page describing the activities related to the system design analysis, validation and verification.
*/
-public class ProcessReusabilityDefinitionPage extends AbstractActivityPage {
+public class SystemDesignAnalysisVVPage extends AbstractActivityPage {
/**
* Default constructor.
*/
- public ProcessReusabilityDefinitionPage() {
+ public SystemDesignAnalysisVVPage() {
super();
}
@@ -30,6 +30,6 @@
*/
@Override
protected String getHeaderTitle() {
- return "Process Reusability Definition";
+ return "System Design Analysis and V&V";
}
}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/AbstractCreateNewChessDiagramHyperLinkAdapter.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/AbstractCreateNewChessDiagramHyperLinkAdapter.java
new file mode 100644
index 0000000..b82a8f0
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/AbstractCreateNewChessDiagramHyperLinkAdapter.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2018 ALL4TEC.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Thanh Liem PHAN (ALL4TEC) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.opencert.infra.dashboard.pages.adapters;
+
+import java.util.Objects;
+
+import org.eclipse.opencert.infra.dashboard.helpers.ChessPapyrusHelper;
+import org.eclipse.opencert.infra.dashboard.helpers.EclipseHelper;
+import org.eclipse.papyrus.commands.Activator;
+import org.eclipse.papyrus.commands.ICreationCommand;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.uml2.uml.Model;
+
+/**
+ * A {@link HyperlinkAdapter} to create a new CHESS diagram.
+ */
+public abstract class AbstractCreateNewChessDiagramHyperLinkAdapter
+ extends AbstractCreateNewChessElementHyperLinkAdapter {
+
+ /**
+ * {@inheritDoc}
+ *
+ * Overridden to create a new diagram.
+ */
+ @Override
+ protected void createChessElement() {
+ // Create a new diagram command
+ ICreationCommand vCreationCommand = getDiagramCreationCommand();
+
+ // Get the first opened Chess Papyrus editor
+ IMultiDiagramEditor vActivePapyrusEditor = (IMultiDiagramEditor) EclipseHelper.getFirstPapyrusDiagramEditorPart();
+
+ // If there is one Chess graphical editor is opened,
+ // try to goto the right package and create the new diagram there
+ if (Objects.nonNull(vActivePapyrusEditor)) {
+ ServicesRegistry vRegistry = vActivePapyrusEditor.getServicesRegistry();
+
+ if (Objects.nonNull(vRegistry)) {
+ ModelSet vModelSet = null;
+ try {
+ vModelSet = vRegistry.getService(ModelSet.class);
+ } catch (ServiceException pException) {
+ Activator.log.error(pException);
+ }
+
+ if (Objects.nonNull(vModelSet)) {
+ // Get the root model
+ Model vRootModel = ChessPapyrusHelper.INSTANCE.getUmlModelFromModelSet(vModelSet);
+
+ // Get the target view package
+ org.eclipse.uml2.uml.Package vTargetViewPackage = getTargetPackage(vRootModel);
+
+ if (Objects.nonNull(vTargetViewPackage)) {
+ // Create the new diagram inside the target view package
+ vCreationCommand.createDiagram(vModelSet, vTargetViewPackage, null);
+
+ // Then goto the active Papyrus editor
+ EclipseHelper.getActiveWorkbenchPage().activate(vActivePapyrusEditor);
+ }
+ }
+ }
+ } else {
+ // Otherwise, no Chess graphical editor is already opened, ask user to open one
+ ChessPapyrusHelper.INSTANCE.openNoActivePapyrusEditorMessageBox();
+ }
+ }
+
+ /**
+ * @return The creation command to create a diagram
+ */
+ protected abstract ICreationCommand getDiagramCreationCommand();
+
+ /**
+ * Get the target package in which the new diagram will be created.
+ *
+ * @param pRootModel The root model
+ * @return The target package
+ */
+ protected abstract org.eclipse.uml2.uml.Package getTargetPackage(Model pRootModel);
+}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/AbstractCreateNewChessElementHyperLinkAdapter.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/AbstractCreateNewChessElementHyperLinkAdapter.java
new file mode 100644
index 0000000..6b05e35
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/AbstractCreateNewChessElementHyperLinkAdapter.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2018 ALL4TEC.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Thanh Liem PHAN (ALL4TEC) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.opencert.infra.dashboard.pages.adapters;
+
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+
+/**
+ * A {@link HyperlinkAdapter} to create a new CHESS element.
+ */
+public abstract class AbstractCreateNewChessElementHyperLinkAdapter extends HyperlinkAdapter {
+
+ /** ID of the model explorer view. */
+ protected static final String MODEL_EXPLORER_VIEW_ID = "org.eclipse.papyrus.views.modelexplorer.modelexplorer"; //$NON-NLS-1$
+
+ /**
+ * Default constructor.
+ */
+ public AbstractCreateNewChessElementHyperLinkAdapter() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void linkActivated(final HyperlinkEvent pEvent) {
+ createChessElement();
+ }
+
+ /**
+ * Create a CHESS element when the link is pressed.
+ */
+ protected abstract void createChessElement();
+}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/CreateNewChessBlockDefinitionDiagram.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/CreateNewChessBlockDefinitionDiagram.java
new file mode 100644
index 0000000..ca41c56
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/CreateNewChessBlockDefinitionDiagram.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2018 ALL4TEC.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Thanh Liem PHAN (ALL4TEC) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.opencert.infra.dashboard.pages.adapters;
+
+import org.eclipse.opencert.infra.dashboard.helpers.ChessPapyrusHelper;
+import org.eclipse.papyrus.commands.ICreationCommand;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.BlockDefinitionDiagramCreateCommand;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * A {@link HyperlinkAdapter} to create a new CHESS block definition diagram.
+ */
+public class CreateNewChessBlockDefinitionDiagram extends AbstractCreateNewChessDiagramHyperLinkAdapter {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICreationCommand getDiagramCreationCommand() {
+ return new BlockDefinitionDiagramCreateCommand();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Package getTargetPackage(final Model pRootModel) {
+ return ChessPapyrusHelper.INSTANCE.getPackageFromModelByName(pRootModel,
+ ChessPapyrusHelper.MODEL_SYSTEM_VIEW_NAME);
+ }
+}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/CreateNewChessRequirementDiagram.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/CreateNewChessRequirementDiagram.java
new file mode 100644
index 0000000..dc9569f
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/CreateNewChessRequirementDiagram.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2018 ALL4TEC.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Thanh Liem PHAN (ALL4TEC) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.opencert.infra.dashboard.pages.adapters;
+
+import org.eclipse.opencert.infra.dashboard.helpers.ChessPapyrusHelper;
+import org.eclipse.papyrus.commands.ICreationCommand;
+import org.eclipse.papyrus.sysml.diagram.requirement.RequirementDiagramCreateCommand;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+
+/**
+ * A {@link HyperlinkAdapter} to create a new CHESS requirement diagram.
+ */
+public class CreateNewChessRequirementDiagram extends AbstractCreateNewChessDiagramHyperLinkAdapter {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICreationCommand getDiagramCreationCommand() {
+ return new RequirementDiagramCreateCommand();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Package getTargetPackage(final Model pRootModel) {
+ // TODO Auto-generated method stub
+ return ChessPapyrusHelper.INSTANCE.getPackageFromModelByName(pRootModel,
+ ChessPapyrusHelper.MODEL_REQUIREMENT_VIEW_NAME);
+ }
+}
diff --git a/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/OpenImportUserModelDialogHyperLinkAdapter.java b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/OpenImportUserModelDialogHyperLinkAdapter.java
new file mode 100644
index 0000000..c3b38db
--- /dev/null
+++ b/org.eclipse.opencert.infra.dashboard/src/org/eclipse/opencert/infra/dashboard/pages/adapters/OpenImportUserModelDialogHyperLinkAdapter.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (c) 2018 ALL4TEC.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Thanh Liem PHAN (ALL4TEC) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.opencert.infra.dashboard.pages.adapters;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.jface.window.Window;
+import org.eclipse.opencert.infra.dashboard.dialogs.PackageImportDialog;
+import org.eclipse.opencert.infra.dashboard.helpers.ChessPapyrusHelper;
+import org.eclipse.opencert.infra.dashboard.helpers.EclipseHelper;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.uml.profile.ui.dialogs.ElementImportTreeSelectionDialog.ImportSpec;
+import org.eclipse.papyrus.uml.tools.importsources.PackageImportSourceDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.PackageImport;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * A {@link HyperLinkAdapter} to open the {@link PackageImportDialog} dialog.
+ */
+public class OpenImportUserModelDialogHyperLinkAdapter extends AbstractOpenDialogHyperLinkAdapter {
+
+ /**
+ * Default constructor.
+ */
+ public OpenImportUserModelDialogHyperLinkAdapter() {
+ super();
+ }
+
+ /**
+ * Open a dialog when the link is pressed.
+ */
+ @Override
+ protected void openDialog() {
+ // Retrieve shell instance
+ Shell vShell = EclipseHelper.getActiveShell();
+
+ // Get the first Papyrus diagram editor
+ IMultiDiagramEditor vPapyrusEditor = EclipseHelper.getFirstPapyrusDiagramEditorPart();
+
+ // Get the root model
+ Model vRootModel = ChessPapyrusHelper.INSTANCE.getUmlModelFromDiagramEditor(vPapyrusEditor);
+
+ if (Objects.nonNull(vRootModel)) {
+ Map<String, String> vExtensionFilters = new LinkedHashMap<String, String>();
+ vExtensionFilters.put("*.uml", "UML (*.uml)"); //$NON-NLS-1$
+ vExtensionFilters.put("*.profile.uml", "UML Profiles (*.profile.uml)"); //$NON-NLS-1$ //$NON-NLS-2$
+ vExtensionFilters.put("*", "All (*)"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Collection<EObject> vSelections = new ArrayList<>();
+ vSelections.add(vRootModel);
+
+ Collection<Package> vPackages = PackageImportSourceDialog.open(vShell, "Select the models to import", //$NON-NLS-1$
+ vSelections, vExtensionFilters);
+
+ if (Objects.nonNull(vPackages) && !vPackages.isEmpty()) {
+ PackageImportDialog vPackageImportDialog = new PackageImportDialog(vShell, vPackages);
+
+ if (Window.OK == vPackageImportDialog.open()) {
+ Collection<ImportSpec<Package>> vResult = vPackageImportDialog.getResult();
+
+ for (ImportSpec<Package> vResultElement : vResult) {
+ Package vSelectedPackage = vResultElement.getElement();
+ switch (vResultElement.getAction()) {
+ case COPY:
+ handleCopyPackage(vSelectedPackage, vRootModel);
+ break;
+ case IMPORT:
+ handleImportPackage(vSelectedPackage, vRootModel);
+ break;
+ default:
+ handleLoadPackage(vSelectedPackage, vRootModel);
+ break;
+ }
+ }
+
+ // Then goto the active Papyrus editor
+ EclipseHelper.getActiveWorkbenchPage().activate(vPapyrusEditor);
+ }
+ }
+ } else {
+ // Otherwise, no Chess graphical editor is already opened, ask user to open one
+ ChessPapyrusHelper.INSTANCE.openNoActivePapyrusEditorMessageBox();
+ }
+ }
+
+ /**
+ * Load the Package resource into the target package.
+ *
+ * @param pPackage The selected package to import
+ * @param pTargetPackage The target package
+ */
+ protected void handleLoadPackage(final Package pPackage, final EObject pTargetPackage) {
+ EMFHelper.reloadIntoContext(pPackage, pTargetPackage);
+ }
+
+ /**
+ * Create a PackageImport in the target package, which refers to the selected package.
+ *
+ * @param pSelectedPackage The selected package
+ * @param pTargetPackage The target package
+ */
+ protected void handleImportPackage(final Package pSelectedPackage, final EObject pTargetPackage) {
+ PackageImport vPackageImport = UMLFactory.eINSTANCE.createPackageImport();
+
+ Package vImportedPackage = EMFHelper.reloadIntoContext(pSelectedPackage, pTargetPackage);
+
+ ((Package) pTargetPackage).getPackageImports().add(vPackageImport);
+ vPackageImport.setImportedPackage(vImportedPackage);
+ }
+
+ /**
+ * Create a copy of the selected package in the target package.
+ *
+ * @param pSelectedPackage The selected package
+ * @param pTargetPackage The target package
+ */
+ protected void handleCopyPackage(Package pSelectedPackage, final EObject pTargetPackage) {
+ // FIXME: Stereotype applications are not copied
+ ((Package) pTargetPackage).getNestedPackages().add(EcoreUtil.copy(pSelectedPackage));
+ }
+}