/******************************************************************************* * Copyright (c) 2008 Hallvard Traetteberg. * 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: * Hallvard Traetteberg - initial API and implementation ******************************************************************************/ /** * <copyright> * </copyright> * * $Id: BrowserImpl.java,v 1.3 2009/10/23 12:40:32 htraetteb Exp $ */ package org.eclipse.e4.tm.widgets.impl; import org.eclipse.e4.tm.widgets.Browser; import org.eclipse.e4.tm.widgets.WidgetsPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Browser</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.e4.tm.widgets.impl.BrowserImpl#getLocation <em>Location</em>}</li> * <li>{@link org.eclipse.e4.tm.widgets.impl.BrowserImpl#getUrl <em>Url</em>}</li> * <li>{@link org.eclipse.e4.tm.widgets.impl.BrowserImpl#getText <em>Text</em>}</li> * </ul> * </p> * * @generated */ public class BrowserImpl extends ControlImpl implements Browser { /** * The default value of the '{@link #getLocation() <em>Location</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLocation() * @generated * @ordered */ protected static final Object LOCATION_EDEFAULT = null; /** * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLocation() * @generated * @ordered */ protected Object location = LOCATION_EDEFAULT; /** * 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; /** * The default value of the '{@link #getText() <em>Text</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getText() * @generated * @ordered */ protected static final String TEXT_EDEFAULT = null; /** * The cached value of the '{@link #getText() <em>Text</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getText() * @generated * @ordered */ protected String text = TEXT_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected BrowserImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return WidgetsPackage.Literals.BROWSER; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Object getLocation() { return location; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLocation(Object newLocation) { Object oldLocation = location; location = newLocation; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, WidgetsPackage.BROWSER__LOCATION, oldLocation, location)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getUrl() { return url; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setUrl(String newUrl) { String oldUrl = url; url = newUrl; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, WidgetsPackage.BROWSER__URL, oldUrl, url)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getText() { return text; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setText(String newText) { String oldText = text; text = newText; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, WidgetsPackage.BROWSER__TEXT, oldText, text)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case WidgetsPackage.BROWSER__LOCATION: return getLocation(); case WidgetsPackage.BROWSER__URL: return getUrl(); case WidgetsPackage.BROWSER__TEXT: return getText(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case WidgetsPackage.BROWSER__LOCATION: setLocation(newValue); return; case WidgetsPackage.BROWSER__URL: setUrl((String)newValue); return; case WidgetsPackage.BROWSER__TEXT: setText((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case WidgetsPackage.BROWSER__LOCATION: setLocation(LOCATION_EDEFAULT); return; case WidgetsPackage.BROWSER__URL: setUrl(URL_EDEFAULT); return; case WidgetsPackage.BROWSER__TEXT: setText(TEXT_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case WidgetsPackage.BROWSER__LOCATION: return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); case WidgetsPackage.BROWSER__URL: return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT.equals(url); case WidgetsPackage.BROWSER__TEXT: return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text); } 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(" (location: "); result.append(location); result.append(", url: "); result.append(url); result.append(", text: "); result.append(text); result.append(')'); return result.toString(); } } //BrowserImpl