blob: 2889989f6526a11dd1a0f76aca88d012cc43ac9e [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 v2.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.tesla.core.ui.impl;
import org.eclipse.rcptt.tesla.core.ui.ExpandableComposite;
import org.eclipse.rcptt.tesla.core.ui.UiPackage;
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>Expandable Composite</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.ExpandableCompositeImpl#getCaption <em>Caption</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.ExpandableCompositeImpl#isExpanded <em>Expanded</em>}</li>
* </ul>
*
* @generated
*/
public class ExpandableCompositeImpl extends CompositeImpl implements ExpandableComposite {
/**
* The default value of the '{@link #getCaption() <em>Caption</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCaption()
* @generated
* @ordered
*/
protected static final String CAPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getCaption() <em>Caption</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCaption()
* @generated
* @ordered
*/
protected String caption = CAPTION_EDEFAULT;
/**
* The default value of the '{@link #isExpanded() <em>Expanded</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isExpanded()
* @generated
* @ordered
*/
protected static final boolean EXPANDED_EDEFAULT = false;
/**
* The cached value of the '{@link #isExpanded() <em>Expanded</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isExpanded()
* @generated
* @ordered
*/
protected boolean expanded = EXPANDED_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ExpandableCompositeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UiPackage.Literals.EXPANDABLE_COMPOSITE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getCaption() {
return caption;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCaption(String newCaption) {
String oldCaption = caption;
caption = newCaption;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.EXPANDABLE_COMPOSITE__CAPTION, oldCaption, caption));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isExpanded() {
return expanded;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExpanded(boolean newExpanded) {
boolean oldExpanded = expanded;
expanded = newExpanded;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.EXPANDABLE_COMPOSITE__EXPANDED, oldExpanded, expanded));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case UiPackage.EXPANDABLE_COMPOSITE__CAPTION:
return getCaption();
case UiPackage.EXPANDABLE_COMPOSITE__EXPANDED:
return isExpanded();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UiPackage.EXPANDABLE_COMPOSITE__CAPTION:
setCaption((String)newValue);
return;
case UiPackage.EXPANDABLE_COMPOSITE__EXPANDED:
setExpanded((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case UiPackage.EXPANDABLE_COMPOSITE__CAPTION:
setCaption(CAPTION_EDEFAULT);
return;
case UiPackage.EXPANDABLE_COMPOSITE__EXPANDED:
setExpanded(EXPANDED_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case UiPackage.EXPANDABLE_COMPOSITE__CAPTION:
return CAPTION_EDEFAULT == null ? caption != null : !CAPTION_EDEFAULT.equals(caption);
case UiPackage.EXPANDABLE_COMPOSITE__EXPANDED:
return expanded != EXPANDED_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(" (caption: ");
result.append(caption);
result.append(", expanded: ");
result.append(expanded);
result.append(')');
return result.toString();
}
} //ExpandableCompositeImpl