| /******************************************************************************* |
| * Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Pierre Allard, |
| * Regent L'Archeveque, |
| <<<<<<< HEAD |
| * Sebastien Gemme |
| * |
| ======= |
| * Sebastien Gemme - initial API and implementation |
| * |
| >>>>>>> refs/heads/eclipse_pa |
| * SPDX-License-Identifier: EPL-1.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.apogy.common.topology.ui.adapters; |
| |
| import org.eclipse.apogy.common.topology.GroupNode; |
| import org.eclipse.apogy.common.topology.Node; |
| import org.eclipse.apogy.common.topology.ui.ApogyCommonTopologyUIFactory; |
| import org.eclipse.apogy.common.topology.ui.NodePresentation; |
| import org.eclipse.apogy.common.topology.ui.NodePresentationAdapter; |
| |
| public class GroupNodePresentationAdapter implements NodePresentationAdapter { |
| |
| public GroupNodePresentationAdapter() { |
| } |
| |
| @Override |
| public Class<?> getAdaptedClass() { |
| return GroupNode.class; |
| } |
| |
| @Override |
| public NodePresentation getAdapter(Node obj, Object context) { |
| NodePresentation nodePresentation = null; |
| if (isAdapterFor(obj)) { |
| nodePresentation = ApogyCommonTopologyUIFactory.eINSTANCE.createNodePresentation(); |
| nodePresentation.setNode(obj); |
| } |
| return nodePresentation; |
| } |
| |
| @Override |
| public boolean isAdapterFor(Node obj) { |
| return obj instanceof GroupNode; |
| } |
| |
| } |