Skip to content
Snippets Groups Projects
Commit 144ff478 authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

GREEN

refs 2255
parent 310a1a8a
No related branches found
No related tags found
No related merge requests found
Showing
with 32 additions and 22 deletions
......@@ -24,11 +24,12 @@ import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
/**
* Base implementation for supporting composition of {@link IElementCompositor}.
*
* @author moudy
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 9795B85BC74E3167DC8697262B931F45
* @ConQAT.Rating GREEN Hash: 2E67535CC62707219CB9F266DA06F99B
*/
public abstract class ElementCompositorBase<C extends EObject> implements IElementCompositor<C> {
......
......@@ -27,7 +27,7 @@ import org.eclipse.emf.ecore.EObject;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 8F0E6F639CF6EE33174A1EE5016E3E69
* @ConQAT.Rating GREEN Hash: 3329872E451EF853C552E9AEAC5CB7EC
*/
public class Prototype {
......
......@@ -32,7 +32,7 @@ import org.fortiss.tooling.kernel.service.base.EObjectAware2ServiceBase;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 32A10A407ACEEAE1210429B4A2C6FB91
* @ConQAT.Rating GREEN Hash: E2E2C40D393401D420CA9000D1BD1028
*/
public class ConnectionCompositorService extends
EObjectAware2ServiceBase<IConnectionCompositor<EObject, EObject, EObject>> implements
......
......@@ -36,7 +36,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 92E1A4E58E91DC08258B83B53E3034D2
* @ConQAT.Rating GREEN Hash: D2813F2898EBA0ABD1BF12D7D1554323
*/
public final class ElementCompositorService extends
EObjectAwareServiceBase<IElementCompositor<EObject>> implements IElementCompositorService {
......@@ -68,8 +68,8 @@ public final class ElementCompositorService extends
findWorkingCompositor(container, element, context, false);
if(compositor == null) {
LoggingUtils.error(ToolingKernelActivator.getDefault(), String.format(
"Can not find compositor for container %s and element %s",
container.getClass(), element.getClass()));
"Cannot find compositor for container %s and element %s", container.getClass(),
element.getClass()));
return false;
}
IPersistencyService.INSTANCE.getTopLevelElementFor(container).prepareIDs(element);
......
......@@ -37,7 +37,7 @@ import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 022F25C1D17554DE41E792592028C20D
* @ConQAT.Rating GREEN Hash: 4008B014AD23F8E56B1D90CEE9A5C319
*/
public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider> implements
IMigrationService {
......
......@@ -41,7 +41,7 @@ import org.fortiss.tooling.kernel.ToolingKernelActivator;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: A8091215BF4A3742FAA20AD702A1295B
* @ConQAT.Rating GREEN Hash: 0F500D545960AA85BBE636519B9120C4
*/
public final class EMFResourceUtils {
/**
......
......@@ -42,22 +42,23 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
/**
* Utility methods for dealing with <code>.ecore</code> models. These methods should be used to
* Utility methods for dealing with <code>Ecore</code> models. These methods should be used to
* define EMF operations that make the models easier to use.
*
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 8EAEF7E3DCA3BC1D3F412165108A9DEA
* @ConQAT.Rating GREEN Hash: 283A66F00038F9CA2487E758FC9C057E
*/
public class EcoreUtils {
/** The new event type count defined by the kernel. */
public static final int KERNEL_EMF_EVENT_TYPE_COUNT = EVENT_TYPE_COUNT + 1;
/** Notification to cause model element display refresh. */
// we use a large number above EMF standard notifications to avoid collision
// with other EMF tools.
/**
* Notification to cause model element display refresh. We use a large number above EMF standard
* notifications to avoid collision with other EMF tools.
*/
private static final Notification refreshNotification = new NotificationImpl(
EVENT_TYPE_COUNT + 1, null, null);
......@@ -115,12 +116,15 @@ public class EcoreUtils {
*/
@SuppressWarnings("unchecked")
public static <T> EList<T> pickInstanceOf(Class<T> targetClass, List<?> sourceList) {
if(sourceList == null)
if(sourceList == null) {
return null;
}
EList<T> result = new BasicEList<T>();
for(Object sourceElement : sourceList)
if(targetClass.isAssignableFrom(sourceElement.getClass()))
for(Object sourceElement : sourceList) {
if(targetClass.isAssignableFrom(sourceElement.getClass())) {
result.add((T)sourceElement);
}
}
return ECollections.unmodifiableEList(result);
}
......@@ -140,8 +144,9 @@ public class EcoreUtils {
*/
public static <S> EList<S>
pickInstanceOf(Collection<Class<?>> targetClasses, List<S> sourceList) {
if(sourceList == null)
if(sourceList == null) {
return null;
}
EList<S> result = new BasicEList<S>();
for(S sourceElement : sourceList) {
Class<?> sourceClass = sourceElement.getClass();
......@@ -169,8 +174,9 @@ public class EcoreUtils {
* <code>targetClass</code> instances
*/
public static <S> EList<S> filterOutInstanceOf(Class<?> targetClass, List<S> sourceList) {
if(sourceList == null)
if(sourceList == null) {
return null;
}
EList<S> result = new BasicEList<S>();
for(S sourceElement : sourceList) {
Class<?> sourceClass = sourceElement.getClass();
......@@ -193,11 +199,14 @@ public class EcoreUtils {
*/
@SuppressWarnings("unchecked")
public static <S, T extends S> T pickFirstInstanceOf(Class<T> targetClass, List<S> sourceList) {
if(sourceList == null)
if(sourceList == null) {
return null;
for(S sourceElement : sourceList)
if(targetClass.isAssignableFrom(sourceElement.getClass()))
}
for(S sourceElement : sourceList) {
if(targetClass.isAssignableFrom(sourceElement.getClass())) {
return (T)sourceElement;
}
}
return null;
}
......
......@@ -38,7 +38,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: E4EBC5D7A0611A8B71877E7000BE58DF
* @ConQAT.Rating GREEN Hash: AF4108116CA2222CFBF5FD1A83E6C48E
*/
public final class KernelModelElementUtils {
......
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