Skip to content

Commit

Permalink
#130 Add QuickFix for VR REQ_Relation_01, REQ_Relation_02
Browse files Browse the repository at this point in the history
Resolves #130

Change-Id: I0dd6502fd052ea53a6ca78ecefc2212fbbb8ee0a
Signed-off-by: Georgiana-Elena ECOBICI <georgiana-elena.ecobici@thalesgroup.com>
  • Loading branch information
georgiana-ecobici authored and pdulth committed May 18, 2021
1 parent 5ac5359 commit 03c2a91
Show file tree
Hide file tree
Showing 14 changed files with 398 additions and 10 deletions.
27 changes: 17 additions & 10 deletions features/org.polarsys.capella.vp.requirements.feature/feature.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2016, 2020 THALES GLOBAL SERVICES.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0
SPDX-License-Identifier: EPL-2.0
Contributors:
Thales - initial API and implementation
<!--
Copyright (c) 2016, 2020 THALES GLOBAL SERVICES.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0
SPDX-License-Identifier: EPL-2.0
Contributors:
Thales - initial API and implementation
-->
<feature
id="org.polarsys.capella.vp.requirements.feature"
Expand Down Expand Up @@ -121,5 +121,12 @@
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="org.polarsys.capella.vp.requirements.quickfix"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions plugins/org.polarsys.capella.vp.requirements.quickfix/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.polarsys.capella.vp.requirements.quickfix</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.polarsys.capella.vp.requirements.quickfix;singleton:=true
Bundle-Version: 0.12.1.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.ui,
org.polarsys.capella.core.validation.ui.ide,
org.polarsys.kitalpha.vp.requirements.model,
org.eclipse.sirius,
org.polarsys.capella.core.data.gen,
org.polarsys.capella.core.platform.sirius.ui.actions,
org.polarsys.capella.common.ef,
org.polarsys.capella.vp.requirements.model,
org.polarsys.capella.vp.requirements.model.helpers,
org.polarsys.capella.core.model.handler
Bundle-Vendor: %bundleVendor
Bundle-Localization: plugin
Bundle-Activator: org.polarsys.capella.vp.requirements.quickfix.Activator
Export-Package: org.polarsys.capella.vp.requirements.quickfix
36 changes: 36 additions & 0 deletions plugins/org.polarsys.capella.vp.requirements.quickfix/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>

<p>November 30, 2017</p>
<h3>License</h3>

<p>
The Eclipse Foundation makes available all content in this plug-in
(&quot;Content&quot;). Unless otherwise indicated below, the Content
is provided to you under the terms and conditions of the Eclipse
Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.
</p>

<p>
If you did not receive this Content directly from the Eclipse
Foundation, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the
Redistributor's license that was provided with the Content. If no such
license exists, contact the Redistributor. Unless otherwise indicated
below, the terms and conditions of the EPL still apply to any source
code in the Content and such source code may be obtained at <a
href="http://www.eclipse.org/">http://www.eclipse.org</a>.
</p>

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# =============================================================================
# Copyright (c) 2021 THALES GLOBAL SERVICES.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Thales - initial API and implementation
# =============================================================================
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
about.html,\
plugin.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ====================================================================
# Copyright (c) 2021 THALES GLOBAL SERVICES.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Thales - initial API and implementation
# ====================================================================
bundleName = Capella Requirements Quickfix
bundleVendor = Eclipse.org

# Rule REQ_Relation_01
quickFix.REQ_Relation_01.desc=Delete Relation
quickFix.REQ_Relation_01.label=Delete Relation

# Rule REQ_Relation_02
quickFix.REQ_Relation_02.desc=Delete Duplicated Relations
quickFix.REQ_Relation_02.label=Delete Duplicated Relations
37 changes: 37 additions & 0 deletions plugins/org.polarsys.capella.vp.requirements.quickfix/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<!--
Copyright (c) 2021 THALES GLOBAL SERVICES.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0
SPDX-License-Identifier: EPL-2.0
Contributors:
Thales - initial API and implementation
-->
<plugin>

<extension
point="org.polarsys.capella.core.validation.ui.ide.capellaQuickFix">
<resolver
class="org.polarsys.capella.vp.requirements.quickfix.DeleteRelation_REQ_Relation_01"
desc="%quickFix.REQ_Relation_01.desc"
icon="platform:/plugin/org.polarsys.capella.core.ui.resources/icons/full/obj16/capella_delete.gif"
label="%quickFix.REQ_Relation_01.label">
<rules
ruleId="REQ_Relation_01">
</rules>
</resolver>
<resolver
class="org.polarsys.capella.vp.requirements.quickfix.DeleteRelation_REQ_Relation_02"
desc="%quickFix.REQ_Relation_02.desc"
icon="platform:/plugin/org.polarsys.capella.core.ui.resources/icons/full/obj16/capella_delete.gif"
label="%quickFix.REQ_Relation_02.label">
<rules
ruleId="REQ_Relation_02">
</rules>
</resolver>
</extension>
</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*******************************************************************************
* Copyright (c) 2021 THALES GLOBAL SERVICES.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Thales - initial API and implementation
*******************************************************************************/
package org.polarsys.capella.vp.requirements.quickfix;

import org.eclipse.ui.plugin.AbstractUIPlugin;

public class Activator extends AbstractUIPlugin {

// The plug-in ID
public static final String PLUGIN_ID = "org.polarsys.capella.vp.requirements.quickfix"; //$NON-NLS-1$

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*******************************************************************************
* Copyright (c) 2021 THALES GLOBAL SERVICES.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Thales - initial API and implementation
*******************************************************************************/
package org.polarsys.capella.vp.requirements.quickfix;

import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractDeleteCommandResolver;
import org.polarsys.kitalpha.vp.requirements.Requirements.AbstractRelation;

public class DeleteRelation_REQ_Relation_01 extends AbstractDeleteCommandResolver {

@Override
public Object getElementToDelete(Object obj) {
if (obj instanceof AbstractRelation) {
return obj;
}
return null;
}

}

0 comments on commit 03c2a91

Please sign in to comment.