From bdb0e924d4f745cc932539e8ac261044186677e8 Mon Sep 17 00:00:00 2001
From: Florian Hoelzl <hoelzl@fortiss.org>
Date: Mon, 24 Apr 2017 13:30:31 +0000
Subject: [PATCH] Added getConnectors() to model element handlers of raspberry
 pi platform. refs 2507

---
 .../raspberry/ui/handler/CanBusHandler.java         | 13 +++++++++++--
 .../raspberry/ui/handler/CanConnectorHandler.java   |  4 ++--
 .../raspberry/ui/handler/RaspberryPiHandler.java    | 13 +++++++++++--
 3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/CanBusHandler.java b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/CanBusHandler.java
index a2f04af3..80896163 100644
--- a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/CanBusHandler.java
+++ b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/CanBusHandler.java
@@ -17,21 +17,25 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
 +--------------------------------------------------------------------------*/
 package org.fortiss.af3.platform.raspberry.ui.handler;
 
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.fortiss.af3.platform.raspberry.model.CanBus;
 import org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator;
+import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
 import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
 
 /**
- * {@link ModelElementHandlerBase} for {@link CanBus}.
+ * {@link IModelElementHandler} for {@link CanBus}.
  * 
  * @author eder
  * @author $Author: hoelzl $
  * @version $Rev: 18709 $
  * @ConQAT.Rating RED Hash:
  */
+@SuppressWarnings({"unchecked", "rawtypes"})
 public class CanBusHandler extends ModelElementHandlerBase<CanBus> {
-
 	/** {@inheritDoc} */
 	@Override
 	public String getName(CanBus element) {
@@ -45,4 +49,9 @@ public class CanBusHandler extends ModelElementHandlerBase<CanBus> {
 		return AF3PlatformRaspberryUIActivator.getImageDescriptor("icons/can-logo.jpeg");
 	}
 
+	/** {@inheritDoc} */
+	@Override
+	public List<EObject> getConnectors(CanBus element) {
+		return (List)element.getConnectors();
+	}
 }
diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/CanConnectorHandler.java b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/CanConnectorHandler.java
index 008d6854..d3a100a4 100644
--- a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/CanConnectorHandler.java
+++ b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/CanConnectorHandler.java
@@ -21,9 +21,11 @@ import static org.fortiss.af3.platform.ui.AF3PlatformUIActivator.getImageDescrip
 
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.fortiss.af3.platform.raspberry.model.CanConnector;
+import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
 import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
 
 /**
+ * {@link IModelElementHandler} for {@link CanConnector}.
  * 
  * @author eder
  * @author $Author: hoelzl $
@@ -31,7 +33,6 @@ import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
  * @ConQAT.Rating RED Hash:
  */
 public class CanConnectorHandler extends ModelElementHandlerBase<CanConnector> {
-
 	/** {@inheritDoc} */
 	@Override
 	public ImageDescriptor getIconImageDescriptor() {
@@ -44,5 +45,4 @@ public class CanConnectorHandler extends ModelElementHandlerBase<CanConnector> {
 		String name = element.getName();
 		return name != null ? name : "CanConnector";
 	}
-
 }
diff --git a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/RaspberryPiHandler.java b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/RaspberryPiHandler.java
index 1c6fe05b..f924ed2e 100644
--- a/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/RaspberryPiHandler.java
+++ b/org.fortiss.af3.platform.raspberry.ui/trunk/src/org/fortiss/af3/platform/raspberry/ui/handler/RaspberryPiHandler.java
@@ -17,21 +17,25 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
 +--------------------------------------------------------------------------*/
 package org.fortiss.af3.platform.raspberry.ui.handler;
 
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.fortiss.af3.platform.raspberry.model.RaspberryPi;
 import org.fortiss.af3.platform.raspberry.ui.AF3PlatformRaspberryUIActivator;
+import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
 import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
 
 /**
- * {@link ModelElementHandlerBase} for {@link RaspberryPi}.
+ * {@link IModelElementHandler} for {@link RaspberryPi}.
  * 
  * @author eder
  * @author $Author: hoelzl $
  * @version $Rev: 18709 $
  * @ConQAT.Rating RED Hash:
  */
+@SuppressWarnings({"unchecked", "rawtypes"})
 public class RaspberryPiHandler extends ModelElementHandlerBase<RaspberryPi> {
-
 	/** {@inheritDoc} */
 	@Override
 	public String getName(RaspberryPi element) {
@@ -45,4 +49,9 @@ public class RaspberryPiHandler extends ModelElementHandlerBase<RaspberryPi> {
 		return AF3PlatformRaspberryUIActivator.getImageDescriptor("icons/raspberry-pi-logo.png");
 	}
 
+	/** {@inheritDoc} */
+	@Override
+	public List<EObject> getConnectors(RaspberryPi element) {
+		return (List)element.getConnectors();
+	}
 }
-- 
GitLab