/******************************************************************************* | |
* 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.sam.arg.arg.diagram.navigator; | |
import org.eclipse.core.runtime.IAdapterFactory; | |
import org.eclipse.core.runtime.Platform; | |
import org.eclipse.emf.ecore.EObject; | |
import org.eclipse.emf.ecore.util.EcoreUtil; | |
import org.eclipse.gmf.runtime.notation.View; | |
/** | |
* @generated | |
*/ | |
public class ArgNavigatorItem extends ArgAbstractNavigatorItem { | |
/** | |
* @generated | |
*/ | |
static { | |
final Class[] supportedTypes = new Class[] { View.class, EObject.class }; | |
Platform.getAdapterManager().registerAdapters(new IAdapterFactory() { | |
public Object getAdapter(Object adaptableObject, Class adapterType) { | |
if (adaptableObject instanceof org.eclipse.opencert.sam.arg.arg.diagram.navigator.ArgNavigatorItem | |
&& (adapterType == View.class || adapterType == EObject.class)) { | |
return ((org.eclipse.opencert.sam.arg.arg.diagram.navigator.ArgNavigatorItem) adaptableObject) | |
.getView(); | |
} | |
return null; | |
} | |
public Class[] getAdapterList() { | |
return supportedTypes; | |
} | |
}, org.eclipse.opencert.sam.arg.arg.diagram.navigator.ArgNavigatorItem.class); | |
} | |
/** | |
* @generated | |
*/ | |
private View myView; | |
/** | |
* @generated | |
*/ | |
private boolean myLeaf = false; | |
/** | |
* @generated | |
*/ | |
public ArgNavigatorItem(View view, Object parent, boolean isLeaf) { | |
super(parent); | |
myView = view; | |
myLeaf = isLeaf; | |
} | |
/** | |
* @generated | |
*/ | |
public View getView() { | |
return myView; | |
} | |
/** | |
* @generated | |
*/ | |
public boolean isLeaf() { | |
return myLeaf; | |
} | |
/** | |
* @generated | |
*/ | |
public boolean equals(Object obj) { | |
if (obj instanceof org.eclipse.opencert.sam.arg.arg.diagram.navigator.ArgNavigatorItem) { | |
return EcoreUtil | |
.getURI(getView()) | |
.equals(EcoreUtil | |
.getURI(((org.eclipse.opencert.sam.arg.arg.diagram.navigator.ArgNavigatorItem) obj) | |
.getView())); | |
} | |
return super.equals(obj); | |
} | |
/** | |
* @generated | |
*/ | |
public int hashCode() { | |
return EcoreUtil.getURI(getView()).hashCode(); | |
} | |
} |