1 /**
2  * Copyright (c) 2008, 2015 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *      IBM Corporation - initial API and implementation
13  */
14 package org.eclipse.e4.ui.model.application.ui.impl;
15 
16 import org.eclipse.e4.ui.model.application.ui.MGenericTile;
17 import org.eclipse.e4.ui.model.application.ui.MUIElement;
18 import org.eclipse.emf.common.notify.Notification;
19 import org.eclipse.emf.ecore.EClass;
20 import org.eclipse.emf.ecore.impl.ENotificationImpl;
21 
22 /**
23  * <!-- begin-user-doc -->
24  * An implementation of the model object '<em><b>Generic Tile</b></em>'.
25  * <!-- end-user-doc -->
26  * <p>
27  * The following features are implemented:
28  * </p>
29  * <ul>
30  *   <li>{@link org.eclipse.e4.ui.model.application.ui.impl.GenericTileImpl#isHorizontal <em>Horizontal</em>}</li>
31  * </ul>
32  *
33  * @since 1.0
34  * @generated
35  */
36 public abstract class GenericTileImpl<T extends MUIElement> extends ElementContainerImpl<T> implements MGenericTile<T> {
37 	/**
38 	 * The default value of the '{@link #isHorizontal() <em>Horizontal</em>}' attribute.
39 	 * <!-- begin-user-doc -->
40 	 * <!-- end-user-doc -->
41 	 * @see #isHorizontal()
42 	 * @generated
43 	 * @ordered
44 	 */
45 	protected static final boolean HORIZONTAL_EDEFAULT = false;
46 
47 	/**
48 	 * The cached value of the '{@link #isHorizontal() <em>Horizontal</em>}' attribute.
49 	 * <!-- begin-user-doc -->
50 	 * <!-- end-user-doc -->
51 	 * @see #isHorizontal()
52 	 * @generated
53 	 * @ordered
54 	 */
55 	protected boolean horizontal = HORIZONTAL_EDEFAULT;
56 
57 	/**
58 	 * <!-- begin-user-doc -->
59 	 * <!-- end-user-doc -->
60 	 * @generated
61 	 */
GenericTileImpl()62 	protected GenericTileImpl() {
63 		super();
64 	}
65 
66 	/**
67 	 * <!-- begin-user-doc -->
68 	 * <!-- end-user-doc -->
69 	 * @generated
70 	 */
71 	@Override
eStaticClass()72 	protected EClass eStaticClass() {
73 		return UiPackageImpl.Literals.GENERIC_TILE;
74 	}
75 
76 	/**
77 	 * <!-- begin-user-doc -->
78 	 * <!-- end-user-doc -->
79 	 * @generated
80 	 */
81 	@Override
isHorizontal()82 	public boolean isHorizontal() {
83 		return horizontal;
84 	}
85 
86 	/**
87 	 * <!-- begin-user-doc -->
88 	 * <!-- end-user-doc -->
89 	 * @generated
90 	 */
91 	@Override
setHorizontal(boolean newHorizontal)92 	public void setHorizontal(boolean newHorizontal) {
93 		boolean oldHorizontal = horizontal;
94 		horizontal = newHorizontal;
95 		if (eNotificationRequired())
96 			eNotify(new ENotificationImpl(this, Notification.SET, UiPackageImpl.GENERIC_TILE__HORIZONTAL, oldHorizontal,
97 					horizontal));
98 	}
99 
100 	/**
101 	 * <!-- begin-user-doc -->
102 	 * <!-- end-user-doc -->
103 	 * @generated
104 	 */
105 	@Override
eGet(int featureID, boolean resolve, boolean coreType)106 	public Object eGet(int featureID, boolean resolve, boolean coreType) {
107 		switch (featureID) {
108 		case UiPackageImpl.GENERIC_TILE__HORIZONTAL:
109 			return isHorizontal();
110 		default:
111 			return super.eGet(featureID, resolve, coreType);
112 		}
113 	}
114 
115 	/**
116 	 * <!-- begin-user-doc -->
117 	 * <!-- end-user-doc -->
118 	 * @generated
119 	 */
120 	@Override
eSet(int featureID, Object newValue)121 	public void eSet(int featureID, Object newValue) {
122 		switch (featureID) {
123 		case UiPackageImpl.GENERIC_TILE__HORIZONTAL:
124 			setHorizontal((Boolean) newValue);
125 			return;
126 		default:
127 			super.eSet(featureID, newValue);
128 			return;
129 		}
130 	}
131 
132 	/**
133 	 * <!-- begin-user-doc -->
134 	 * <!-- end-user-doc -->
135 	 * @generated
136 	 */
137 	@Override
eUnset(int featureID)138 	public void eUnset(int featureID) {
139 		switch (featureID) {
140 		case UiPackageImpl.GENERIC_TILE__HORIZONTAL:
141 			setHorizontal(HORIZONTAL_EDEFAULT);
142 			return;
143 		default:
144 			super.eUnset(featureID);
145 			return;
146 		}
147 	}
148 
149 	/**
150 	 * <!-- begin-user-doc -->
151 	 * <!-- end-user-doc -->
152 	 * @generated
153 	 */
154 	@Override
eIsSet(int featureID)155 	public boolean eIsSet(int featureID) {
156 		switch (featureID) {
157 		case UiPackageImpl.GENERIC_TILE__HORIZONTAL:
158 			return horizontal != HORIZONTAL_EDEFAULT;
159 		default:
160 			return super.eIsSet(featureID);
161 		}
162 	}
163 
164 	/**
165 	 * <!-- begin-user-doc -->
166 	 * <!-- end-user-doc -->
167 	 * @generated
168 	 */
169 	@Override
toString()170 	public String toString() {
171 		if (eIsProxy())
172 			return super.toString();
173 
174 		StringBuilder result = new StringBuilder(super.toString());
175 		result.append(" (horizontal: "); //$NON-NLS-1$
176 		result.append(horizontal);
177 		result.append(')');
178 		return result.toString();
179 	}
180 
181 } //GenericTileImpl
182