| /* |
| * Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) 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: |
| * Eike Stepper - initial API and implementation |
| */ |
| package org.eclipse.emf.cdo.releng.doc.article.impl; |
| |
| import org.eclipse.emf.cdo.releng.doc.article.ArticlePackage; |
| import org.eclipse.emf.cdo.releng.doc.article.Context; |
| import org.eclipse.emf.cdo.releng.doc.article.ExternalTarget; |
| import org.eclipse.emf.cdo.releng.doc.article.StructuralElement; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import com.sun.javadoc.ClassDoc; |
| |
| import java.io.PrintWriter; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object '<em><b>External Target</b></em>'. <!-- end-user-doc |
| * --> |
| * <p> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ExternalTargetImpl extends LinkTargetImpl implements ExternalTarget |
| { |
| /** |
| * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getUrl() |
| * @generated |
| * @ordered |
| */ |
| protected static final String URL_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getUrl() |
| * @generated |
| * @ordered |
| */ |
| protected String url = URL_EDEFAULT; |
| |
| private ClassDoc classDoc; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected ExternalTargetImpl() |
| { |
| super(); |
| } |
| |
| ExternalTargetImpl(Context context, ClassDoc classDoc, String url) |
| { |
| this.classDoc = classDoc; |
| this.url = url; |
| context.register(getId(), this); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return ArticlePackage.Literals.EXTERNAL_TARGET; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public String getUrl() |
| { |
| return url; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case ArticlePackage.EXTERNAL_TARGET__URL: |
| return getUrl(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case ArticlePackage.EXTERNAL_TARGET__URL: |
| return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT.equals(url); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String toString() |
| { |
| if (eIsProxy()) |
| { |
| return super.toString(); |
| } |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (url: "); |
| result.append(url); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| @Override |
| public String linkFrom(StructuralElement source) |
| { |
| return url; |
| } |
| |
| @Override |
| public Object getId() |
| { |
| return classDoc; |
| } |
| |
| @Override |
| public String getTooltip() |
| { |
| return JavaElementImpl.getTooltip(classDoc); |
| } |
| |
| @Override |
| protected void writeLink(PrintWriter out, String label, String href, String tooltip) |
| { |
| super.writeLink(out, "<code>" + label + "</code>", href, tooltip); |
| } |
| |
| } // ExternalTargetImpl |