| /******************************************************************************* |
| * 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.rcptt.tesla.core.ui.DateTime; |
| 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>Date Time</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.DateTimeImpl#getTooltip <em>Tooltip</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.DateTimeImpl#getDate <em>Date</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.DateTimeImpl#isReadOnly <em>Read Only</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.DateTimeImpl#getTime <em>Time</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DateTimeImpl extends ControlImpl implements DateTime { |
| /** |
| * 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; |
| |
| /** |
| * The default value of the '{@link #getDate() <em>Date</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDate() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DATE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getDate() <em>Date</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDate() |
| * @generated |
| * @ordered |
| */ |
| protected String date = DATE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isReadOnly() <em>Read Only</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isReadOnly() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean READ_ONLY_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isReadOnly() <em>Read Only</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isReadOnly() |
| * @generated |
| * @ordered |
| */ |
| protected boolean readOnly = READ_ONLY_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getTime() <em>Time</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTime() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TIME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getTime() <em>Time</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTime() |
| * @generated |
| * @ordered |
| */ |
| protected String time = TIME_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DateTimeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UiPackage.Literals.DATE_TIME; |
| } |
| |
| /** |
| * <!-- 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, UiPackage.DATE_TIME__TOOLTIP, oldTooltip, tooltip)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getDate() { |
| return date; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDate(String newDate) { |
| String oldDate = date; |
| date = newDate; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.DATE_TIME__DATE, oldDate, date)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isReadOnly() { |
| return readOnly; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setReadOnly(boolean newReadOnly) { |
| boolean oldReadOnly = readOnly; |
| readOnly = newReadOnly; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.DATE_TIME__READ_ONLY, oldReadOnly, readOnly)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getTime() { |
| return time; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTime(String newTime) { |
| String oldTime = time; |
| time = newTime; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.DATE_TIME__TIME, oldTime, time)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case UiPackage.DATE_TIME__TOOLTIP: |
| return getTooltip(); |
| case UiPackage.DATE_TIME__DATE: |
| return getDate(); |
| case UiPackage.DATE_TIME__READ_ONLY: |
| return isReadOnly(); |
| case UiPackage.DATE_TIME__TIME: |
| return getTime(); |
| } |
| 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.DATE_TIME__TOOLTIP: |
| setTooltip((String)newValue); |
| return; |
| case UiPackage.DATE_TIME__DATE: |
| setDate((String)newValue); |
| return; |
| case UiPackage.DATE_TIME__READ_ONLY: |
| setReadOnly((Boolean)newValue); |
| return; |
| case UiPackage.DATE_TIME__TIME: |
| setTime((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case UiPackage.DATE_TIME__TOOLTIP: |
| setTooltip(TOOLTIP_EDEFAULT); |
| return; |
| case UiPackage.DATE_TIME__DATE: |
| setDate(DATE_EDEFAULT); |
| return; |
| case UiPackage.DATE_TIME__READ_ONLY: |
| setReadOnly(READ_ONLY_EDEFAULT); |
| return; |
| case UiPackage.DATE_TIME__TIME: |
| setTime(TIME_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case UiPackage.DATE_TIME__TOOLTIP: |
| return TOOLTIP_EDEFAULT == null ? tooltip != null : !TOOLTIP_EDEFAULT.equals(tooltip); |
| case UiPackage.DATE_TIME__DATE: |
| return DATE_EDEFAULT == null ? date != null : !DATE_EDEFAULT.equals(date); |
| case UiPackage.DATE_TIME__READ_ONLY: |
| return readOnly != READ_ONLY_EDEFAULT; |
| case UiPackage.DATE_TIME__TIME: |
| return TIME_EDEFAULT == null ? time != null : !TIME_EDEFAULT.equals(time); |
| } |
| 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(" (tooltip: "); |
| result.append(tooltip); |
| result.append(", date: "); |
| result.append(date); |
| result.append(", readOnly: "); |
| result.append(readOnly); |
| result.append(", time: "); |
| result.append(time); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DateTimeImpl |