imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/impl/IbyEntryImpl.java
changeset 0 61163b28edca
child 11 217e69fc5beb
equal deleted inserted replaced
-1:000000000000 0:61163b28edca
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 package com.nokia.s60tools.imaker.internal.model.iContent.impl;
       
    18 
       
    19 import com.nokia.s60tools.imaker.internal.model.iContent.IContentPackage;
       
    20 import com.nokia.s60tools.imaker.internal.model.iContent.IMAGESECTION;
       
    21 import com.nokia.s60tools.imaker.internal.model.iContent.IbyEntry;
       
    22 
       
    23 import org.eclipse.emf.common.notify.Notification;
       
    24 
       
    25 import org.eclipse.emf.ecore.EClass;
       
    26 
       
    27 import org.eclipse.emf.ecore.impl.ENotificationImpl;
       
    28 import org.eclipse.emf.ecore.impl.EObjectImpl;
       
    29 
       
    30 /**
       
    31  * <!-- begin-user-doc -->
       
    32  * An implementation of the model object '<em><b>Iby Entry</b></em>'.
       
    33  * <!-- end-user-doc -->
       
    34  * <p>
       
    35  * The following features are implemented:
       
    36  * <ul>
       
    37  *   <li>{@link com.nokia.s60tools.imaker.internal.model.iContent.impl.IbyEntryImpl#getFile <em>File</em>}</li>
       
    38  *   <li>{@link com.nokia.s60tools.imaker.internal.model.iContent.impl.IbyEntryImpl#getTarget <em>Target</em>}</li>
       
    39  *   <li>{@link com.nokia.s60tools.imaker.internal.model.iContent.impl.IbyEntryImpl#getLocation <em>Location</em>}</li>
       
    40  *   <li>{@link com.nokia.s60tools.imaker.internal.model.iContent.impl.IbyEntryImpl#isDebug <em>Debug</em>}</li>
       
    41  *   <li>{@link com.nokia.s60tools.imaker.internal.model.iContent.impl.IbyEntryImpl#isEnabled <em>Enabled</em>}</li>
       
    42  *   <li>{@link com.nokia.s60tools.imaker.internal.model.iContent.impl.IbyEntryImpl#getStatusMessage <em>Status Message</em>}</li>
       
    43  * </ul>
       
    44  * </p>
       
    45  *
       
    46  * @generated
       
    47  */
       
    48 public class IbyEntryImpl extends EObjectImpl implements IbyEntry {
       
    49 	/**
       
    50 	 * The default value of the '{@link #getFile() <em>File</em>}' attribute.
       
    51 	 * <!-- begin-user-doc -->
       
    52 	 * <!-- end-user-doc -->
       
    53 	 * @see #getFile()
       
    54 	 * @generated
       
    55 	 * @ordered
       
    56 	 */
       
    57 	protected static final String FILE_EDEFAULT = null;
       
    58 
       
    59 	/**
       
    60 	 * The cached value of the '{@link #getFile() <em>File</em>}' attribute.
       
    61 	 * <!-- begin-user-doc -->
       
    62 	 * <!-- end-user-doc -->
       
    63 	 * @see #getFile()
       
    64 	 * @generated
       
    65 	 * @ordered
       
    66 	 */
       
    67 	protected String file = FILE_EDEFAULT;
       
    68 
       
    69 	/**
       
    70 	 * The default value of the '{@link #getTarget() <em>Target</em>}' attribute.
       
    71 	 * <!-- begin-user-doc -->
       
    72 	 * <!-- end-user-doc -->
       
    73 	 * @see #getTarget()
       
    74 	 * @generated
       
    75 	 * @ordered
       
    76 	 */
       
    77 	protected static final String TARGET_EDEFAULT = null;
       
    78 
       
    79 	/**
       
    80 	 * The cached value of the '{@link #getTarget() <em>Target</em>}' attribute.
       
    81 	 * <!-- begin-user-doc -->
       
    82 	 * <!-- end-user-doc -->
       
    83 	 * @see #getTarget()
       
    84 	 * @generated
       
    85 	 * @ordered
       
    86 	 */
       
    87 	protected String target = TARGET_EDEFAULT;
       
    88 
       
    89 	/**
       
    90 	 * The default value of the '{@link #getLocation() <em>Location</em>}' attribute.
       
    91 	 * <!-- begin-user-doc -->
       
    92 	 * <!-- end-user-doc -->
       
    93 	 * @see #getLocation()
       
    94 	 * @generated
       
    95 	 * @ordered
       
    96 	 */
       
    97 	protected static final IMAGESECTION LOCATION_EDEFAULT = IMAGESECTION.CORE;
       
    98 
       
    99 	/**
       
   100 	 * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute.
       
   101 	 * <!-- begin-user-doc -->
       
   102 	 * <!-- end-user-doc -->
       
   103 	 * @see #getLocation()
       
   104 	 * @generated
       
   105 	 * @ordered
       
   106 	 */
       
   107 	protected IMAGESECTION location = LOCATION_EDEFAULT;
       
   108 
       
   109 	/**
       
   110 	 * The default value of the '{@link #isDebug() <em>Debug</em>}' attribute.
       
   111 	 * <!-- begin-user-doc -->
       
   112 	 * <!-- end-user-doc -->
       
   113 	 * @see #isDebug()
       
   114 	 * @generated
       
   115 	 * @ordered
       
   116 	 */
       
   117 	protected static final boolean DEBUG_EDEFAULT = false;
       
   118 
       
   119 	/**
       
   120 	 * The cached value of the '{@link #isDebug() <em>Debug</em>}' attribute.
       
   121 	 * <!-- begin-user-doc -->
       
   122 	 * <!-- end-user-doc -->
       
   123 	 * @see #isDebug()
       
   124 	 * @generated
       
   125 	 * @ordered
       
   126 	 */
       
   127 	protected boolean debug = DEBUG_EDEFAULT;
       
   128 
       
   129 	/**
       
   130 	 * The default value of the '{@link #isEnabled() <em>Enabled</em>}' attribute.
       
   131 	 * <!-- begin-user-doc -->
       
   132 	 * <!-- end-user-doc -->
       
   133 	 * @see #isEnabled()
       
   134 	 * @generated
       
   135 	 * @ordered
       
   136 	 */
       
   137 	protected static final boolean ENABLED_EDEFAULT = false;
       
   138 
       
   139 	/**
       
   140 	 * The cached value of the '{@link #isEnabled() <em>Enabled</em>}' attribute.
       
   141 	 * <!-- begin-user-doc -->
       
   142 	 * <!-- end-user-doc -->
       
   143 	 * @see #isEnabled()
       
   144 	 * @generated
       
   145 	 * @ordered
       
   146 	 */
       
   147 	protected boolean enabled = ENABLED_EDEFAULT;
       
   148 
       
   149 	/**
       
   150 	 * The default value of the '{@link #getStatusMessage() <em>Status Message</em>}' attribute.
       
   151 	 * <!-- begin-user-doc -->
       
   152 	 * <!-- end-user-doc -->
       
   153 	 * @see #getStatusMessage()
       
   154 	 * @generated
       
   155 	 * @ordered
       
   156 	 */
       
   157 	protected static final String STATUS_MESSAGE_EDEFAULT = null;
       
   158 
       
   159 	/**
       
   160 	 * The cached value of the '{@link #getStatusMessage() <em>Status Message</em>}' attribute.
       
   161 	 * <!-- begin-user-doc -->
       
   162 	 * <!-- end-user-doc -->
       
   163 	 * @see #getStatusMessage()
       
   164 	 * @generated
       
   165 	 * @ordered
       
   166 	 */
       
   167 	protected String statusMessage = STATUS_MESSAGE_EDEFAULT;
       
   168 
       
   169 	/**
       
   170 	 * <!-- begin-user-doc -->
       
   171 	 * <!-- end-user-doc -->
       
   172 	 * @generated
       
   173 	 */
       
   174 	protected IbyEntryImpl() {
       
   175 		super();
       
   176 	}
       
   177 
       
   178 	/**
       
   179 	 * <!-- begin-user-doc -->
       
   180 	 * <!-- end-user-doc -->
       
   181 	 * @generated
       
   182 	 */
       
   183 	@Override
       
   184 	protected EClass eStaticClass() {
       
   185 		return IContentPackage.Literals.IBY_ENTRY;
       
   186 	}
       
   187 
       
   188 	/**
       
   189 	 * <!-- begin-user-doc -->
       
   190 	 * <!-- end-user-doc -->
       
   191 	 * @generated
       
   192 	 */
       
   193 	public String getFile() {
       
   194 		return file;
       
   195 	}
       
   196 
       
   197 	/**
       
   198 	 * <!-- begin-user-doc -->
       
   199 	 * <!-- end-user-doc -->
       
   200 	 * @generated
       
   201 	 */
       
   202 	public void setFile(String newFile) {
       
   203 		String oldFile = file;
       
   204 		file = newFile;
       
   205 		if (eNotificationRequired())
       
   206 			eNotify(new ENotificationImpl(this, Notification.SET, IContentPackage.IBY_ENTRY__FILE, oldFile, file));
       
   207 	}
       
   208 
       
   209 	/**
       
   210 	 * <!-- begin-user-doc -->
       
   211 	 * <!-- end-user-doc -->
       
   212 	 * @generated
       
   213 	 */
       
   214 	public String getTarget() {
       
   215 		return target;
       
   216 	}
       
   217 
       
   218 	/**
       
   219 	 * <!-- begin-user-doc -->
       
   220 	 * <!-- end-user-doc -->
       
   221 	 * @generated
       
   222 	 */
       
   223 	public void setTarget(String newTarget) {
       
   224 		String oldTarget = target;
       
   225 		target = newTarget;
       
   226 		if (eNotificationRequired())
       
   227 			eNotify(new ENotificationImpl(this, Notification.SET, IContentPackage.IBY_ENTRY__TARGET, oldTarget, target));
       
   228 	}
       
   229 
       
   230 	/**
       
   231 	 * <!-- begin-user-doc -->
       
   232 	 * <!-- end-user-doc -->
       
   233 	 * @generated
       
   234 	 */
       
   235 	public IMAGESECTION getLocation() {
       
   236 		return location;
       
   237 	}
       
   238 
       
   239 	/**
       
   240 	 * <!-- begin-user-doc -->
       
   241 	 * <!-- end-user-doc -->
       
   242 	 * @generated
       
   243 	 */
       
   244 	public void setLocation(IMAGESECTION newLocation) {
       
   245 		IMAGESECTION oldLocation = location;
       
   246 		location = newLocation == null ? LOCATION_EDEFAULT : newLocation;
       
   247 		if (eNotificationRequired())
       
   248 			eNotify(new ENotificationImpl(this, Notification.SET, IContentPackage.IBY_ENTRY__LOCATION, oldLocation, location));
       
   249 	}
       
   250 
       
   251 	/**
       
   252 	 * <!-- begin-user-doc -->
       
   253 	 * <!-- end-user-doc -->
       
   254 	 * @generated
       
   255 	 */
       
   256 	public boolean isDebug() {
       
   257 		return debug;
       
   258 	}
       
   259 
       
   260 	/**
       
   261 	 * <!-- begin-user-doc -->
       
   262 	 * <!-- end-user-doc -->
       
   263 	 * @generated
       
   264 	 */
       
   265 	public void setDebug(boolean newDebug) {
       
   266 		boolean oldDebug = debug;
       
   267 		debug = newDebug;
       
   268 		if (eNotificationRequired())
       
   269 			eNotify(new ENotificationImpl(this, Notification.SET, IContentPackage.IBY_ENTRY__DEBUG, oldDebug, debug));
       
   270 	}
       
   271 
       
   272 	/**
       
   273 	 * <!-- begin-user-doc -->
       
   274 	 * <!-- end-user-doc -->
       
   275 	 * @generated
       
   276 	 */
       
   277 	public boolean isEnabled() {
       
   278 		return enabled;
       
   279 	}
       
   280 
       
   281 	/**
       
   282 	 * <!-- begin-user-doc -->
       
   283 	 * <!-- end-user-doc -->
       
   284 	 * @generated
       
   285 	 */
       
   286 	public void setEnabled(boolean newEnabled) {
       
   287 		boolean oldEnabled = enabled;
       
   288 		enabled = newEnabled;
       
   289 		if (eNotificationRequired())
       
   290 			eNotify(new ENotificationImpl(this, Notification.SET, IContentPackage.IBY_ENTRY__ENABLED, oldEnabled, enabled));
       
   291 	}
       
   292 
       
   293 	/**
       
   294 	 * <!-- begin-user-doc -->
       
   295 	 * <!-- end-user-doc -->
       
   296 	 * @generated
       
   297 	 */
       
   298 	public String getStatusMessage() {
       
   299 		return statusMessage;
       
   300 	}
       
   301 
       
   302 	/**
       
   303 	 * <!-- begin-user-doc -->
       
   304 	 * <!-- end-user-doc -->
       
   305 	 * @generated
       
   306 	 */
       
   307 	public void setStatusMessage(String newStatusMessage) {
       
   308 		String oldStatusMessage = statusMessage;
       
   309 		statusMessage = newStatusMessage;
       
   310 		if (eNotificationRequired())
       
   311 			eNotify(new ENotificationImpl(this, Notification.SET, IContentPackage.IBY_ENTRY__STATUS_MESSAGE, oldStatusMessage, statusMessage));
       
   312 	}
       
   313 
       
   314 	/**
       
   315 	 * <!-- begin-user-doc -->
       
   316 	 * <!-- end-user-doc -->
       
   317 	 * @generated
       
   318 	 */
       
   319 	@Override
       
   320 	public Object eGet(int featureID, boolean resolve, boolean coreType) {
       
   321 		switch (featureID) {
       
   322 			case IContentPackage.IBY_ENTRY__FILE:
       
   323 				return getFile();
       
   324 			case IContentPackage.IBY_ENTRY__TARGET:
       
   325 				return getTarget();
       
   326 			case IContentPackage.IBY_ENTRY__LOCATION:
       
   327 				return getLocation();
       
   328 			case IContentPackage.IBY_ENTRY__DEBUG:
       
   329 				return isDebug();
       
   330 			case IContentPackage.IBY_ENTRY__ENABLED:
       
   331 				return isEnabled();
       
   332 			case IContentPackage.IBY_ENTRY__STATUS_MESSAGE:
       
   333 				return getStatusMessage();
       
   334 		}
       
   335 		return super.eGet(featureID, resolve, coreType);
       
   336 	}
       
   337 
       
   338 	/**
       
   339 	 * <!-- begin-user-doc -->
       
   340 	 * <!-- end-user-doc -->
       
   341 	 * @generated
       
   342 	 */
       
   343 	@Override
       
   344 	public void eSet(int featureID, Object newValue) {
       
   345 		switch (featureID) {
       
   346 			case IContentPackage.IBY_ENTRY__FILE:
       
   347 				setFile((String)newValue);
       
   348 				return;
       
   349 			case IContentPackage.IBY_ENTRY__TARGET:
       
   350 				setTarget((String)newValue);
       
   351 				return;
       
   352 			case IContentPackage.IBY_ENTRY__LOCATION:
       
   353 				setLocation((IMAGESECTION)newValue);
       
   354 				return;
       
   355 			case IContentPackage.IBY_ENTRY__DEBUG:
       
   356 				setDebug((Boolean)newValue);
       
   357 				return;
       
   358 			case IContentPackage.IBY_ENTRY__ENABLED:
       
   359 				setEnabled((Boolean)newValue);
       
   360 				return;
       
   361 			case IContentPackage.IBY_ENTRY__STATUS_MESSAGE:
       
   362 				setStatusMessage((String)newValue);
       
   363 				return;
       
   364 		}
       
   365 		super.eSet(featureID, newValue);
       
   366 	}
       
   367 
       
   368 	/**
       
   369 	 * <!-- begin-user-doc -->
       
   370 	 * <!-- end-user-doc -->
       
   371 	 * @generated
       
   372 	 */
       
   373 	@Override
       
   374 	public void eUnset(int featureID) {
       
   375 		switch (featureID) {
       
   376 			case IContentPackage.IBY_ENTRY__FILE:
       
   377 				setFile(FILE_EDEFAULT);
       
   378 				return;
       
   379 			case IContentPackage.IBY_ENTRY__TARGET:
       
   380 				setTarget(TARGET_EDEFAULT);
       
   381 				return;
       
   382 			case IContentPackage.IBY_ENTRY__LOCATION:
       
   383 				setLocation(LOCATION_EDEFAULT);
       
   384 				return;
       
   385 			case IContentPackage.IBY_ENTRY__DEBUG:
       
   386 				setDebug(DEBUG_EDEFAULT);
       
   387 				return;
       
   388 			case IContentPackage.IBY_ENTRY__ENABLED:
       
   389 				setEnabled(ENABLED_EDEFAULT);
       
   390 				return;
       
   391 			case IContentPackage.IBY_ENTRY__STATUS_MESSAGE:
       
   392 				setStatusMessage(STATUS_MESSAGE_EDEFAULT);
       
   393 				return;
       
   394 		}
       
   395 		super.eUnset(featureID);
       
   396 	}
       
   397 
       
   398 	/**
       
   399 	 * <!-- begin-user-doc -->
       
   400 	 * <!-- end-user-doc -->
       
   401 	 * @generated
       
   402 	 */
       
   403 	@Override
       
   404 	public boolean eIsSet(int featureID) {
       
   405 		switch (featureID) {
       
   406 			case IContentPackage.IBY_ENTRY__FILE:
       
   407 				return FILE_EDEFAULT == null ? file != null : !FILE_EDEFAULT.equals(file);
       
   408 			case IContentPackage.IBY_ENTRY__TARGET:
       
   409 				return TARGET_EDEFAULT == null ? target != null : !TARGET_EDEFAULT.equals(target);
       
   410 			case IContentPackage.IBY_ENTRY__LOCATION:
       
   411 				return location != LOCATION_EDEFAULT;
       
   412 			case IContentPackage.IBY_ENTRY__DEBUG:
       
   413 				return debug != DEBUG_EDEFAULT;
       
   414 			case IContentPackage.IBY_ENTRY__ENABLED:
       
   415 				return enabled != ENABLED_EDEFAULT;
       
   416 			case IContentPackage.IBY_ENTRY__STATUS_MESSAGE:
       
   417 				return STATUS_MESSAGE_EDEFAULT == null ? statusMessage != null : !STATUS_MESSAGE_EDEFAULT.equals(statusMessage);
       
   418 		}
       
   419 		return super.eIsSet(featureID);
       
   420 	}
       
   421 
       
   422 	/**
       
   423 	 * <!-- begin-user-doc -->
       
   424 	 * <!-- end-user-doc -->
       
   425 	 * @generated NOT
       
   426 	 */
       
   427 	@Override
       
   428 	public String toString() {
       
   429 		if (eIsProxy()) return super.toString();
       
   430 		StringBuffer result = new StringBuffer();
       
   431 		result.append("data-override=");
       
   432 		result.append(file);
       
   433 		result.append(" ");
       
   434 		result.append(target);
       
   435 		return result.toString();
       
   436 	}
       
   437 
       
   438 //	@Override
       
   439 	public void append(StringBuffer sb) {
       
   440 		sb.append(isEnabled());
       
   441 		sb.append(";");
       
   442 		sb.append(isDebug());
       
   443 		sb.append(";");
       
   444 		sb.append(getFile());
       
   445 		sb.append(";");
       
   446 		sb.append(getTarget());
       
   447 		sb.append(";");
       
   448 		sb.append(getLocation());
       
   449 	}
       
   450 
       
   451 	public boolean equals(Object obj) {
       
   452 		if(obj instanceof IbyEntry) {
       
   453 			IbyEntry other = (IbyEntry) obj;
       
   454 			String f = getFile();
       
   455 			String t = getTarget();
       
   456 			if(f!=null&&t!=null&&f.equals(other.getFile())&&t.equals(other.getTarget())) {
       
   457 				return true;
       
   458 			} else if(f!=null&&t==null&&f.equals(other.getFile())&&other.getTarget()==null) {
       
   459 				return true;
       
   460 			} else if(f==null&&t!=null&&other.getFile()==null&&t.equals(other.getTarget())) {
       
   461 				return true;
       
   462 			} else if(f==null&&t==null&&other.getFile()==null&&other.getTarget()==null) {
       
   463 				return true;
       
   464 			} else {
       
   465 				return false;
       
   466 			}
       
   467 		}
       
   468 		return false;
       
   469 	}
       
   470 } //IbyEntryImpl