/** | |
* <copyright> | |
* | |
* Copyright (c) 2013 itemis and others. | |
* 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: | |
* itemis - Initial API and implementation | |
* | |
* </copyright> | |
*/ | |
package org.eclipse.sphinx.examples.hummingbird20.diagram.gmf.part; | |
import org.eclipse.core.runtime.IAdaptable; | |
import org.eclipse.emf.ecore.EObject; | |
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; | |
import org.eclipse.gmf.runtime.emf.type.core.IElementType; | |
/** | |
* @generated | |
*/ | |
public class Hummingbird20LinkDescriptor extends Hummingbird20NodeDescriptor { | |
/** | |
* @generated | |
*/ | |
private EObject mySource; | |
/** | |
* @generated | |
*/ | |
private EObject myDestination; | |
/** | |
* @generated | |
*/ | |
private IAdaptable mySemanticAdapter; | |
/** | |
* @generated | |
*/ | |
private Hummingbird20LinkDescriptor(EObject source, EObject destination, EObject linkElement, int linkVID) { | |
super(linkElement, linkVID); | |
mySource = source; | |
myDestination = destination; | |
} | |
/** | |
* @generated | |
*/ | |
public Hummingbird20LinkDescriptor(EObject source, EObject destination, IElementType elementType, int linkVID) { | |
this(source, destination, (EObject) null, linkVID); | |
final IElementType elementTypeCopy = elementType; | |
mySemanticAdapter = new IAdaptable() { | |
@Override | |
public Object getAdapter(Class adapter) { | |
if (IElementType.class.equals(adapter)) { | |
return elementTypeCopy; | |
} | |
return null; | |
} | |
}; | |
} | |
/** | |
* @generated | |
*/ | |
public Hummingbird20LinkDescriptor(EObject source, EObject destination, EObject linkElement, IElementType elementType, int linkVID) { | |
this(source, destination, linkElement, linkVID); | |
final IElementType elementTypeCopy = elementType; | |
mySemanticAdapter = new EObjectAdapter(linkElement) { | |
@Override | |
public Object getAdapter(Class adapter) { | |
if (IElementType.class.equals(adapter)) { | |
return elementTypeCopy; | |
} | |
return super.getAdapter(adapter); | |
} | |
}; | |
} | |
/** | |
* @generated | |
*/ | |
public EObject getSource() { | |
return mySource; | |
} | |
/** | |
* @generated | |
*/ | |
public EObject getDestination() { | |
return myDestination; | |
} | |
/** | |
* @generated | |
*/ | |
public IAdaptable getSemanticAdapter() { | |
return mySemanticAdapter; | |
} | |
} |