blob: 14f7696656c39a769038988831213a008c27b2bf [file] [log] [blame]
/**
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* 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
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors{
* Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation
*
*/
package org.eclipse.osbp.xtext.table.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.xtext.table.TableDSLPackage;
import org.eclipse.osbp.xtext.table.TableSelection;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Table Selection</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.xtext.table.impl.TableSelectionImpl#isMultiSelection <em>Multi Selection</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TableSelectionImpl extends TableTableImpl implements TableSelection {
/**
* The default value of the '{@link #isMultiSelection() <em>Multi Selection</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isMultiSelection()
* @generated
* @ordered
*/
protected static final boolean MULTI_SELECTION_EDEFAULT = false;
/**
* The cached value of the '{@link #isMultiSelection() <em>Multi Selection</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isMultiSelection()
* @generated
* @ordered
*/
protected boolean multiSelection = MULTI_SELECTION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TableSelectionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return TableDSLPackage.Literals.TABLE_SELECTION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isMultiSelection() {
return multiSelection;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMultiSelection(boolean newMultiSelection) {
boolean oldMultiSelection = multiSelection;
multiSelection = newMultiSelection;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TableDSLPackage.TABLE_SELECTION__MULTI_SELECTION, oldMultiSelection, multiSelection));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TableDSLPackage.TABLE_SELECTION__MULTI_SELECTION:
return isMultiSelection();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TableDSLPackage.TABLE_SELECTION__MULTI_SELECTION:
setMultiSelection((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TableDSLPackage.TABLE_SELECTION__MULTI_SELECTION:
setMultiSelection(MULTI_SELECTION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TableDSLPackage.TABLE_SELECTION__MULTI_SELECTION:
return multiSelection != MULTI_SELECTION_EDEFAULT;
}
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(" (multiSelection: ");
result.append(multiSelection);
result.append(')');
return result.toString();
}
} //TableSelectionImpl