| /******************************************************************************* |
| * 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.tesla.core.ui.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| |
| import org.eclipse.rcptt.tesla.core.ui.Marker; |
| import org.eclipse.rcptt.tesla.core.ui.UiPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Marker</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.MarkerImpl#getLine <em>Line</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.MarkerImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.MarkerImpl#getText <em>Text</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.MarkerImpl#getColumn <em>Column</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class MarkerImpl extends WidgetImpl implements Marker { |
| /** |
| * The default value of the '{@link #getLine() <em>Line</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLine() |
| * @generated |
| * @ordered |
| */ |
| protected static final int LINE_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getLine() <em>Line</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLine() |
| * @generated |
| * @ordered |
| */ |
| protected int line = LINE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TYPE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected String type = TYPE_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; |
| |
| /** |
| * The default value of the '{@link #getColumn() <em>Column</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColumn() |
| * @generated |
| * @ordered |
| */ |
| protected static final String COLUMN_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getColumn() <em>Column</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColumn() |
| * @generated |
| * @ordered |
| */ |
| protected String column = COLUMN_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected MarkerImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UiPackage.Literals.MARKER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getType() { |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setType(String newType) { |
| String oldType = type; |
| type = newType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.MARKER__TYPE, oldType, type)); |
| } |
| |
| /** |
| * <!-- 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, UiPackage.MARKER__TEXT, oldText, text)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getColumn() { |
| return column; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setColumn(String newColumn) { |
| String oldColumn = column; |
| column = newColumn; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.MARKER__COLUMN, oldColumn, column)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getLine() { |
| return line; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLine(int newLine) { |
| int oldLine = line; |
| line = newLine; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.MARKER__LINE, oldLine, line)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case UiPackage.MARKER__LINE: |
| return getLine(); |
| case UiPackage.MARKER__TYPE: |
| return getType(); |
| case UiPackage.MARKER__TEXT: |
| return getText(); |
| case UiPackage.MARKER__COLUMN: |
| return getColumn(); |
| } |
| 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.MARKER__LINE: |
| setLine((Integer)newValue); |
| return; |
| case UiPackage.MARKER__TYPE: |
| setType((String)newValue); |
| return; |
| case UiPackage.MARKER__TEXT: |
| setText((String)newValue); |
| return; |
| case UiPackage.MARKER__COLUMN: |
| setColumn((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case UiPackage.MARKER__LINE: |
| setLine(LINE_EDEFAULT); |
| return; |
| case UiPackage.MARKER__TYPE: |
| setType(TYPE_EDEFAULT); |
| return; |
| case UiPackage.MARKER__TEXT: |
| setText(TEXT_EDEFAULT); |
| return; |
| case UiPackage.MARKER__COLUMN: |
| setColumn(COLUMN_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case UiPackage.MARKER__LINE: |
| return line != LINE_EDEFAULT; |
| case UiPackage.MARKER__TYPE: |
| return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); |
| case UiPackage.MARKER__TEXT: |
| return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text); |
| case UiPackage.MARKER__COLUMN: |
| return COLUMN_EDEFAULT == null ? column != null : !COLUMN_EDEFAULT.equals(column); |
| } |
| 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(" (line: "); |
| result.append(line); |
| result.append(", Type: "); |
| result.append(type); |
| result.append(", text: "); |
| result.append(text); |
| result.append(", column: "); |
| result.append(column); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //MarkerImpl |