/******************************************************************************* | |
* Copyright (c) 2016 Fundación Tecnalia Research & Innovation. | |
* | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v2.0 | |
* which accompanies this distribution, and is available at | |
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
* | |
* Contributors: | |
* Huascar Espinoza - initial API and implementation | |
* Alejandra Ruíz - initial API and implementation | |
* Idoya Del Río - initial API and implementation | |
* Mari Carmen Palacios - initial API and implementation | |
* Angel López - initial API and implementation | |
*******************************************************************************/ | |
/* | |
* | |
*/ | |
package org.eclipse.opencert.pkm.refframework.refframework.diagram.navigator; | |
import org.eclipse.core.runtime.IAdapterFactory; | |
import org.eclipse.core.runtime.Platform; | |
import org.eclipse.core.runtime.PlatformObject; | |
import org.eclipse.emf.ecore.EObject; | |
import org.eclipse.emf.ecore.util.EcoreUtil; | |
import org.eclipse.ui.views.properties.IPropertySource; | |
import org.eclipse.ui.views.properties.IPropertySourceProvider; | |
/** | |
* @generated | |
*/ | |
public class RefframeworkDomainNavigatorItem extends PlatformObject { | |
/** | |
* @generated | |
*/ | |
static { | |
final Class[] supportedTypes = new Class[] { EObject.class, | |
IPropertySource.class }; | |
Platform.getAdapterManager().registerAdapters( | |
new IAdapterFactory() { | |
public Object getAdapter(Object adaptableObject, | |
Class adapterType) { | |
if (adaptableObject instanceof org.eclipse.opencert.pkm.refframework.refframework.diagram.navigator.RefframeworkDomainNavigatorItem) { | |
org.eclipse.opencert.pkm.refframework.refframework.diagram.navigator.RefframeworkDomainNavigatorItem domainNavigatorItem = (org.eclipse.opencert.pkm.refframework.refframework.diagram.navigator.RefframeworkDomainNavigatorItem) adaptableObject; | |
EObject eObject = domainNavigatorItem.getEObject(); | |
if (adapterType == EObject.class) { | |
return eObject; | |
} | |
if (adapterType == IPropertySource.class) { | |
return domainNavigatorItem | |
.getPropertySourceProvider() | |
.getPropertySource(eObject); | |
} | |
} | |
return null; | |
} | |
public Class[] getAdapterList() { | |
return supportedTypes; | |
} | |
}, | |
org.eclipse.opencert.pkm.refframework.refframework.diagram.navigator.RefframeworkDomainNavigatorItem.class); | |
} | |
/** | |
* @generated | |
*/ | |
private Object myParent; | |
/** | |
* @generated | |
*/ | |
private EObject myEObject; | |
/** | |
* @generated | |
*/ | |
private IPropertySourceProvider myPropertySourceProvider; | |
/** | |
* @generated | |
*/ | |
public RefframeworkDomainNavigatorItem(EObject eObject, Object parent, | |
IPropertySourceProvider propertySourceProvider) { | |
myParent = parent; | |
myEObject = eObject; | |
myPropertySourceProvider = propertySourceProvider; | |
} | |
/** | |
* @generated | |
*/ | |
public Object getParent() { | |
return myParent; | |
} | |
/** | |
* @generated | |
*/ | |
public EObject getEObject() { | |
return myEObject; | |
} | |
/** | |
* @generated | |
*/ | |
public IPropertySourceProvider getPropertySourceProvider() { | |
return myPropertySourceProvider; | |
} | |
/** | |
* @generated | |
*/ | |
public boolean equals(Object obj) { | |
if (obj instanceof org.eclipse.opencert.pkm.refframework.refframework.diagram.navigator.RefframeworkDomainNavigatorItem) { | |
return EcoreUtil | |
.getURI(getEObject()) | |
.equals(EcoreUtil | |
.getURI(((org.eclipse.opencert.pkm.refframework.refframework.diagram.navigator.RefframeworkDomainNavigatorItem) obj) | |
.getEObject())); | |
} | |
return super.equals(obj); | |
} | |
/** | |
* @generated | |
*/ | |
public int hashCode() { | |
return EcoreUtil.getURI(getEObject()).hashCode(); | |
} | |
} |