| /******************************************************************************* |
| * Copyright (c) 2009, 2014 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 |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.tesla.core.ui; |
| |
| import java.util.Arrays; |
| import java.util.Collections; |
| import java.util.List; |
| |
| import org.eclipse.emf.common.util.Enumerator; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * A representation of the literals of the enumeration '<em><b>Button Kind</b></em>', |
| * and utility methods for working with them. |
| * <!-- end-user-doc --> |
| * @see org.eclipse.rcptt.tesla.core.ui.UiPackage#getButtonKind() |
| * @model |
| * @generated |
| */ |
| public enum ButtonKind implements Enumerator { |
| /** |
| * The '<em><b>Push</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #PUSH_VALUE |
| * @generated |
| * @ordered |
| */ |
| PUSH(0, "Push", "Push"), |
| |
| /** |
| * The '<em><b>Radio</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #RADIO_VALUE |
| * @generated |
| * @ordered |
| */ |
| RADIO(1, "Radio", "Radio"), |
| |
| /** |
| * The '<em><b>Toggle</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #TOGGLE_VALUE |
| * @generated |
| * @ordered |
| */ |
| TOGGLE(2, "Toggle", "Toggle"), |
| |
| /** |
| * The '<em><b>Tool</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #TOOL_VALUE |
| * @generated |
| * @ordered |
| */ |
| TOOL(3, "Tool", "Tool"), |
| |
| /** |
| * The '<em><b>Arrow</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #ARROW_VALUE |
| * @generated |
| * @ordered |
| */ |
| ARROW(4, "Arrow", "Arrow"), |
| |
| /** |
| * The '<em><b>Check</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #CHECK_VALUE |
| * @generated |
| * @ordered |
| */ |
| CHECK(5, "Check", "Check"); |
| |
| /** |
| * The '<em><b>Push</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Push</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #PUSH |
| * @model name="Push" |
| * @generated |
| * @ordered |
| */ |
| public static final int PUSH_VALUE = 0; |
| |
| /** |
| * The '<em><b>Radio</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Radio</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #RADIO |
| * @model name="Radio" |
| * @generated |
| * @ordered |
| */ |
| public static final int RADIO_VALUE = 1; |
| |
| /** |
| * The '<em><b>Toggle</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Toggle</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #TOGGLE |
| * @model name="Toggle" |
| * @generated |
| * @ordered |
| */ |
| public static final int TOGGLE_VALUE = 2; |
| |
| /** |
| * The '<em><b>Tool</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Tool</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #TOOL |
| * @model name="Tool" |
| * @generated |
| * @ordered |
| */ |
| public static final int TOOL_VALUE = 3; |
| |
| /** |
| * The '<em><b>Arrow</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Arrow</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #ARROW |
| * @model name="Arrow" |
| * @generated |
| * @ordered |
| */ |
| public static final int ARROW_VALUE = 4; |
| |
| /** |
| * The '<em><b>Check</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Check</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #CHECK |
| * @model name="Check" |
| * @generated |
| * @ordered |
| */ |
| public static final int CHECK_VALUE = 5; |
| |
| /** |
| * An array of all the '<em><b>Button Kind</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private static final ButtonKind[] VALUES_ARRAY = |
| new ButtonKind[] { |
| PUSH, |
| RADIO, |
| TOGGLE, |
| TOOL, |
| ARROW, |
| CHECK, |
| }; |
| |
| /** |
| * A public read-only list of all the '<em><b>Button Kind</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final List<ButtonKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
| |
| /** |
| * Returns the '<em><b>Button Kind</b></em>' literal with the specified literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static ButtonKind get(String literal) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| ButtonKind result = VALUES_ARRAY[i]; |
| if (result.toString().equals(literal)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Button Kind</b></em>' literal with the specified name. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static ButtonKind getByName(String name) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| ButtonKind result = VALUES_ARRAY[i]; |
| if (result.getName().equals(name)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Button Kind</b></em>' literal with the specified integer value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static ButtonKind get(int value) { |
| switch (value) { |
| case PUSH_VALUE: return PUSH; |
| case RADIO_VALUE: return RADIO; |
| case TOGGLE_VALUE: return TOGGLE; |
| case TOOL_VALUE: return TOOL; |
| case ARROW_VALUE: return ARROW; |
| case CHECK_VALUE: return CHECK; |
| } |
| return null; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private final int value; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private final String name; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private final String literal; |
| |
| /** |
| * Only this class can construct instances. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private ButtonKind(int value, String name, String literal) { |
| this.value = value; |
| this.name = name; |
| this.literal = literal; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getLiteral() { |
| return literal; |
| } |
| |
| /** |
| * Returns the literal value of the enumerator, which is its string representation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| return literal; |
| } |
| |
| } //ButtonKind |