| /******************************************************************************* |
| * 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.verifications.tree.impl; |
| |
| import org.eclipse.rcptt.verifications.tree.Column; |
| import org.eclipse.rcptt.verifications.tree.TreePackage; |
| |
| import org.eclipse.rcptt.tesla.core.ui.Image; |
| 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.emf.ecore.impl.EObjectImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Column</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.verifications.tree.impl.ColumnImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.rcptt.verifications.tree.impl.ColumnImpl#getWidth <em>Width</em>}</li> |
| * <li>{@link org.eclipse.rcptt.verifications.tree.impl.ColumnImpl#getStyle <em>Style</em>}</li> |
| * <li>{@link org.eclipse.rcptt.verifications.tree.impl.ColumnImpl#getImage <em>Image</em>}</li> |
| * <li>{@link org.eclipse.rcptt.verifications.tree.impl.ColumnImpl#getTooltip <em>Tooltip</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ColumnImpl extends EObjectImpl implements Column { |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getWidth() <em>Width</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getWidth() |
| * @generated |
| * @ordered |
| */ |
| protected static final int WIDTH_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getWidth() <em>Width</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getWidth() |
| * @generated |
| * @ordered |
| */ |
| protected int width = WIDTH_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getStyle() <em>Style</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStyle() |
| * @generated |
| * @ordered |
| */ |
| protected static final int STYLE_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getStyle() <em>Style</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStyle() |
| * @generated |
| * @ordered |
| */ |
| protected int style = STYLE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getImage() <em>Image</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getImage() |
| * @generated |
| * @ordered |
| */ |
| protected Image image; |
| |
| /** |
| * The default value of the '{@link #getTooltip() <em>Tooltip</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTooltip() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TOOLTIP_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getTooltip() <em>Tooltip</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTooltip() |
| * @generated |
| * @ordered |
| */ |
| protected String tooltip = TOOLTIP_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ColumnImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TreePackage.Literals.COLUMN; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.COLUMN__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getWidth() { |
| return width; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setWidth(int newWidth) { |
| int oldWidth = width; |
| width = newWidth; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.COLUMN__WIDTH, oldWidth, width)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getStyle() { |
| return style; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStyle(int newStyle) { |
| int oldStyle = style; |
| style = newStyle; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.COLUMN__STYLE, oldStyle, style)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Image getImage() { |
| if (image != null && image.eIsProxy()) { |
| InternalEObject oldImage = (InternalEObject)image; |
| image = (Image)eResolveProxy(oldImage); |
| if (image != oldImage) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, TreePackage.COLUMN__IMAGE, oldImage, image)); |
| } |
| } |
| return image; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Image basicGetImage() { |
| return image; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setImage(Image newImage) { |
| Image oldImage = image; |
| image = newImage; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.COLUMN__IMAGE, oldImage, image)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getTooltip() { |
| return tooltip; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTooltip(String newTooltip) { |
| String oldTooltip = tooltip; |
| tooltip = newTooltip; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.COLUMN__TOOLTIP, oldTooltip, tooltip)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TreePackage.COLUMN__NAME: |
| return getName(); |
| case TreePackage.COLUMN__WIDTH: |
| return getWidth(); |
| case TreePackage.COLUMN__STYLE: |
| return getStyle(); |
| case TreePackage.COLUMN__IMAGE: |
| if (resolve) return getImage(); |
| return basicGetImage(); |
| case TreePackage.COLUMN__TOOLTIP: |
| return getTooltip(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case TreePackage.COLUMN__NAME: |
| setName((String)newValue); |
| return; |
| case TreePackage.COLUMN__WIDTH: |
| setWidth((Integer)newValue); |
| return; |
| case TreePackage.COLUMN__STYLE: |
| setStyle((Integer)newValue); |
| return; |
| case TreePackage.COLUMN__IMAGE: |
| setImage((Image)newValue); |
| return; |
| case TreePackage.COLUMN__TOOLTIP: |
| setTooltip((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TreePackage.COLUMN__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case TreePackage.COLUMN__WIDTH: |
| setWidth(WIDTH_EDEFAULT); |
| return; |
| case TreePackage.COLUMN__STYLE: |
| setStyle(STYLE_EDEFAULT); |
| return; |
| case TreePackage.COLUMN__IMAGE: |
| setImage((Image)null); |
| return; |
| case TreePackage.COLUMN__TOOLTIP: |
| setTooltip(TOOLTIP_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TreePackage.COLUMN__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case TreePackage.COLUMN__WIDTH: |
| return width != WIDTH_EDEFAULT; |
| case TreePackage.COLUMN__STYLE: |
| return style != STYLE_EDEFAULT; |
| case TreePackage.COLUMN__IMAGE: |
| return image != null; |
| case TreePackage.COLUMN__TOOLTIP: |
| return TOOLTIP_EDEFAULT == null ? tooltip != null : !TOOLTIP_EDEFAULT.equals(tooltip); |
| } |
| 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(" (name: "); |
| result.append(name); |
| result.append(", width: "); |
| result.append(width); |
| result.append(", style: "); |
| result.append(style); |
| result.append(", tooltip: "); |
| result.append(tooltip); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ColumnImpl |