/******************************************************************************* * Copyright (c) 2006-2012 * Software Technology Group, Dresden University of Technology * DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026 * * 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: * Software Technology Group - TU Dresden, Germany; * DevBoost GmbH - Berlin, Germany * - initial API and implementation ******************************************************************************/ package org.reuseware.coconut.compositionprogram.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 CompositionprogramNavigatorItem extends CompositionprogramAbstractNavigatorItem { /** * @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.reuseware.coconut.compositionprogram.diagram.navigator.CompositionprogramNavigatorItem && (adapterType == View.class || adapterType == EObject.class)) { return ((org.reuseware.coconut.compositionprogram.diagram.navigator.CompositionprogramNavigatorItem) adaptableObject) .getView(); } return null; } public Class[] getAdapterList() { return supportedTypes; } }, org.reuseware.coconut.compositionprogram.diagram.navigator.CompositionprogramNavigatorItem.class); } /** * @generated */ private View myView; /** * @generated */ private boolean myLeaf = false; /** * @generated */ public CompositionprogramNavigatorItem(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.reuseware.coconut.compositionprogram.diagram.navigator.CompositionprogramNavigatorItem) { return EcoreUtil .getURI(getView()) .equals(EcoreUtil .getURI(((org.reuseware.coconut.compositionprogram.diagram.navigator.CompositionprogramNavigatorItem) obj) .getView())); } return super.equals(obj); } /** * @generated */ public int hashCode() { return EcoreUtil.getURI(getView()).hashCode(); } }