Skip to content
Snippets Groups Projects
Commit a6732eea authored by Alberto Debiasi's avatar Alberto Debiasi
Browse files

Added the following plugins:


- contractEditor
- contraintEditor
- propertyEditor

- hierarchicalContractView
- refinementView

- safetyAnalysis

- verificationService

- diagram.eu


Change-Id: Ia8617063336b0d866b66555d0ac319432a610486
Signed-off-by: default avatarAlberto Debiasi <adebiasi@fbk.eu>
parent c470eee4
No related branches found
No related tags found
No related merge requests found
Showing
with 457 additions and 0 deletions
<?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>
/bin/
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.polarsys.chess.constraints.constraintEditor</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.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
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
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.polarsys.chess.constraints.constraintEditor
Bundle-SymbolicName: org.polarsys.chess.constraints.constraintEditor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.ui.views.properties.tabbed,
org.eclipse.core.resources,
org.eclipse.emf.edit.ui,
org.eclipse.papyrus.infra.emf,
org.polarsys.chess.chessmlprofile;bundle-version="0.9.0",
org.polarsys.chess.contracts.profile,
org.polarsys.chess.core
Import-Package: eu.fbk.eclipse.standardtools.constraintEditor.constraintTab,
org.eclipse.emf.edit.ui.action,
org.eclipse.gef,
org.eclipse.gmf.runtime.diagram.ui.editparts,
org.eclipse.papyrus.uml.diagram.common.edit.part,
org.eclipse.uml2.uml,
org.polarsys.chess.service.internal.utils
Bundle-Vendor: Fondazione Bruno Kessler
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
<propertyTabs
contributorId="TreeOutlinePage">
<propertyTab
afterTab="advanced"
category="Editors"
id="CustomConstraintTab"
label="ConstraintEditor+">
</propertyTab>
</propertyTabs>
</extension>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertySections">
<propertySections
contributorId="TreeOutlinePage">
<propertySection
class="org.polarsys.chess.constraints.constraintEditor.CustomConstraintEditorTab"
filter="org.polarsys.chess.constraints.constraintEditor.ConstraintEditorFilter"
id="CustomConstraintEditorSection"
tab="CustomConstraintTab">
</propertySection>
</propertySections>
</extension>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
<propertyContributor
contributorId="TreeOutlinePage">
<propertyCategory
category="Editors">
</propertyCategory>
</propertyContributor>
</extension>
</plugin>
/*******************************************************************************
* Copyright (C) 2017 Fondazione Bruno Kessler.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alberto Debiasi - initial API and implementation
******************************************************************************/
package org.polarsys.chess.constraints.constraintEditor;
import org.eclipse.uml2.uml.Constraint;
import org.polarsys.chess.contracts.profile.chesscontract.util.ContractEntityUtil;
import org.polarsys.chess.service.internal.utils.SelectionUtil;
/**
* It Filters the selected objects that are constraints. *
*/
public class ConstraintEditorFilter implements org.eclipse.jface.viewers.IFilter {
private ContractEntityUtil contractEntityUtil = ContractEntityUtil.getInstance();
private SelectionUtil selectionUtil = SelectionUtil.getInstance();
@Override
public boolean select(Object selected) {
Object selectedUmlElement = selectionUtil.getUmlSelectedObject(selected);
if (selectedUmlElement instanceof Constraint) {
if (!contractEntityUtil.isFormalProperty((Constraint) selectedUmlElement)) {
return true;
}
}
return false;
}
}
/*******************************************************************************
* Copyright (C) 2017 Fondazione Bruno Kessler.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alberto Debiasi - initial API and implementation
******************************************************************************/
package org.polarsys.chess.constraints.constraintEditor;
import java.util.Set;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Constraint;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Property;
import org.polarsys.chess.contracts.profile.chesscontract.util.EntityUtil;
import org.polarsys.chess.service.internal.utils.SelectionUtil;
import eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.ConstraintEditorTab;
/**
* This is the constraint editor designed for the CHESS platform. It extends the
* ConstraintEditorTab that is designed to be extended and contains standard
* methods not related to specific technologies. The only rule is that it works
* for Eclipse based platforms.
*
*/
public class CustomConstraintEditorTab extends ConstraintEditorTab {
private SelectionUtil selectionUtil = SelectionUtil.getInstance();
private EntityUtil entityUtil = EntityUtil.getInstance();
@Override
public Resource getResourceFromConstraint(Object constraint) {
return ((Constraint) constraint).eResource();
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getSubComponentsName(java.lang.Object)
*/
@Override
public String[] getSubComponentsName(Object constraint) {
Element umlElement = ((Constraint) constraint).getOwner();
Set<String> subCompArr = entityUtil.getSubComponentsNames((Class) umlElement);
String[] subComStrArr = new String[subCompArr.size()];
return subCompArr.toArray(subComStrArr);
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getSubComponent(java.lang.Object, java.lang.String)
*/
@Override
public Object getSubComponent(Object constraint, String componentName) {
Element element = ((Constraint) constraint).getOwner();
for (Property umlProperty : entityUtil.getSubComponents((Class) element)) {
if (umlProperty.getName().compareTo(componentName) == 0) {
return entityUtil.getUmlType(umlProperty);
}
}
return null;
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getInputOutputPorts(java.lang.Object)
*/
@Override
public String[] getInputOutputPorts(Object component) {
return entityUtil.getPortsNames((Element) component, FlowDirection.INOUT_VALUE);
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getInputPorts(java.lang.Object)
*/
@Override
public String[] getInputPorts(Object component) {
return entityUtil.getPortsNames((Element) component, FlowDirection.IN_VALUE);
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getOutputPorts(java.lang.Object)
*/
@Override
public String[] getOutputPorts(Object component) {
return entityUtil.getPortsNames((Element) component, FlowDirection.OUT_VALUE);
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getConstraintOwnerInputPorts(java.lang.Object)
*/
@Override
public String[] getConstraintOwnerInputPorts(Object constraint) {
Element element = ((Constraint) constraint).getOwner();
return getInputPorts(element);
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getConstraintOwnerOutputPorts(java.lang.Object)
*/
@Override
public String[] getConstraintOwnerOutputPorts(Object constraint) {
Element element = ((Constraint) constraint).getOwner();
return getOutputPorts(element);
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getConstraintOwnerInputOutputPorts(java.lang.Object)
*/
@Override
public String[] getConstraintOwnerInputOutputPorts(Object constraint) {
Element element = ((Constraint) constraint).getOwner();
return getInputOutputPorts(element);
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getConstraintOwnerProperties(java.lang.Object)
*/
@Override
public String[] getConstraintOwnerProperties(Object constraint) {
Class element = (Class) ((Constraint) constraint).getOwner();
EList<String> attrArr = new BasicEList<String>();
attrArr.addAll(entityUtil.getBooleanAttributesNamesExceptsPorts(element));
String[] attributesStrArr = new String[attrArr.size()];
return attrArr.toArray(attributesStrArr);
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#returnConstraint(org.eclipse.jface.viewers.
* ISelection)
*/
@Override
public Object returnConstraint(ISelection selection) {
/*
* Object selected = null; if ((selection instanceof
* IStructuredSelection)) {
*
* List<?> selectionList = ((IStructuredSelection) selection).toList();
* if (selectionList.size() == 1) { selected = selectionList.get(0); } }
* EObject selectedEObject = EMFHelper.getEObject(selected); if
* (selectedEObject != null) { selected = selectedEObject; } if
* (selected instanceof GraphicalEditPart) { selected =
* (((GraphicalEditPart) selected).resolveSemanticElement()); }
*/
Object selectedUmlElement = selectionUtil.getUmlSelectedObject(selection);
if (selectedUmlElement instanceof Constraint) {
return (Constraint) selectedUmlElement;
}
return null;
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#constraintEditorchanged(java.lang.Object,
* java.lang.String)
*/
@Override
public void constraintEditorchanged(Object constraint, String textChanged) {
entityUtil.saveConstraint(((Constraint) constraint), textChanged);
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getConstraintName(java.lang.Object)
*/
public String getConstraintName(Object constraint) {
if (constraint != null) {
return ((Constraint) constraint).getQualifiedName();
}
return null;
}
/*
* (non-Javadoc)
*
* @see eu.fbk.eclipse.standardtools.constraintEditor.constraintTab.
* ConstraintEditorTab#getStrFromConstraint(java.lang.Object)
*/
public String getStrFromConstraint(Object constraint) {
return ((Constraint) constraint).getSpecification().stringValue();
}
@Override
public String[] getEnumValuesFromConstraintOwnerPorts(Object constraint) {
Class element = (Class) ((Constraint) constraint).getOwner();
return entityUtil.getEnumValuesFromComponentPorts(element);
}
}
<?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>
/bin/
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.polarsys.chess.contracts.contractEditor</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.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
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
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.polarsys.chess.contracts.contractEditor
Bundle-SymbolicName: org.polarsys.chess.contracts.contractEditor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.papyrus.uml.diagram.composite;bundle-version="1.0.0",
org.polarsys.chess.chessmlprofile;bundle-version="0.9.0",
org.eclipse.papyrus.uml.properties;bundle-version="1.0.0",
org.polarsys.chess.contracts.profile,
org.polarsys.chess.core
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Fondazione Bruno Kessler
Import-Package: eu.fbk.eclipse.standardtools.contractEditor.core,
eu.fbk.eclipse.standardtools.contractEditor.propertyTab,
eu.fbk.eclipse.standardtools.contractEditor.view,
org.eclipse.emf.cdo.internal.explorer.checkouts;version="4.5.0",
org.eclipse.emf.cdo.transfer,
org.eclipse.emf.cdo.transfer.ui;version="4.2.300",
org.eclipse.ui.navigator.resources,
org.eclipse.xtext.ui.editor.embedded,
org.polarsys.chess.service.internal.utils
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
icons/
org.polarsys.chess.contracts.contractEditor/icons/add_obj.gif

318 B

org.polarsys.chess.contracts.contractEditor/icons/editor.gif

932 B

org.polarsys.chess.contracts.contractEditor/icons/editor_area.gif

219 B

org.polarsys.chess.contracts.contractEditor/icons/elipses.gif

124 B

org.polarsys.chess.contracts.contractEditor/icons/new_untitled_text_file.gif

576 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment