blob: 6a1513d24315ef15fcc2a70133cd76da17c5321e [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2019 Xored Software Inc 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
* https://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.rcptt.ecl.data.commands.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.rcptt.ecl.core.impl.CommandImpl;
import org.eclipse.rcptt.ecl.data.commands.CommandsPackage;
import org.eclipse.rcptt.ecl.data.commands.WriteXmlFile;
import org.eclipse.rcptt.ecl.data.objects.Tree;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Write Xml File</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.ecl.data.commands.impl.WriteXmlFileImpl#getTree <em>Tree</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.data.commands.impl.WriteXmlFileImpl#getUri <em>Uri</em>}</li>
* </ul>
*
* @generated
*/
public class WriteXmlFileImpl extends CommandImpl implements WriteXmlFile {
/**
* The cached value of the '{@link #getTree() <em>Tree</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTree()
* @generated
* @ordered
*/
protected Tree tree;
/**
* The default value of the '{@link #getUri() <em>Uri</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUri()
* @generated
* @ordered
*/
protected static final String URI_EDEFAULT = null;
/**
* The cached value of the '{@link #getUri() <em>Uri</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUri()
* @generated
* @ordered
*/
protected String uri = URI_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected WriteXmlFileImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CommandsPackage.Literals.WRITE_XML_FILE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Tree getTree() {
if (tree != null && tree.eIsProxy()) {
InternalEObject oldTree = (InternalEObject)tree;
tree = (Tree)eResolveProxy(oldTree);
if (tree != oldTree) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommandsPackage.WRITE_XML_FILE__TREE, oldTree, tree));
}
}
return tree;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Tree basicGetTree() {
return tree;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTree(Tree newTree) {
Tree oldTree = tree;
tree = newTree;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.WRITE_XML_FILE__TREE, oldTree, tree));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getUri() {
return uri;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setUri(String newUri) {
String oldUri = uri;
uri = newUri;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.WRITE_XML_FILE__URI, oldUri, uri));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CommandsPackage.WRITE_XML_FILE__TREE:
if (resolve) return getTree();
return basicGetTree();
case CommandsPackage.WRITE_XML_FILE__URI:
return getUri();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CommandsPackage.WRITE_XML_FILE__TREE:
setTree((Tree)newValue);
return;
case CommandsPackage.WRITE_XML_FILE__URI:
setUri((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CommandsPackage.WRITE_XML_FILE__TREE:
setTree((Tree)null);
return;
case CommandsPackage.WRITE_XML_FILE__URI:
setUri(URI_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CommandsPackage.WRITE_XML_FILE__TREE:
return tree != null;
case CommandsPackage.WRITE_XML_FILE__URI:
return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri);
}
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(" (uri: ");
result.append(uri);
result.append(')');
return result.toString();
}
} //WriteXmlFileImpl