Commit e36ff8c3 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

added individual FileProject compositors for all root elements.

refs 929
parent d0af1d12
......@@ -164,4 +164,13 @@
</target>
</transformationProvider>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementCompositor">
<modelElementCompositor
compositor="org.fortiss.af3.component.compositor.ComponentArchitectureFileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
</extension>
</plugin>
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 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.component.compositor;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.project.compositor.FileProjectCompositor;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
/**
* {@link IElementCompositor} implementation for the {@link ComponentArchitecture}s.
*
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 22BFACF73FAE6EE6A346CE071B9076EA
*/
public final class ComponentArchitectureFileProjectCompositor extends FileProjectCompositor {
/** {@inheritDoc} */
@Override
protected boolean isCorrectElementClass(EObject contained) {
return contained instanceof ComponentArchitecture;
}
}
......@@ -68,4 +68,13 @@
</modelElementClass>
</modelElementConstraintChecker>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementCompositor">
<modelElementCompositor
compositor="org.fortiss.af3.deployment.compositor.DeploymentFileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
</extension>
</plugin>
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 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.deployment.compositor;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.deployment.model.Deployment;
import org.fortiss.af3.project.compositor.FileProjectCompositor;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
/**
* {@link IElementCompositor} implementation for the {@link Deployment}s.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 32292A5112183D2B01E9448860CC39D0
*/
public final class DeploymentFileProjectCompositor extends FileProjectCompositor {
/** Checks composed elment class. */
@Override
protected boolean isCorrectElementClass(EObject contained) {
return contained instanceof Deployment;
}
}
......@@ -105,4 +105,13 @@
</target>
</transformationProvider>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementCompositor">
<modelElementCompositor
compositor="org.fortiss.af3.expression.compositor.DataDictionaryFileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
</extension>
</plugin>
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 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.expression.compositor;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.expression.model.DataDictionary;
import org.fortiss.af3.project.compositor.FileProjectCompositor;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
/**
* {@link IElementCompositor} implementation for the {@link DataDictionary}s.
*
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 5C9C98E4446674D35676D57F63CBC1E6
*/
public final class DataDictionaryFileProjectCompositor extends FileProjectCompositor {
/** {@inheritDoc} */
@Override
protected boolean isCorrectElementClass(EObject contained) {
return contained instanceof DataDictionary;
}
}
......@@ -72,6 +72,12 @@
modelElementClass="org.fortiss.af3.mira.model.Requirement">
</modelElementClass>
</modelElementCompositor>
<modelElementCompositor
compositor="org.fortiss.af3.mira.compose.AnalysisFileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementConstraintChecker">
......
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 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.mira.compose;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.mira.model.Analysis;
import org.fortiss.af3.project.compositor.FileProjectCompositor;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
/**
* {@link IElementCompositor} implementation for the {@link Analysis}s.
*
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 3D7F5C78C11F8A7DADDC5934BCDA0C64
*/
public final class AnalysisFileProjectCompositor extends FileProjectCompositor {
/** {@inheritDoc} */
@Override
protected boolean isCorrectElementClass(EObject contained) {
return contained instanceof Analysis;
}
}
......@@ -94,5 +94,14 @@
</target>
</transformationProvider>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementCompositor">
<modelElementCompositor
compositor="org.fortiss.af3.platform.compositor.PlatformArchitectureFileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
</extension>
</plugin>
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 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.platform.compositor;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.project.compositor.FileProjectCompositor;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
/**
* {@link IElementCompositor} implementation for the {@link PlatformArchitecture}s.
*
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: AE1C377FB889C6796B82D4C748A5B1E8
*/
public final class PlatformArchitectureFileProjectCompositor extends FileProjectCompositor {
/** {@inheritDoc} */
@Override
protected boolean isCorrectElementClass(EObject contained) {
return contained instanceof PlatformArchitecture;
}
}
......@@ -51,20 +51,19 @@
</modelElementClass>
</typesystem>
</extension>
<extension
point="org.fortiss.tooling.kernel.eclipseResourceStorageLocationProvider">
<storageLocationProvider
provider="org.fortiss.af3.project.internal.LocationProvider">
</storageLocationProvider>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementCompositor">
<modelElementCompositor
compositor="org.fortiss.af3.project.compositor.FileProjectCompositor"
modelElementClass="org.fortiss.af3.project.model.FileProject">
compositor="org.fortiss.af3.project.compositor.FileProjectCompositor">
<modelElementClass
modelElementClass="org.fortiss.af3.project.model.FileProject">
</modelElementClass>
</modelElementCompositor>
</extension>
<extension
point="org.fortiss.tooling.kernel.eclipseResourceStorageLocationProvider">
<storageLocationProvider
provider="org.fortiss.af3.project.internal.LocationProvider">
</storageLocationProvider>
</extension>
</plugin>
......@@ -17,57 +17,63 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.af3.project.compositor;
import static org.eclipse.emf.ecore.util.EcoreUtil.delete;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.model.ProjectConfiguration;
import org.fortiss.af3.project.model.execution.ExecutionConfigurationStore;
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.IProjectRootElement;
/**
* {@link IElementCompositor} implementation for the {@link IProjectRootElement}
* s.
* {@link IElementCompositor} implementation for the {@link IProjectRootElement} s.
*
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 4F7624979F303C273DB41606B073AD0D
* @ConQAT.Rating YELLOW Hash: 196414CD89EE452BFE76463ECD88D7FF
*/
public final class FileProjectCompositor implements
IElementCompositor<FileProject> {
public class FileProjectCompositor implements IElementCompositor<FileProject> {
/** {@inheritDoc} */
@Override
public boolean canCompose(FileProject container, EObject contained,
IElementCompositionContext context) {
return contained instanceof IProjectRootElement;
return isCorrectElementClass(contained);
}
/** Checks composed element class. */
protected boolean isCorrectElementClass(EObject contained) {
return contained instanceof ExecutionConfigurationStore ||
contained instanceof ProjectConfiguration;
}
/** {@inheritDoc} */
@Override
public boolean compose(FileProject container, EObject contained,
IElementCompositionContext context) {
return container.getRootElementsList().add(
(IProjectRootElement) contained);
return container.getRootElementsList().add((IProjectRootElement)contained);
}
/** {@inheritDoc} */
@Override
public boolean canComposePrototype(Prototype prototype) {
return prototype.getPrototype() instanceof IProjectRootElement;
return isCorrectElementClass(prototype.getPrototype());
}
/** {@inheritDoc} */
@Override
public boolean canDecompose(EObject contained) {
return contained instanceof IProjectRootElement;
return isCorrectElementClass(contained);
}
/** {@inheritDoc} */
@Override
public boolean decompose(EObject contained) {
EcoreUtil.delete(contained, true);
delete(contained, true);
return true;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment