/** * Copyright (c) 2008, 2015 IBM Corporation 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 * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation */ package org.eclipse.e4.ui.model.application.commands.util; import org.eclipse.e4.ui.model.application.MApplicationElement; import org.eclipse.e4.ui.model.application.MContribution; import org.eclipse.e4.ui.model.application.commands.*; import org.eclipse.e4.ui.model.application.commands.impl.CommandsPackageImpl; import org.eclipse.e4.ui.model.application.ui.MLocalizable; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; /** * <!-- begin-user-doc --> * The <b>Switch</b> for the model's inheritance hierarchy. * It supports the call {@link #doSwitch(EObject) doSwitch(object)} * to invoke the <code>caseXXX</code> method for each class of the model, * starting with the actual class of the object * and proceeding up the inheritance hierarchy * until a non-null result is returned, * which is the result of the switch. * <!-- end-user-doc --> * @see org.eclipse.e4.ui.model.application.commands.impl.CommandsPackageImpl * @generated */ public class CommandsSwitch<T> extends Switch<T> { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static CommandsPackageImpl modelPackage; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public CommandsSwitch() { if (modelPackage == null) { modelPackage = CommandsPackageImpl.eINSTANCE; } } /** * Checks whether this is a switch for the given package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param ePackage the package in question. * @return whether this is a switch for the given package. * @generated */ @Override protected boolean isSwitchFor(EPackage ePackage) { return ePackage == modelPackage; } /** * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { case CommandsPackageImpl.BINDING_TABLE_CONTAINER: { MBindingTableContainer bindingTableContainer = (MBindingTableContainer)theEObject; T result = caseBindingTableContainer(bindingTableContainer); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.BINDINGS: { MBindings bindings = (MBindings)theEObject; T result = caseBindings(bindings); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.BINDING_CONTEXT: { MBindingContext bindingContext = (MBindingContext)theEObject; T result = caseBindingContext(bindingContext); if (result == null) result = caseApplicationElement(bindingContext); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.BINDING_TABLE: { MBindingTable bindingTable = (MBindingTable)theEObject; T result = caseBindingTable(bindingTable); if (result == null) result = caseApplicationElement(bindingTable); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.COMMAND: { MCommand command = (MCommand)theEObject; T result = caseCommand(command); if (result == null) result = caseApplicationElement(command); if (result == null) result = caseLocalizable(command); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.COMMAND_PARAMETER: { MCommandParameter commandParameter = (MCommandParameter)theEObject; T result = caseCommandParameter(commandParameter); if (result == null) result = caseApplicationElement(commandParameter); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.HANDLER: { MHandler handler = (MHandler)theEObject; T result = caseHandler(handler); if (result == null) result = caseContribution(handler); if (result == null) result = caseApplicationElement(handler); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.HANDLER_CONTAINER: { MHandlerContainer handlerContainer = (MHandlerContainer)theEObject; T result = caseHandlerContainer(handlerContainer); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.KEY_BINDING: { MKeyBinding keyBinding = (MKeyBinding)theEObject; T result = caseKeyBinding(keyBinding); if (result == null) result = caseApplicationElement(keyBinding); if (result == null) result = caseKeySequence(keyBinding); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.KEY_SEQUENCE: { MKeySequence keySequence = (MKeySequence)theEObject; T result = caseKeySequence(keySequence); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.PARAMETER: { MParameter parameter = (MParameter)theEObject; T result = caseParameter(parameter); if (result == null) result = caseApplicationElement(parameter); if (result == null) result = defaultCase(theEObject); return result; } case CommandsPackageImpl.CATEGORY: { MCategory category = (MCategory)theEObject; T result = caseCategory(category); if (result == null) result = caseApplicationElement(category); if (result == null) result = caseLocalizable(category); if (result == null) result = defaultCase(theEObject); return result; } default: return defaultCase(theEObject); } } /** * Returns the result of interpreting the object as an instance of '<em>Binding Table Container</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Binding Table Container</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBindingTableContainer(MBindingTableContainer object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Bindings</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Bindings</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBindings(MBindings object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Binding Context</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Binding Context</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBindingContext(MBindingContext object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Binding Table</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Binding Table</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseBindingTable(MBindingTable object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Command</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Command</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCommand(MCommand object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Command Parameter</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Command Parameter</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCommandParameter(MCommandParameter object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Handler</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Handler</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseHandler(MHandler object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Handler Container</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Handler Container</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseHandlerContainer(MHandlerContainer object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Key Binding</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Key Binding</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseKeyBinding(MKeyBinding object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Key Sequence</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Key Sequence</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseKeySequence(MKeySequence object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Parameter</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Parameter</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseParameter(MParameter object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Category</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Category</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseCategory(MCategory object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Element</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Element</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseApplicationElement(MApplicationElement object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Localizable</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Localizable</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseLocalizable(MLocalizable object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>Contribution</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Contribution</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ public T caseContribution(MContribution object) { return null; } /** * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch, but this is the last case anyway. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>EObject</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) * @generated */ @Override public T defaultCase(EObject object) { return null; } } //CommandsSwitch