Commit c449348e authored by Carmen Carlan's avatar Carmen Carlan

Starting fresh.

parent e017f3bd
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="generated-src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="build"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.fortiss.af3.safetycases</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.fortiss.ide.dev_tools.emf.builder.EcoreBuilder</name>
<arguments>
</arguments>
</buildCommand>
<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>
<buildCommand>
<name>org.fortiss.ide.dev_tools.warnings.RemoveWarningsBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.fortiss.af3.safetycases;singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.fortiss.af3.safetycases.AF3SafetyCasesActivator
Require-Bundle: org.fortiss.af3.project,
org.fortiss.af3.component;bundle-version="2.2.0",
org.fortiss.tooling.kernel.ui;bundle-version="2.2.0",
org.fortiss.tooling.base.ui;bundle-version="2.2.0",
org.fortiss.af3.sil;bundle-version="1.0.0",
org.fortiss.af3.mira;bundle-version="2.2.0",
org.fortiss.af3.deployment;bundle-version="2.2.0",
org.eclipse.core.expressions;bundle-version="3.4.300",
org.fortiss.af3.expression
Export-Package: org.fortiss.af3.safetycases,
org.fortiss.af3.safetycases.model,
org.fortiss.af3.safetycases.model.requirementsPattern,
org.fortiss.af3.safetycases.utils
Import-Package: org.fortiss.af3.safetycases
This README describes the necessary steps to add a new org.fortiss.af3 plugin
starting from the base project you just imported. There are three steps to do
in order to transform the imported project into your specific plugin:
1. Change the Eclipse project name at several locations and files
2. Change the EMF .ecore model and .genmodel file
3. Publish your plugin to a Subversion repository
The imported project is called "org.fortiss.af3.base.project". During this
README we will use "org.fortiss.af3.example" as our plugin name and "example"
as our EMF model name. You should choose a suitable name for your plugin and
follow the instructions accordingly.
--------------------------------------------------------------------
1. Changes to the Eclipse project
--------------------------------------------------------------------
a. Choose a name for your AF3 extension.
b. Select the Eclipse project folder itself and rename it by hitting F2.
c. Goto the "src" folder and rename the Java package by hitting F2.
d. Find the Activator class in the package you just renamed and give it
a suitable name, e.g., "AF3ExampleActivator".
--------------------------------------------------------------------
2. Changes to the EMF model
--------------------------------------------------------------------
a. Open the file "model/generate-ecore.xml". Change the name of the project
in lines 2 and 5. Change the name of the model in line 4, e.g. "example".
b. Rename the files "model.ecore" and "model.genmodel" to the name just
selected, e.g., "example.ecore" and "example.genmodel".
c. Open the "example.ecore" file in the "Sample Ecore Model Editor" by
right-clicking the file and choosing "Open With". Unfold the tree in the
editor and select the "model" package. Right-click it an choose
"Show Properties View". Change the "NS prefix" and "NS Uri" using the
respective pattern, e.g., "org-fortiss-af3-example" and
"http://www.fortiss.org/af3/example".
d. Open the "example.genmodel" file in the "Text Editor" by right-clicking the
file and choosing "Open With". Search and replace "base.project" with
"example". There should be only one occurence of this pattern.
Search and replace "model.ecore" with "example.ecore". There should be three
occurrences of this pattern.
Close the Text Editor and open the file with the "EMF Generator". There
should not be any errors. DO NOT generate the EMF model now.
--------------------------------------------------------------------
3. Publish the plugin to a Subversion repository
--------------------------------------------------------------------
a. Create or let the repository admin create a folder for the plugin in the
repository named "org.fortiss.af3.example". You will need write permission
to this folder. DO NOT create the "trunk" sub-folder. It will be created
during the initial upload.
b. Right-click the Eclipse project "org.fortiss.af3.example" and choose
"Team -> Share Project...". Select "SVN" and hit "Next". Select your
repository and hit "Next". Choose the "Use specified folder name" option and
enter "org.fortiss.af3.example/trunk". Note that you might need to provide
more prefix folders if your plugin is not stored in the repository root
folder. Hit "Finish". The "trunk" folder will be created and your Eclipse
project is now connected to the repository. Note that the files of the
project have not yet been commited to the repository.
c. Select the "generated-src" folder and add it to version control (right-click
it and select "Team -> Add To Version Control"). Right-click it again and
select "Team -> Set Property...". Set the "svn:ignore" property to "*",
which makes all content of this folder to be ignore by Subversion.
d. Add the ".settings" folder to version control and set its "svn:externals"
property to
"^/fortiss-std-env/settings/org.eclipse.jdt.core.prefs org.eclipse.jdt.core.prefs
^/fortiss-std-env/settings/org.eclipse.jdt.ui.prefs org.eclipse.jdt.ui.prefs"
This references the fortiss Eclipse preferences, which are now also the
project specific settings. Choose "Team -> Update To HEAD" to fetch the
externals you just referenced.
e. On the top-level folder of your plugin set the following SVN properties, if
you want to use the bugtracker integration. We use Redmine where issues are
identified by numbers.
"bugtraq:append" "true"
"bugtraq:number" "true"
"bugtraq:warnifnoissue" "true"
"bugtraq:message" "refs %BUGID%"
f. Delete this README file and commit the whole project to the repository. Note
that do not need to add all the files manually. They will be added when you
choose "Team -> Commit..." on the Eclipse project (see the lower part of the
commit dialog).
<?xml version="1.0" encoding="UTF-8"?>
<cspecExtension
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bc="http://www.eclipse.org/buckminster/Common-1.0"
xmlns="http://www.eclipse.org/buckminster/CSpec-1.0">
<actions>
<!-- Place your Actions here -->
<public name="generate-ecore" actor="jdt.ant" always="true">
<actorProperties>
<property key="buildFile" value="model/generate-ecore.xml" />
<property key="targets" value="generate-ecore"/>
</actorProperties>
<products>
<path path="generated-src" />
</products>
</public>
</actions>
<alterGroups>
<!-- Place your Group alterations here -->
<public name="eclipse.build.source">
<attribute name="generate-ecore"/>
</public>
</alterGroups>
</cspecExtension>
# <copyright>
# </copyright>
#
# $Id$
bin.includes = .,\
model/,\
META-INF/,\
plugin.xml,\
plugin.properties
source.. = src/,\
generated-src/
output.. = build/
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="org.fortiss.af3.safetycases" default="generate-ecore" basedir="..">
<property name="model.name" value="safetycases" />
<property name="model.project" value="org.fortiss.af3.safetycases" />
<!-- Classpath Definition -->
<buckminster.valuepath id="project.classpath" value="${fs:project.classpath}" />
<path id="classpath">
<path refid="project.classpath"/>
<!-- add src to the classpath as only the bin directory is in the classpath
and some resources such as the workflow or properties file might not yet
have been copied to the bin directory -->
<pathelement location="src"/>
</path>
<!-- Generation Tasks -->
<target name="generate-ecore">
<emf.Ecore2Java
model="model/${model.name}.ecore"
genModel="model/${model.name}.genmodel"
modelProject="/${model.project}"
modelProjectFragmentPath="generated-src"
reconcileGenModel="reload">
</emf.Ecore2Java>
</target>
</project>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
# <copyright>
# </copyright>
#
# $Id$
pluginName = Micro Model
providerName = www.example.org
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
<copyright>
</copyright>
$Id$
-->
<plugin>
<extension
point="org.eclipse.emf.ecore.generated_package">
<package
class="org.fortiss.af3.safetycases.model.SafetyCasesPackage"
genModel="model/saetycases.genmodel"
uri="http://www.fortiss.org/af3/safetycases">
</package>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementCompositor">
<modelElementCompositor
compositor="org.fortiss.af3.safetycases.compose.SafetyCasesFileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
<modelElementCompositor
compositor="org.fortiss.af3.safetycases.compose.LibraryCompositor">
<modelElementClass
modelElementClass="org.fortiss.tooling.kernel.model.ILibrary">
</modelElementClass>
</modelElementCompositor>
<modelElementCompositor
compositor="org.fortiss.af3.safetycases.compose.LibraryModulePackageCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.safetycases.model.LibraryModulePackage">
</modelElementClass>
</modelElementCompositor>
<modelElementCompositor
compositor="org.fortiss.af3.safetycases.compose.PatternsDatabaseFileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
<modelElementCompositor
compositor="org.fortiss.af3.safetycases.compose.LibraryPatternsDatabasePackageCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.safetycases.model.LibraryPatternsDatabasePackage">
</modelElementClass>
</modelElementCompositor>
<modelElementCompositor
compositor="org.fortiss.af3.safetycases.compose.EvidenceManagerFileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
<modelElementCompositor
compositor="org.fortiss.af3.safetycases.compose.HazardsLogFileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementLibraryHandler">
<modelElementLibraryHandler
handler="org.fortiss.af3.safetycases.library.ModuleLibraryHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.safetycases.model.ArgumentModule">
</modelElementClass>
</modelElementLibraryHandler>
<modelElementLibraryHandler
handler="org.fortiss.af3.safetycases.library.PatternsDatabaseLibraryHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.safetycases.model.requirementsPattern.PatternsDatabase">
</modelElementClass>
</modelElementLibraryHandler>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelPrototypeProvider">
<modelPrototypeProvider
provider="org.fortiss.af3.safetycases.library.prototypes.ModuleLibraryPrototypeProvider">
</modelPrototypeProvider>
<modelPrototypeProvider
provider="org.fortiss.af3.safetycases.library.prototypes.PatternsDatabaseLibraryPrototypeProvider">
</modelPrototypeProvider>
</extension>
</plugin>
package org.fortiss.af3.safetycases;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle.
*/
public class AF3SafetyCasesActivator extends Plugin {
/** The plug-in ID. */
public static final String PLUGIN_ID = AF3SafetyCasesActivator.class.getPackage().getName(); //$NON-NLS-1$
/** The shared instance. */
private static AF3SafetyCasesActivator plugin;
/** Constructor. */
public AF3SafetyCasesActivator() {
// do nothing
}
/** {@inheritDoc} */
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/** {@inheritDoc} */
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/** Returns the shared instance. */
public static AF3SafetyCasesActivator getDefault() {
return plugin;
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2013 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.safetycases.compose;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.project.compositor.FileProjectCompositor;
import org.fortiss.af3.safetycases.model.EvidenceManager;
/**
*
* @author carmen
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class EvidenceManagerFileProjectCompositor extends FileProjectCompositor {
/** {@inheritDoc} */
@Override
protected boolean isCorrectElementClass(EObject contained) {
return contained instanceof EvidenceManager;
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2013 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.safetycases.compose;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.project.compositor.FileProjectCompositor;
import org.fortiss.af3.safetycases.model.HazardLog;
/**
*
* @author carmen
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class HazardsLogFileProjectCompositor extends FileProjectCompositor {
/** {@inheritDoc} */
@Override
protected boolean isCorrectElementClass(EObject contained) {
return contained instanceof HazardLog;
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2013 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.safetycases.compose;
import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.safetycases.model.LibraryModulePackage;
import org.fortiss.af3.safetycases.model.LibraryPatternsDatabasePackage;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
import org.fortiss.tooling.kernel.model.ILibrary;
import org.fortiss.tooling.kernel.model.ILibraryRootElement;
/**
*
* @author carmen
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class LibraryCompositor implements IElementCompositor<ILibrary> {
/** {@inheritDoc} */
@Override
public boolean canCompose(ILibrary container, EObject contained,
IElementCompositionContext context) {
return contained instanceof LibraryModulePackage ||
contained instanceof LibraryPatternsDatabasePackage;
}
/** {@inheritDoc} */
@Override
public boolean
compose(ILibrary container, EObject contained, IElementCompositionContext context) {
if(contained instanceof LibraryModulePackage ||
contained instanceof LibraryPatternsDatabasePackage)
return container.getRootElements().add((ILibraryRootElement)contained);
return false;
}
/** {@inheritDoc} */
@Override
public boolean canComposePrototype(Prototype prototype) {
return true;
}
/** {@inheritDoc} */
@Override
public boolean canDecompose(EObject contained) {
return true;
}
/** {@inheritDoc} */
@Override
public boolean decompose(EObject contained) {
delete(contained, true);
return true;
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2013 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.safetycases.compose;
import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.safetycases.model.LibraryModulePackage;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
/**
*
* @author carmen
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class LibraryModulePackageCompositor implements IElementCompositor<LibraryModulePackage> {
/** {@inheritDoc} */
@Override
public boolean canCompose(LibraryModulePackage container, EObject contained,
IElementCompositionContext context) {
return contained instanceof LibraryModulePackage;
}
/** {@inheritDoc} */
@Override
public boolean compose(LibraryModulePackage container, EObject contained,
IElementCompositionContext context) {
LibraryModulePackage pack = (LibraryModulePackage)contained;
return container.getSubPackages().add(pack);
}
/** {@inheritDoc} */
@Override
public boolean canComposePrototype(Prototype prototype) {
return true;
}
/** {@inheritDoc} */
@Override
public boolean canDecompose(EObject contained) {
return true;
}
/** {@inheritDoc} */
@Override
public boolean decompose(EObject contained) {
delete(contained, true);
return true;
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2013 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |