Skip to content
Snippets Groups Projects
Commit 2f6c65c8 authored by Daniel Ratiu's avatar Daniel Ratiu
Browse files

different improvements and fixes in the library

refs 694
parent 386f3521
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 8E3FE62B80ACF1DA5FF9DCA2A91B2A3E
* @ConQAT.Rating YELLOW Hash: DFE80532CB79D43BBCC951603AA91A9B
*/
public final class KernelModelElementUtils {
......
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2012 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.tooling.kernel.utils;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.kernel.extension.data.Prototype;
import org.fortiss.tooling.kernel.service.IPrototypeService;
/**
* Utility methods for dealing with prototypes.
*
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 6EE14E172A9708B6E42379AEB3A61219
*/
public class PrototypesUtils {
/** Returns a prototype with a given name that is composable with a given model element type. */
public static Prototype findPrototypeComposableWith(Class<? extends EObject> modelElementType,
String prototypeName) {
List<Prototype> prototypes =
IPrototypeService.INSTANCE.getComposablePrototypes(modelElementType);
for(Prototype prot : prototypes) {
if(prot.getName().equals(prototypeName)) {
return prot;
}
}
return null;
}
}
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