diff --git a/core/org.eclipse.rcptt.core.ecl.core/META-INF/MANIFEST.MF b/core/org.eclipse.rcptt.core.ecl.core/META-INF/MANIFEST.MF index d51533b7e..40e8a3f48 100644 --- a/core/org.eclipse.rcptt.core.ecl.core/META-INF/MANIFEST.MF +++ b/core/org.eclipse.rcptt.core.ecl.core/META-INF/MANIFEST.MF @@ -14,6 +14,7 @@ Export-Package: org.eclipse.rcptt.core.ecl.core.model, Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.rcptt.ecl.core;bundle-version="[2.2.0,3.0.0)";visibility:=reexport, + org.eclipse.rcptt.core.scenario;visibility:=reexport, org.eclipse.rcptt.tesla.core;bundle-version="[2.2.0,3.0.0)";visibility:=reexport, org.eclipse.rcptt.core;bundle-version="[2.2.0,3.0.0)";visibility:=reexport, org.eclipse.rcptt.watson.core;bundle-version="[2.2.0,3.0.0)";visibility:=reexport, diff --git a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/ControlHierarchyState.java b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/ControlHierarchyState.java new file mode 100644 index 000000000..49ca0c2d0 --- /dev/null +++ b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/ControlHierarchyState.java @@ -0,0 +1,276 @@ +/******************************************************************************* + * Copyright (c) 2009, 2016 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.core.ecl.core.model; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Control Hierarchy State', + * and utility methods for working with them. + * + * @see org.eclipse.rcptt.core.ecl.core.model.Q7CorePackage#getControlHierarchyState() + * @model + * @generated + */ +public enum ControlHierarchyState implements Enumerator { + /** + * The 'HIGHLIGHT WIDGET' literal object. + * + * + * @see #HIGHLIGHT_WIDGET_VALUE + * @generated + * @ordered + */ + HIGHLIGHT_WIDGET(0, "HIGHLIGHT_WIDGET", "HIGHLIGHT_WIDGET"), + + /** + * The 'UPDATE ASSERT WINDOW' literal object. + * + * + * @see #UPDATE_ASSERT_WINDOW_VALUE + * @generated + * @ordered + */ + UPDATE_ASSERT_WINDOW(1, "UPDATE_ASSERT_WINDOW", "UPDATE_ASSERT_WINDOW"), + + /** + * The 'GET ELEMENT' literal object. + * + * + * @see #GET_ELEMENT_VALUE + * @generated + * @ordered + */ + GET_ELEMENT(2, "GET_ELEMENT", "GET_ELEMENT"), + + /** + * The 'GET PARENT' literal object. + * + * + * @see #GET_PARENT_VALUE + * @generated + * @ordered + */ + GET_PARENT(3, "GET_PARENT", "GET_PARENT"); + + /** + * The 'HIGHLIGHT WIDGET' literal value. + * + *

+ * If the meaning of 'HIGHLIGHT WIDGET' literal object isn't clear, + * there really should be more of a description here... + *

+ * + * @see #HIGHLIGHT_WIDGET + * @model + * @generated + * @ordered + */ + public static final int HIGHLIGHT_WIDGET_VALUE = 0; + + /** + * The 'UPDATE ASSERT WINDOW' literal value. + * + *

+ * If the meaning of 'UPDATE ASSERT WINDOW' literal object isn't clear, + * there really should be more of a description here... + *

+ * + * @see #UPDATE_ASSERT_WINDOW + * @model + * @generated + * @ordered + */ + public static final int UPDATE_ASSERT_WINDOW_VALUE = 1; + + /** + * The 'GET ELEMENT' literal value. + * + *

+ * If the meaning of 'GET ELEMENT' literal object isn't clear, + * there really should be more of a description here... + *

+ * + * @see #GET_ELEMENT + * @model + * @generated + * @ordered + */ + public static final int GET_ELEMENT_VALUE = 2; + + /** + * The 'GET PARENT' literal value. + * + *

+ * If the meaning of 'GET PARENT' literal object isn't clear, + * there really should be more of a description here... + *

+ * + * @see #GET_PARENT + * @model + * @generated + * @ordered + */ + public static final int GET_PARENT_VALUE = 3; + + /** + * An array of all the 'Control Hierarchy State' enumerators. + * + * + * @generated + */ + private static final ControlHierarchyState[] VALUES_ARRAY = + new ControlHierarchyState[] { + HIGHLIGHT_WIDGET, + UPDATE_ASSERT_WINDOW, + GET_ELEMENT, + GET_PARENT, + }; + + /** + * A public read-only list of all the 'Control Hierarchy State' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Control Hierarchy State' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static ControlHierarchyState get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ControlHierarchyState result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Control Hierarchy State' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static ControlHierarchyState getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ControlHierarchyState result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Control Hierarchy State' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static ControlHierarchyState get(int value) { + switch (value) { + case HIGHLIGHT_WIDGET_VALUE: return HIGHLIGHT_WIDGET; + case UPDATE_ASSERT_WINDOW_VALUE: return UPDATE_ASSERT_WINDOW; + case GET_ELEMENT_VALUE: return GET_ELEMENT; + case GET_PARENT_VALUE: return GET_PARENT; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private ControlHierarchyState(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //ControlHierarchyState diff --git a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/GetControlHierarchy.java b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/GetControlHierarchy.java new file mode 100644 index 000000000..a60133692 --- /dev/null +++ b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/GetControlHierarchy.java @@ -0,0 +1,145 @@ +/******************************************************************************* + * Copyright (c) 2009, 2016 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.core.ecl.core.model; + +import org.eclipse.rcptt.ecl.core.Command; + +/** + * + * A representation of the model object 'Get Control Hierarchy'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see org.eclipse.rcptt.core.ecl.core.model.Q7CorePackage#getGetControlHierarchy() + * @model + * @generated + */ +public interface GetControlHierarchy extends Command { + /** + * Returns the value of the 'Id' attribute. + * The default value is "". + * + *

+ * If the meaning of the 'Id' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Id' attribute. + * @see #setId(String) + * @see org.eclipse.rcptt.core.ecl.core.model.Q7CorePackage#getGetControlHierarchy_Id() + * @model default="" + * @generated + */ + String getId(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getId Id}' attribute. + * + * + * @param value the new value of the 'Id' attribute. + * @see #getId() + * @generated + */ + void setId(String value); + + /** + * Returns the value of the 'State' attribute. + * The literals are from the enumeration {@link org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState}. + * + *

+ * If the meaning of the 'State' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'State' attribute. + * @see org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState + * @see #setState(ControlHierarchyState) + * @see org.eclipse.rcptt.core.ecl.core.model.Q7CorePackage#getGetControlHierarchy_State() + * @model + * @generated + */ + ControlHierarchyState getState(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getState State}' attribute. + * + * + * @param value the new value of the 'State' attribute. + * @see org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState + * @see #getState() + * @generated + */ + void setState(ControlHierarchyState value); + + /** + * Returns the value of the 'Description' attribute. + * The default value is "". + * + *

+ * If the meaning of the 'Description' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Description' attribute. + * @see #setDescription(String) + * @see org.eclipse.rcptt.core.ecl.core.model.Q7CorePackage#getGetControlHierarchy_Description() + * @model default="" + * @generated + */ + String getDescription(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getDescription Description}' attribute. + * + * + * @param value the new value of the 'Description' attribute. + * @see #getDescription() + * @generated + */ + void setDescription(String value); + + /** + * Returns the value of the 'Kind' attribute. + * The default value is "". + * + *

+ * If the meaning of the 'Kind' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Kind' attribute. + * @see #setKind(String) + * @see org.eclipse.rcptt.core.ecl.core.model.Q7CorePackage#getGetControlHierarchy_Kind() + * @model default="" + * @generated + */ + String getKind(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getKind Kind}' attribute. + * + * + * @param value the new value of the 'Kind' attribute. + * @see #getKind() + * @generated + */ + void setKind(String value); + +} // GetControlHierarchy diff --git a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/Q7CoreFactory.java b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/Q7CoreFactory.java old mode 100644 new mode 100755 index d7fc0b709..032f6e708 --- a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/Q7CoreFactory.java +++ b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/Q7CoreFactory.java @@ -245,6 +245,15 @@ public interface Q7CoreFactory extends EFactory { */ TerminateAut createTerminateAut(); + /** + * Returns a new object of class 'Get Control Hierarchy'. + * + * + * @return a new object of class 'Get Control Hierarchy'. + * @generated + */ + GetControlHierarchy createGetControlHierarchy(); + /** * Returns the package supported by this factory. * diff --git a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/Q7CorePackage.java b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/Q7CorePackage.java old mode 100644 new mode 100755 index 6b1001cb1..938150c16 --- a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/Q7CorePackage.java +++ b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/Q7CorePackage.java @@ -1179,6 +1179,79 @@ public interface Q7CorePackage extends EPackage { */ int TERMINATE_AUT_FEATURE_COUNT = CorePackage.COMMAND_FEATURE_COUNT + 0; + /** + * The meta object id for the '{@link org.eclipse.rcptt.core.ecl.core.model.impl.GetControlHierarchyImpl Get Control Hierarchy}' class. + * + * + * @see org.eclipse.rcptt.core.ecl.core.model.impl.GetControlHierarchyImpl + * @see org.eclipse.rcptt.core.ecl.core.model.impl.Q7CorePackageImpl#getGetControlHierarchy() + * @generated + */ + int GET_CONTROL_HIERARCHY = 24; + + /** + * The feature id for the 'Host' attribute. + * + * + * @generated + * @ordered + */ + int GET_CONTROL_HIERARCHY__HOST = CorePackage.COMMAND__HOST; + + /** + * The feature id for the 'Bindings' containment reference list. + * + * + * @generated + * @ordered + */ + int GET_CONTROL_HIERARCHY__BINDINGS = CorePackage.COMMAND__BINDINGS; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int GET_CONTROL_HIERARCHY__ID = CorePackage.COMMAND_FEATURE_COUNT + 0; + + /** + * The feature id for the 'State' attribute. + * + * + * @generated + * @ordered + */ + int GET_CONTROL_HIERARCHY__STATE = CorePackage.COMMAND_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Description' attribute. + * + * + * @generated + * @ordered + */ + int GET_CONTROL_HIERARCHY__DESCRIPTION = CorePackage.COMMAND_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Kind' attribute. + * + * + * @generated + * @ordered + */ + int GET_CONTROL_HIERARCHY__KIND = CorePackage.COMMAND_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'Get Control Hierarchy' class. + * + * + * @generated + * @ordered + */ + int GET_CONTROL_HIERARCHY_FEATURE_COUNT = CorePackage.COMMAND_FEATURE_COUNT + 4; + /** * The meta object id for the '{@link org.eclipse.rcptt.core.ecl.core.model.ExecutionPhase Execution Phase}' enum. * @@ -1187,7 +1260,17 @@ public interface Q7CorePackage extends EPackage { * @see org.eclipse.rcptt.core.ecl.core.model.impl.Q7CorePackageImpl#getExecutionPhase() * @generated */ - int EXECUTION_PHASE = 24; + int EXECUTION_PHASE = 25; + + /** + * The meta object id for the '{@link org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState Control Hierarchy State}' enum. + * + * + * @see org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState + * @see org.eclipse.rcptt.core.ecl.core.model.impl.Q7CorePackageImpl#getControlHierarchyState() + * @generated + */ + int CONTROL_HIERARCHY_STATE = 26; /** * Returns the meta object for class '{@link org.eclipse.rcptt.core.ecl.core.model.EnterContext Enter Context}'. @@ -1825,6 +1908,60 @@ public interface Q7CorePackage extends EPackage { */ EClass getTerminateAut(); + /** + * Returns the meta object for class '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy Get Control Hierarchy}'. + * + * + * @return the meta object for class 'Get Control Hierarchy'. + * @see org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy + * @generated + */ + EClass getGetControlHierarchy(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getId Id}'. + * + * + * @return the meta object for the attribute 'Id'. + * @see org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getId() + * @see #getGetControlHierarchy() + * @generated + */ + EAttribute getGetControlHierarchy_Id(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getState State}'. + * + * + * @return the meta object for the attribute 'State'. + * @see org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getState() + * @see #getGetControlHierarchy() + * @generated + */ + EAttribute getGetControlHierarchy_State(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getDescription Description}'. + * + * + * @return the meta object for the attribute 'Description'. + * @see org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getDescription() + * @see #getGetControlHierarchy() + * @generated + */ + EAttribute getGetControlHierarchy_Description(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getKind Kind}'. + * + * + * @return the meta object for the attribute 'Kind'. + * @see org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy#getKind() + * @see #getGetControlHierarchy() + * @generated + */ + EAttribute getGetControlHierarchy_Kind(); + /** * Returns the meta object for enum '{@link org.eclipse.rcptt.core.ecl.core.model.ExecutionPhase Execution Phase}'. * @@ -1835,6 +1972,16 @@ public interface Q7CorePackage extends EPackage { */ EEnum getExecutionPhase(); + /** + * Returns the meta object for enum '{@link org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState Control Hierarchy State}'. + * + * + * @return the meta object for enum 'Control Hierarchy State'. + * @see org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState + * @generated + */ + EEnum getControlHierarchyState(); + /** * Returns the factory that creates the instances of the model. * @@ -2385,6 +2532,48 @@ interface Literals { */ EClass TERMINATE_AUT = eINSTANCE.getTerminateAut(); + /** + * The meta object literal for the '{@link org.eclipse.rcptt.core.ecl.core.model.impl.GetControlHierarchyImpl Get Control Hierarchy}' class. + * + * + * @see org.eclipse.rcptt.core.ecl.core.model.impl.GetControlHierarchyImpl + * @see org.eclipse.rcptt.core.ecl.core.model.impl.Q7CorePackageImpl#getGetControlHierarchy() + * @generated + */ + EClass GET_CONTROL_HIERARCHY = eINSTANCE.getGetControlHierarchy(); + + /** + * The meta object literal for the 'Id' attribute feature. + * + * + * @generated + */ + EAttribute GET_CONTROL_HIERARCHY__ID = eINSTANCE.getGetControlHierarchy_Id(); + + /** + * The meta object literal for the 'State' attribute feature. + * + * + * @generated + */ + EAttribute GET_CONTROL_HIERARCHY__STATE = eINSTANCE.getGetControlHierarchy_State(); + + /** + * The meta object literal for the 'Description' attribute feature. + * + * + * @generated + */ + EAttribute GET_CONTROL_HIERARCHY__DESCRIPTION = eINSTANCE.getGetControlHierarchy_Description(); + + /** + * The meta object literal for the 'Kind' attribute feature. + * + * + * @generated + */ + EAttribute GET_CONTROL_HIERARCHY__KIND = eINSTANCE.getGetControlHierarchy_Kind(); + /** * The meta object literal for the '{@link org.eclipse.rcptt.core.ecl.core.model.ExecutionPhase Execution Phase}' enum. * @@ -2395,6 +2584,16 @@ interface Literals { */ EEnum EXECUTION_PHASE = eINSTANCE.getExecutionPhase(); + /** + * The meta object literal for the '{@link org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState Control Hierarchy State}' enum. + * + * + * @see org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState + * @see org.eclipse.rcptt.core.ecl.core.model.impl.Q7CorePackageImpl#getControlHierarchyState() + * @generated + */ + EEnum CONTROL_HIERARCHY_STATE = eINSTANCE.getControlHierarchyState(); + } } //Q7CorePackage diff --git a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/GetControlHierarchyImpl.java b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/GetControlHierarchyImpl.java new file mode 100644 index 000000000..033d1a48a --- /dev/null +++ b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/GetControlHierarchyImpl.java @@ -0,0 +1,335 @@ +/******************************************************************************* + * Copyright (c) 2009, 2016 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.core.ecl.core.model.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState; +import org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy; +import org.eclipse.rcptt.core.ecl.core.model.Q7CorePackage; + +import org.eclipse.rcptt.ecl.core.impl.CommandImpl; + +/** + * + * An implementation of the model object 'Get Control Hierarchy'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class GetControlHierarchyImpl extends CommandImpl implements GetControlHierarchy { + /** + * The default value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected static final String ID_EDEFAULT = ""; + + /** + * The cached value of the '{@link #getId() Id}' attribute. + * + * + * @see #getId() + * @generated + * @ordered + */ + protected String id = ID_EDEFAULT; + + /** + * The default value of the '{@link #getState() State}' attribute. + * + * + * @see #getState() + * @generated + * @ordered + */ + protected static final ControlHierarchyState STATE_EDEFAULT = ControlHierarchyState.HIGHLIGHT_WIDGET; + + /** + * The cached value of the '{@link #getState() State}' attribute. + * + * + * @see #getState() + * @generated + * @ordered + */ + protected ControlHierarchyState state = STATE_EDEFAULT; + + /** + * The default value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + protected static final String DESCRIPTION_EDEFAULT = ""; + + /** + * The cached value of the '{@link #getDescription() Description}' attribute. + * + * + * @see #getDescription() + * @generated + * @ordered + */ + protected String description = DESCRIPTION_EDEFAULT; + + /** + * The default value of the '{@link #getKind() Kind}' attribute. + * + * + * @see #getKind() + * @generated + * @ordered + */ + protected static final String KIND_EDEFAULT = ""; + + /** + * The cached value of the '{@link #getKind() Kind}' attribute. + * + * + * @see #getKind() + * @generated + * @ordered + */ + protected String kind = KIND_EDEFAULT; + + /** + * + * + * @generated + */ + protected GetControlHierarchyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return Q7CorePackage.Literals.GET_CONTROL_HIERARCHY; + } + + /** + * + * + * @generated + */ + public String getId() { + return id; + } + + /** + * + * + * @generated + */ + public void setId(String newId) { + String oldId = id; + id = newId; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Q7CorePackage.GET_CONTROL_HIERARCHY__ID, oldId, id)); + } + + /** + * + * + * @generated + */ + public ControlHierarchyState getState() { + return state; + } + + /** + * + * + * @generated + */ + public void setState(ControlHierarchyState newState) { + ControlHierarchyState oldState = state; + state = newState == null ? STATE_EDEFAULT : newState; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Q7CorePackage.GET_CONTROL_HIERARCHY__STATE, oldState, state)); + } + + /** + * + * + * @generated + */ + public String getDescription() { + return description; + } + + /** + * + * + * @generated + */ + public void setDescription(String newDescription) { + String oldDescription = description; + description = newDescription; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Q7CorePackage.GET_CONTROL_HIERARCHY__DESCRIPTION, oldDescription, description)); + } + + /** + * + * + * @generated + */ + public String getKind() { + return kind; + } + + /** + * + * + * @generated + */ + public void setKind(String newKind) { + String oldKind = kind; + kind = newKind; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, Q7CorePackage.GET_CONTROL_HIERARCHY__KIND, oldKind, kind)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case Q7CorePackage.GET_CONTROL_HIERARCHY__ID: + return getId(); + case Q7CorePackage.GET_CONTROL_HIERARCHY__STATE: + return getState(); + case Q7CorePackage.GET_CONTROL_HIERARCHY__DESCRIPTION: + return getDescription(); + case Q7CorePackage.GET_CONTROL_HIERARCHY__KIND: + return getKind(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case Q7CorePackage.GET_CONTROL_HIERARCHY__ID: + setId((String)newValue); + return; + case Q7CorePackage.GET_CONTROL_HIERARCHY__STATE: + setState((ControlHierarchyState)newValue); + return; + case Q7CorePackage.GET_CONTROL_HIERARCHY__DESCRIPTION: + setDescription((String)newValue); + return; + case Q7CorePackage.GET_CONTROL_HIERARCHY__KIND: + setKind((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case Q7CorePackage.GET_CONTROL_HIERARCHY__ID: + setId(ID_EDEFAULT); + return; + case Q7CorePackage.GET_CONTROL_HIERARCHY__STATE: + setState(STATE_EDEFAULT); + return; + case Q7CorePackage.GET_CONTROL_HIERARCHY__DESCRIPTION: + setDescription(DESCRIPTION_EDEFAULT); + return; + case Q7CorePackage.GET_CONTROL_HIERARCHY__KIND: + setKind(KIND_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case Q7CorePackage.GET_CONTROL_HIERARCHY__ID: + return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); + case Q7CorePackage.GET_CONTROL_HIERARCHY__STATE: + return state != STATE_EDEFAULT; + case Q7CorePackage.GET_CONTROL_HIERARCHY__DESCRIPTION: + return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); + case Q7CorePackage.GET_CONTROL_HIERARCHY__KIND: + return KIND_EDEFAULT == null ? kind != null : !KIND_EDEFAULT.equals(kind); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (id: "); + result.append(id); + result.append(", state: "); + result.append(state); + result.append(", description: "); + result.append(description); + result.append(", kind: "); + result.append(kind); + result.append(')'); + return result.toString(); + } + +} //GetControlHierarchyImpl diff --git a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/Q7CoreFactoryImpl.java b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/Q7CoreFactoryImpl.java old mode 100644 new mode 100755 index 5b8096dc4..96a189ce7 --- a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/Q7CoreFactoryImpl.java +++ b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/Q7CoreFactoryImpl.java @@ -89,6 +89,7 @@ public EObject create(EClass eClass) { case Q7CorePackage.CREATE_VERIFICATION: return createCreateVerification(); case Q7CorePackage.CREATE_WIDGET_VERIFICATION_PARAM: return createCreateWidgetVerificationParam(); case Q7CorePackage.TERMINATE_AUT: return createTerminateAut(); + case Q7CorePackage.GET_CONTROL_HIERARCHY: return createGetControlHierarchy(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -104,6 +105,8 @@ public Object createFromString(EDataType eDataType, String initialValue) { switch (eDataType.getClassifierID()) { case Q7CorePackage.EXECUTION_PHASE: return createExecutionPhaseFromString(eDataType, initialValue); + case Q7CorePackage.CONTROL_HIERARCHY_STATE: + return createControlHierarchyStateFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } @@ -119,6 +122,8 @@ public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { case Q7CorePackage.EXECUTION_PHASE: return convertExecutionPhaseToString(eDataType, instanceValue); + case Q7CorePackage.CONTROL_HIERARCHY_STATE: + return convertControlHierarchyStateToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } @@ -364,6 +369,16 @@ public TerminateAut createTerminateAut() { return terminateAut; } + /** + * + * + * @generated + */ + public GetControlHierarchy createGetControlHierarchy() { + GetControlHierarchyImpl getControlHierarchy = new GetControlHierarchyImpl(); + return getControlHierarchy; + } + /** * * @@ -384,6 +399,26 @@ public String convertExecutionPhaseToString(EDataType eDataType, Object instance return instanceValue == null ? null : instanceValue.toString(); } + /** + * + * + * @generated + */ + public ControlHierarchyState createControlHierarchyStateFromString(EDataType eDataType, String initialValue) { + ControlHierarchyState result = ControlHierarchyState.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertControlHierarchyStateToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + /** * * diff --git a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/Q7CorePackageImpl.java b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/Q7CorePackageImpl.java index f2997e682..bcecfbef6 100644 --- a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/Q7CorePackageImpl.java +++ b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/impl/Q7CorePackageImpl.java @@ -1,13 +1,5 @@ -/******************************************************************************* - * Copyright (c) 2009, 2015 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.core.ecl.core.model.impl; import org.eclipse.emf.ecore.EAttribute; @@ -16,11 +8,11 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EcorePackage; + import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.rcptt.ecl.core.CorePackage; -import org.eclipse.rcptt.core.scenario.ScenarioPackage; import org.eclipse.rcptt.core.ecl.core.model.BeginReportNode; +import org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState; import org.eclipse.rcptt.core.ecl.core.model.CreateContext; import org.eclipse.rcptt.core.ecl.core.model.CreateReport; import org.eclipse.rcptt.core.ecl.core.model.CreateVerification; @@ -29,6 +21,7 @@ import org.eclipse.rcptt.core.ecl.core.model.EnterContext; import org.eclipse.rcptt.core.ecl.core.model.ExecVerification; import org.eclipse.rcptt.core.ecl.core.model.ExecutionPhase; +import org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy; import org.eclipse.rcptt.core.ecl.core.model.GetPerspectives; import org.eclipse.rcptt.core.ecl.core.model.GetQ7Information; import org.eclipse.rcptt.core.ecl.core.model.GetReport; @@ -47,131 +40,158 @@ import org.eclipse.rcptt.core.ecl.core.model.TerminateAut; import org.eclipse.rcptt.core.ecl.core.model.ViewInfo; import org.eclipse.rcptt.core.ecl.core.model.ViewList; + +import org.eclipse.rcptt.core.scenario.ScenarioPackage; + +import org.eclipse.rcptt.ecl.core.CorePackage; + import org.eclipse.rcptt.reporting.ReportingPackage; + import org.eclipse.rcptt.sherlock.core.model.sherlock.report.ReportPackage; /** - * An implementation of the model Package. + * + * An implementation of the model Package. + * * @generated */ public class Q7CorePackageImpl extends EPackageImpl implements Q7CorePackage { /** - * + * + * * @generated */ private EClass enterContextEClass = null; /** - * + * + * * @generated */ private EClass createContextEClass = null; /** - * + * + * * @generated */ private EClass prepareEnvironmentEClass = null; /** - * + * + * * @generated */ private EClass setCommandsDelayEClass = null; /** - * + * + * * @generated */ private EClass getQ7InformationEClass = null; /** - * + * + * * @generated */ private EClass q7InformationEClass = null; /** - * + * + * * @generated */ private EClass setQ7FeaturesEClass = null; /** - * + * + * * @generated */ private EClass getPerspectivesEClass = null; /** - * + * + * * @generated */ private EClass perspectiveInfoEClass = null; /** - * + * + * * @generated */ private EClass perspectivesListEClass = null; /** - * + * + * * @generated */ private EClass getViewsEClass = null; /** - * + * + * * @generated */ private EClass viewInfoEClass = null; /** - * + * + * * @generated */ private EClass viewListEClass = null; /** - * + * + * * @generated */ private EClass createReportEClass = null; /** - * + * + * * @generated */ private EClass getReportEClass = null; /** - * + * + * * @generated */ private EClass beginReportNodeEClass = null; /** - * + * + * * @generated */ private EClass endReportNodeEClass = null; /** - * + * + * * @generated */ private EClass reportAppendEClass = null; /** - * + * + * * @generated */ private EClass setQ7OptionEClass = null; /** - * + * + * * @generated */ private EClass execVerificationEClass = null; @@ -205,21 +225,36 @@ public class Q7CorePackageImpl extends EPackageImpl implements Q7CorePackage { private EClass terminateAutEClass = null; /** - * + * + * + * @generated + */ + private EClass getControlHierarchyEClass = null; + + /** + * + * * @generated */ private EEnum executionPhaseEEnum = null; + /** + * + * + * @generated + */ + private EEnum controlHierarchyStateEEnum = null; + /** * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the - * package package URI value. - *

- * Note: the correct way to create the package is via the static factory - * method {@link #init init()}, which also performs initialization of the - * package, or returns the registered package, if one already exists. - * + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * * @see org.eclipse.emf.ecore.EPackage.Registry * @see org.eclipse.rcptt.core.ecl.core.model.Q7CorePackage#eNS_URI * @see #init() @@ -230,21 +265,19 @@ private Q7CorePackageImpl() { } /** - * + * + * * @generated */ private static boolean isInited = false; /** - * Creates, registers, and initializes the Package for this model, - * and for any others upon which it depends. - * - *

- * This method is used to initialize {@link Q7CorePackage#eINSTANCE} when - * that field is accessed. Clients should not invoke it directly. Instead, - * they should simply access that field to obtain the package. + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. * + *

This method is used to initialize {@link Q7CorePackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() @@ -279,7 +312,8 @@ public static Q7CorePackage init() { } /** - * + * + * * @generated */ public EClass getEnterContext() { @@ -287,7 +321,8 @@ public EClass getEnterContext() { } /** - * + * + * * @generated */ public EReference getEnterContext_Data() { @@ -295,7 +330,8 @@ public EReference getEnterContext_Data() { } /** - * + * + * * @generated */ public EClass getCreateContext() { @@ -303,7 +339,8 @@ public EClass getCreateContext() { } /** - * + * + * * @generated */ public EAttribute getCreateContext_Type() { @@ -311,7 +348,8 @@ public EAttribute getCreateContext_Type() { } /** - * + * + * * @generated */ public EReference getCreateContext_Param() { @@ -319,7 +357,8 @@ public EReference getCreateContext_Param() { } /** - * + * + * * @generated */ public EClass getPrepareEnvironment() { @@ -327,7 +366,8 @@ public EClass getPrepareEnvironment() { } /** - * + * + * * @generated */ public EClass getSetCommandsDelay() { @@ -335,7 +375,8 @@ public EClass getSetCommandsDelay() { } /** - * + * + * * @generated */ public EAttribute getSetCommandsDelay_Delay() { @@ -343,7 +384,8 @@ public EAttribute getSetCommandsDelay_Delay() { } /** - * + * + * * @generated */ public EClass getGetQ7Information() { @@ -351,7 +393,8 @@ public EClass getGetQ7Information() { } /** - * + * + * * @generated */ public EClass getQ7Information() { @@ -359,7 +402,8 @@ public EClass getQ7Information() { } /** - * + * + * * @generated */ public EAttribute getQ7Information_Version() { @@ -367,7 +411,8 @@ public EAttribute getQ7Information_Version() { } /** - * + * + * * @generated */ public EAttribute getQ7Information_TeslaActive() { @@ -375,7 +420,8 @@ public EAttribute getQ7Information_TeslaActive() { } /** - * + * + * * @generated */ public EAttribute getQ7Information_TeslaPort() { @@ -401,7 +447,8 @@ public EAttribute getQ7Information_WindowCount() { } /** - * + * + * * @generated */ public EClass getSetQ7Features() { @@ -409,7 +456,8 @@ public EClass getSetQ7Features() { } /** - * + * + * * @generated */ public EAttribute getSetQ7Features_Features() { @@ -417,7 +465,8 @@ public EAttribute getSetQ7Features_Features() { } /** - * + * + * * @generated */ public EClass getGetPerspectives() { @@ -425,7 +474,8 @@ public EClass getGetPerspectives() { } /** - * + * + * * @generated */ public EClass getPerspectiveInfo() { @@ -433,7 +483,8 @@ public EClass getPerspectiveInfo() { } /** - * + * + * * @generated */ public EAttribute getPerspectiveInfo_Id() { @@ -441,7 +492,8 @@ public EAttribute getPerspectiveInfo_Id() { } /** - * + * + * * @generated */ public EAttribute getPerspectiveInfo_Image() { @@ -449,7 +501,8 @@ public EAttribute getPerspectiveInfo_Image() { } /** - * + * + * * @generated */ public EAttribute getPerspectiveInfo_Label() { @@ -457,7 +510,8 @@ public EAttribute getPerspectiveInfo_Label() { } /** - * + * + * * @generated */ public EAttribute getPerspectiveInfo_Description() { @@ -465,7 +519,8 @@ public EAttribute getPerspectiveInfo_Description() { } /** - * + * + * * @generated */ public EClass getPerspectivesList() { @@ -473,7 +528,8 @@ public EClass getPerspectivesList() { } /** - * + * + * * @generated */ public EReference getPerspectivesList_Perspectives() { @@ -481,7 +537,8 @@ public EReference getPerspectivesList_Perspectives() { } /** - * + * + * * @generated */ public EClass getGetViews() { @@ -489,7 +546,8 @@ public EClass getGetViews() { } /** - * + * + * * @generated */ public EClass getViewInfo() { @@ -497,7 +555,8 @@ public EClass getViewInfo() { } /** - * + * + * * @generated */ public EAttribute getViewInfo_Id() { @@ -505,7 +564,8 @@ public EAttribute getViewInfo_Id() { } /** - * + * + * * @generated */ public EAttribute getViewInfo_Image() { @@ -513,7 +573,8 @@ public EAttribute getViewInfo_Image() { } /** - * + * + * * @generated */ public EAttribute getViewInfo_Label() { @@ -521,7 +582,8 @@ public EAttribute getViewInfo_Label() { } /** - * + * + * * @generated */ public EAttribute getViewInfo_Description() { @@ -529,7 +591,8 @@ public EAttribute getViewInfo_Description() { } /** - * + * + * * @generated */ public EReference getViewInfo_Items() { @@ -537,7 +600,8 @@ public EReference getViewInfo_Items() { } /** - * + * + * * @generated */ public EClass getViewList() { @@ -545,7 +609,8 @@ public EClass getViewList() { } /** - * + * + * * @generated */ public EReference getViewList_Items() { @@ -553,7 +618,8 @@ public EReference getViewList_Items() { } /** - * + * + * * @generated */ public EClass getCreateReport() { @@ -561,7 +627,8 @@ public EClass getCreateReport() { } /** - * + * + * * @generated */ public EAttribute getCreateReport_Name() { @@ -569,7 +636,8 @@ public EAttribute getCreateReport_Name() { } /** - * + * + * * @generated */ public EReference getCreateReport_Q7info() { @@ -577,7 +645,8 @@ public EReference getCreateReport_Q7info() { } /** - * + * + * * @generated */ public EClass getGetReport() { @@ -585,7 +654,8 @@ public EClass getGetReport() { } /** - * + * + * * @generated */ public EClass getBeginReportNode() { @@ -593,7 +663,8 @@ public EClass getBeginReportNode() { } /** - * + * + * * @generated */ public EAttribute getBeginReportNode_Name() { @@ -601,7 +672,8 @@ public EAttribute getBeginReportNode_Name() { } /** - * + * + * * @generated */ public EReference getBeginReportNode_Properties() { @@ -609,7 +681,8 @@ public EReference getBeginReportNode_Properties() { } /** - * + * + * * @generated */ public EClass getEndReportNode() { @@ -617,7 +690,8 @@ public EClass getEndReportNode() { } /** - * + * + * * @generated */ public EAttribute getEndReportNode_Snaphots() { @@ -625,7 +699,8 @@ public EAttribute getEndReportNode_Snaphots() { } /** - * + * + * * @generated */ public EAttribute getEndReportNode_TakeSnaphots() { @@ -642,7 +717,8 @@ public EReference getEndReportNode_Result() { } /** - * + * + * * @generated */ public EClass getReportAppend() { @@ -650,7 +726,8 @@ public EClass getReportAppend() { } /** - * + * + * * @generated */ public EReference getReportAppend_Objects() { @@ -658,7 +735,8 @@ public EReference getReportAppend_Objects() { } /** - * + * + * * @generated */ public EClass getSetQ7Option() { @@ -666,7 +744,8 @@ public EClass getSetQ7Option() { } /** - * + * + * * @generated */ public EAttribute getSetQ7Option_Key() { @@ -674,7 +753,8 @@ public EAttribute getSetQ7Option_Key() { } /** - * + * + * * @generated */ public EAttribute getSetQ7Option_Value() { @@ -682,7 +762,8 @@ public EAttribute getSetQ7Option_Value() { } /** - * + * + * * @generated */ public EClass getExecVerification() { @@ -690,7 +771,8 @@ public EClass getExecVerification() { } /** - * + * + * * @generated */ public EReference getExecVerification_Verification() { @@ -698,7 +780,8 @@ public EReference getExecVerification_Verification() { } /** - * + * + * * @generated */ public EAttribute getExecVerification_Phase() { @@ -769,7 +852,53 @@ public EClass getTerminateAut() { } /** - * + * + * + * @generated + */ + public EClass getGetControlHierarchy() { + return getControlHierarchyEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getGetControlHierarchy_Id() { + return (EAttribute)getControlHierarchyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getGetControlHierarchy_State() { + return (EAttribute)getControlHierarchyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getGetControlHierarchy_Description() { + return (EAttribute)getControlHierarchyEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EAttribute getGetControlHierarchy_Kind() { + return (EAttribute)getControlHierarchyEClass.getEStructuralFeatures().get(3); + } + + /** + * + * * @generated */ public EEnum getExecutionPhase() { @@ -777,7 +906,17 @@ public EEnum getExecutionPhase() { } /** - * + * + * + * @generated + */ + public EEnum getControlHierarchyState() { + return controlHierarchyStateEEnum; + } + + /** + * + * * @generated */ public Q7CoreFactory getQ7CoreFactory() { @@ -785,7 +924,8 @@ public Q7CoreFactory getQ7CoreFactory() { } /** - * + * + * * @generated */ private boolean isCreated = false; @@ -886,21 +1026,29 @@ public void createPackageContents() { terminateAutEClass = createEClass(TERMINATE_AUT); + getControlHierarchyEClass = createEClass(GET_CONTROL_HIERARCHY); + createEAttribute(getControlHierarchyEClass, GET_CONTROL_HIERARCHY__ID); + createEAttribute(getControlHierarchyEClass, GET_CONTROL_HIERARCHY__STATE); + createEAttribute(getControlHierarchyEClass, GET_CONTROL_HIERARCHY__DESCRIPTION); + createEAttribute(getControlHierarchyEClass, GET_CONTROL_HIERARCHY__KIND); + // Create enums executionPhaseEEnum = createEEnum(EXECUTION_PHASE); + controlHierarchyStateEEnum = createEEnum(CONTROL_HIERARCHY_STATE); } /** - * + * + * * @generated */ private boolean isInitialized = false; /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * * @generated */ public void initializePackageContents() { @@ -942,6 +1090,7 @@ public void initializePackageContents() { resetVerificationsEClass.getESuperTypes().add(theCorePackage.getCommand()); createVerificationEClass.getESuperTypes().add(theCorePackage.getCommand()); terminateAutEClass.getESuperTypes().add(theCorePackage.getCommand()); + getControlHierarchyEClass.getESuperTypes().add(theCorePackage.getCommand()); // Initialize classes and features; add operations and parameters initEClass(enterContextEClass, EnterContext.class, "EnterContext", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -1028,6 +1177,12 @@ public void initializePackageContents() { initEClass(terminateAutEClass, TerminateAut.class, "TerminateAut", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(getControlHierarchyEClass, GetControlHierarchy.class, "GetControlHierarchy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGetControlHierarchy_Id(), theEcorePackage.getEString(), "id", "", 0, 1, GetControlHierarchy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getGetControlHierarchy_State(), this.getControlHierarchyState(), "state", null, 0, 1, GetControlHierarchy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getGetControlHierarchy_Description(), theEcorePackage.getEString(), "description", "", 0, 1, GetControlHierarchy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getGetControlHierarchy_Kind(), theEcorePackage.getEString(), "kind", "", 0, 1, GetControlHierarchy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + // Initialize enums and add enum literals initEEnum(executionPhaseEEnum, ExecutionPhase.class, "ExecutionPhase"); addEEnumLiteral(executionPhaseEEnum, ExecutionPhase.AUTO); @@ -1035,6 +1190,12 @@ public void initializePackageContents() { addEEnumLiteral(executionPhaseEEnum, ExecutionPhase.RUN); addEEnumLiteral(executionPhaseEEnum, ExecutionPhase.FINISH); + initEEnum(controlHierarchyStateEEnum, ControlHierarchyState.class, "ControlHierarchyState"); + addEEnumLiteral(controlHierarchyStateEEnum, ControlHierarchyState.HIGHLIGHT_WIDGET); + addEEnumLiteral(controlHierarchyStateEEnum, ControlHierarchyState.UPDATE_ASSERT_WINDOW); + addEEnumLiteral(controlHierarchyStateEEnum, ControlHierarchyState.GET_ELEMENT); + addEEnumLiteral(controlHierarchyStateEEnum, ControlHierarchyState.GET_PARENT); + // Create resource createResource(eNS_URI); @@ -1049,8 +1210,8 @@ public void initializePackageContents() { /** * Initializes the annotations for http://www.eclipse.org/ecl/internal. - * + * + * * @generated */ protected void createInternalAnnotations() { @@ -1144,7 +1305,8 @@ protected void createInternalAnnotations() { /** * Initializes the annotations for http://www.eclipse.org/ecl/input. - * + * + * * @generated */ protected void createInputAnnotations() { @@ -1158,7 +1320,8 @@ protected void createInputAnnotations() { /** * Initializes the annotations for http://www.eclipse.org/ecl/docs. - * + * + * * @generated */ protected void createDocsAnnotations() { @@ -1178,4 +1341,4 @@ protected void createDocsAnnotations() { }); } -} // Q7CorePackageImpl +} //Q7CorePackageImpl diff --git a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/util/Q7CoreAdapterFactory.java b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/util/Q7CoreAdapterFactory.java old mode 100644 new mode 100755 index 514cb139a..fe3237569 --- a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/util/Q7CoreAdapterFactory.java +++ b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/util/Q7CoreAdapterFactory.java @@ -174,6 +174,10 @@ public Adapter caseTerminateAut(TerminateAut object) { return createTerminateAutAdapter(); } @Override + public Adapter caseGetControlHierarchy(GetControlHierarchy object) { + return createGetControlHierarchyAdapter(); + } + @Override public Adapter caseCommand(Command object) { return createCommandAdapter(); } @@ -533,6 +537,20 @@ public Adapter createTerminateAutAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy Get Control Hierarchy}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy + * @generated + */ + public Adapter createGetControlHierarchyAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.ecl.core.Command Command}'. * diff --git a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/util/Q7CoreSwitch.java b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/util/Q7CoreSwitch.java old mode 100644 new mode 100755 index c6ee7fa4b..c303f9b7a --- a/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/util/Q7CoreSwitch.java +++ b/core/org.eclipse.rcptt.core.ecl.core/gen-src/org/eclipse/rcptt/core/ecl/core/model/util/Q7CoreSwitch.java @@ -255,6 +255,13 @@ protected T doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } + case Q7CorePackage.GET_CONTROL_HIERARCHY: { + GetControlHierarchy getControlHierarchy = (GetControlHierarchy)theEObject; + T result = caseGetControlHierarchy(getControlHierarchy); + if (result == null) result = caseCommand(getControlHierarchy); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -619,6 +626,21 @@ public T caseTerminateAut(TerminateAut object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Get Control Hierarchy'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Get Control Hierarchy'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGetControlHierarchy(GetControlHierarchy object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Command'. * diff --git a/core/org.eclipse.rcptt.core.ecl.core/model/model.ecore b/core/org.eclipse.rcptt.core.ecl.core/model/model.ecore old mode 100644 new mode 100755 index 8a9c67f2c..d51b2b6e6 --- a/core/org.eclipse.rcptt.core.ecl.core/model/model.ecore +++ b/core/org.eclipse.rcptt.core.ecl.core/model/model.ecore @@ -130,4 +130,19 @@ + + + + + + + + + + + + diff --git a/core/org.eclipse.rcptt.core.ecl.core/model/q7core.genmodel b/core/org.eclipse.rcptt.core.ecl.core/model/q7core.genmodel old mode 100644 new mode 100755 index e929c9a29..c4115f54b --- a/core/org.eclipse.rcptt.core.ecl.core/model/q7core.genmodel +++ b/core/org.eclipse.rcptt.core.ecl.core/model/q7core.genmodel @@ -7,11 +7,24 @@ model.ecore + + + + + + + + + + + + + @@ -22,6 +35,8 @@ + + @@ -47,7 +62,45 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/ProtocolFactory.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/ProtocolFactory.java index e6c3456b1..cf66b6ccb 100644 --- a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/ProtocolFactory.java +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/ProtocolFactory.java @@ -1,13 +1,5 @@ -/******************************************************************************* - * Copyright (c) 2009, 2016 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.protocol; import org.eclipse.emf.ecore.EFactory; @@ -992,6 +984,24 @@ public interface ProtocolFactory extends EFactory { */ RapUploadFile createRapUploadFile(); + /** + * Returns a new object of class 'UI Hierarchy Response'. + * + * + * @return a new object of class 'UI Hierarchy Response'. + * @generated + */ + UIHierarchyResponse createUIHierarchyResponse(); + + /** + * Returns a new object of class 'UI Element'. + * + * + * @return a new object of class 'UI Element'. + * @generated + */ + UIElement createUIElement(); + /** * Returns the package supported by this factory. * diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/ProtocolPackage.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/ProtocolPackage.java index 746aaca07..a7ae4794c 100644 --- a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/ProtocolPackage.java +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/ProtocolPackage.java @@ -1,23 +1,15 @@ -/******************************************************************************* - * Copyright (c) 2009, 2016 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.protocol; -import org.eclipse.rcptt.tesla.core.protocol.raw.RawPackage; - import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EEnum; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; +import org.eclipse.rcptt.tesla.core.protocol.raw.RawPackage; + /** * * The Package for the model. @@ -5520,6 +5512,143 @@ public interface ProtocolPackage extends EPackage { */ int RAP_UPLOAD_FILE_FEATURE_COUNT = RawPackage.COMMAND_FEATURE_COUNT + 2; + /** + * The meta object id for the '{@link org.eclipse.rcptt.tesla.core.protocol.impl.UIHierarchyResponseImpl UI Hierarchy Response}' class. + * + * + * @see org.eclipse.rcptt.tesla.core.protocol.impl.UIHierarchyResponseImpl + * @see org.eclipse.rcptt.tesla.core.protocol.impl.ProtocolPackageImpl#getUIHierarchyResponse() + * @generated + */ + int UI_HIERARCHY_RESPONSE = 108; + + /** + * The feature id for the 'Status' attribute. + * + * + * @generated + * @ordered + */ + int UI_HIERARCHY_RESPONSE__STATUS = RawPackage.RESPONSE__STATUS; + + /** + * The feature id for the 'Message' attribute. + * + * + * @generated + * @ordered + */ + int UI_HIERARCHY_RESPONSE__MESSAGE = RawPackage.RESPONSE__MESSAGE; + + /** + * The feature id for the 'Advanced Information' containment reference. + * + * + * @generated + * @ordered + */ + int UI_HIERARCHY_RESPONSE__ADVANCED_INFORMATION = RawPackage.RESPONSE__ADVANCED_INFORMATION; + + /** + * The feature id for the 'Children' reference list. + * + * + * @generated + * @ordered + */ + int UI_HIERARCHY_RESPONSE__CHILDREN = RawPackage.RESPONSE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Ui Element' reference. + * + * + * @generated + * @ordered + */ + int UI_HIERARCHY_RESPONSE__UI_ELEMENT = RawPackage.RESPONSE_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'UI Hierarchy Response' class. + * + * + * @generated + * @ordered + */ + int UI_HIERARCHY_RESPONSE_FEATURE_COUNT = RawPackage.RESPONSE_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.rcptt.tesla.core.protocol.impl.UIElementImpl UI Element}' class. + * + * + * @see org.eclipse.rcptt.tesla.core.protocol.impl.UIElementImpl + * @see org.eclipse.rcptt.tesla.core.protocol.impl.ProtocolPackageImpl#getUIElement() + * @generated + */ + int UI_ELEMENT = 109; + + /** + * The feature id for the 'Id' attribute. + * + * + * @generated + * @ordered + */ + int UI_ELEMENT__ID = RawPackage.ELEMENT__ID; + + /** + * The feature id for the 'Kind' attribute. + * + * + * @generated + * @ordered + */ + int UI_ELEMENT__KIND = RawPackage.ELEMENT__KIND; + + /** + * The feature id for the 'Description' attribute. + * + * + * @generated + * @ordered + */ + int UI_ELEMENT__DESCRIPTION = RawPackage.ELEMENT__DESCRIPTION; + + /** + * The feature id for the 'Has Children' attribute. + * + * + * @generated + * @ordered + */ + int UI_ELEMENT__HAS_CHILDREN = RawPackage.ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int UI_ELEMENT__NAME = RawPackage.ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Generation Kind' attribute. + * + * + * @generated + * @ordered + */ + int UI_ELEMENT__GENERATION_KIND = RawPackage.ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'UI Element' class. + * + * + * @generated + * @ordered + */ + int UI_ELEMENT_FEATURE_COUNT = RawPackage.ELEMENT_FEATURE_COUNT + 3; + /** * The meta object id for the '{@link org.eclipse.rcptt.tesla.core.protocol.SWTDialogKind SWT Dialog Kind}' enum. * @@ -5528,7 +5657,7 @@ public interface ProtocolPackage extends EPackage { * @see org.eclipse.rcptt.tesla.core.protocol.impl.ProtocolPackageImpl#getSWTDialogKind() * @generated */ - int SWT_DIALOG_KIND = 108; + int SWT_DIALOG_KIND = 110; /** * The meta object id for the '{@link org.eclipse.rcptt.tesla.core.protocol.AssertKind Assert Kind}' enum. @@ -5538,7 +5667,7 @@ public interface ProtocolPackage extends EPackage { * @see org.eclipse.rcptt.tesla.core.protocol.impl.ProtocolPackageImpl#getAssertKind() * @generated */ - int ASSERT_KIND = 109; + int ASSERT_KIND = 111; /** * The meta object id for the '{@link org.eclipse.rcptt.tesla.core.protocol.DragKind Drag Kind}' enum. @@ -5548,7 +5677,7 @@ public interface ProtocolPackage extends EPackage { * @see org.eclipse.rcptt.tesla.core.protocol.impl.ProtocolPackageImpl#getDragKind() * @generated */ - int DRAG_KIND = 110; + int DRAG_KIND = 112; /** * The meta object id for the '{@link org.eclipse.rcptt.tesla.core.protocol.MouseEventKind Mouse Event Kind}' enum. @@ -5558,7 +5687,7 @@ public interface ProtocolPackage extends EPackage { * @see org.eclipse.rcptt.tesla.core.protocol.impl.ProtocolPackageImpl#getMouseEventKind() * @generated */ - int MOUSE_EVENT_KIND = 111; + int MOUSE_EVENT_KIND = 113; /** @@ -8478,6 +8607,81 @@ public interface ProtocolPackage extends EPackage { */ EAttribute getRapUploadFile_Path(); + /** + * Returns the meta object for class '{@link org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse UI Hierarchy Response}'. + * + * + * @return the meta object for class 'UI Hierarchy Response'. + * @see org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse + * @generated + */ + EClass getUIHierarchyResponse(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse#getChildren Children}'. + * + * + * @return the meta object for the reference list 'Children'. + * @see org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse#getChildren() + * @see #getUIHierarchyResponse() + * @generated + */ + EReference getUIHierarchyResponse_Children(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse#getUiElement Ui Element}'. + * + * + * @return the meta object for the reference 'Ui Element'. + * @see org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse#getUiElement() + * @see #getUIHierarchyResponse() + * @generated + */ + EReference getUIHierarchyResponse_UiElement(); + + /** + * Returns the meta object for class '{@link org.eclipse.rcptt.tesla.core.protocol.UIElement UI Element}'. + * + * + * @return the meta object for class 'UI Element'. + * @see org.eclipse.rcptt.tesla.core.protocol.UIElement + * @generated + */ + EClass getUIElement(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.rcptt.tesla.core.protocol.UIElement#isHasChildren Has Children}'. + * + * + * @return the meta object for the attribute 'Has Children'. + * @see org.eclipse.rcptt.tesla.core.protocol.UIElement#isHasChildren() + * @see #getUIElement() + * @generated + */ + EAttribute getUIElement_HasChildren(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.rcptt.tesla.core.protocol.UIElement#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.rcptt.tesla.core.protocol.UIElement#getName() + * @see #getUIElement() + * @generated + */ + EAttribute getUIElement_Name(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.rcptt.tesla.core.protocol.UIElement#getGenerationKind Generation Kind}'. + * + * + * @return the meta object for the attribute 'Generation Kind'. + * @see org.eclipse.rcptt.tesla.core.protocol.UIElement#getGenerationKind() + * @see #getUIElement() + * @generated + */ + EAttribute getUIElement_GenerationKind(); + /** * Returns the meta object for enum '{@link org.eclipse.rcptt.tesla.core.protocol.SWTDialogKind SWT Dialog Kind}'. * @@ -10956,6 +11160,66 @@ interface Literals { */ EAttribute RAP_UPLOAD_FILE__PATH = eINSTANCE.getRapUploadFile_Path(); + /** + * The meta object literal for the '{@link org.eclipse.rcptt.tesla.core.protocol.impl.UIHierarchyResponseImpl UI Hierarchy Response}' class. + * + * + * @see org.eclipse.rcptt.tesla.core.protocol.impl.UIHierarchyResponseImpl + * @see org.eclipse.rcptt.tesla.core.protocol.impl.ProtocolPackageImpl#getUIHierarchyResponse() + * @generated + */ + EClass UI_HIERARCHY_RESPONSE = eINSTANCE.getUIHierarchyResponse(); + + /** + * The meta object literal for the 'Children' reference list feature. + * + * + * @generated + */ + EReference UI_HIERARCHY_RESPONSE__CHILDREN = eINSTANCE.getUIHierarchyResponse_Children(); + + /** + * The meta object literal for the 'Ui Element' reference feature. + * + * + * @generated + */ + EReference UI_HIERARCHY_RESPONSE__UI_ELEMENT = eINSTANCE.getUIHierarchyResponse_UiElement(); + + /** + * The meta object literal for the '{@link org.eclipse.rcptt.tesla.core.protocol.impl.UIElementImpl UI Element}' class. + * + * + * @see org.eclipse.rcptt.tesla.core.protocol.impl.UIElementImpl + * @see org.eclipse.rcptt.tesla.core.protocol.impl.ProtocolPackageImpl#getUIElement() + * @generated + */ + EClass UI_ELEMENT = eINSTANCE.getUIElement(); + + /** + * The meta object literal for the 'Has Children' attribute feature. + * + * + * @generated + */ + EAttribute UI_ELEMENT__HAS_CHILDREN = eINSTANCE.getUIElement_HasChildren(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute UI_ELEMENT__NAME = eINSTANCE.getUIElement_Name(); + + /** + * The meta object literal for the 'Generation Kind' attribute feature. + * + * + * @generated + */ + EAttribute UI_ELEMENT__GENERATION_KIND = eINSTANCE.getUIElement_GenerationKind(); + /** * The meta object literal for the '{@link org.eclipse.rcptt.tesla.core.protocol.SWTDialogKind SWT Dialog Kind}' enum. * diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/UIElement.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/UIElement.java new file mode 100644 index 000000000..dfc0f5cc8 --- /dev/null +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/UIElement.java @@ -0,0 +1,104 @@ +/** + */ +package org.eclipse.rcptt.tesla.core.protocol; + +import org.eclipse.rcptt.tesla.core.protocol.raw.Element; + +/** + * + * A representation of the model object 'UI Element'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage#getUIElement() + * @model + * @generated + */ +public interface UIElement extends Element { + /** + * Returns the value of the 'Has Children' attribute. + * + *

+ * If the meaning of the 'Has Children' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Has Children' attribute. + * @see #setHasChildren(boolean) + * @see org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage#getUIElement_HasChildren() + * @model + * @generated + */ + boolean isHasChildren(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.tesla.core.protocol.UIElement#isHasChildren Has Children}' attribute. + * + * + * @param value the new value of the 'Has Children' attribute. + * @see #isHasChildren() + * @generated + */ + void setHasChildren(boolean value); + + /** + * Returns the value of the 'Name' attribute. + * + *

+ * If the meaning of the 'Name' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage#getUIElement_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.tesla.core.protocol.UIElement#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Generation Kind' attribute. + * + *

+ * If the meaning of the 'Generation Kind' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Generation Kind' attribute. + * @see #setGenerationKind(String) + * @see org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage#getUIElement_GenerationKind() + * @model + * @generated + */ + String getGenerationKind(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.tesla.core.protocol.UIElement#getGenerationKind Generation Kind}' attribute. + * + * + * @param value the new value of the 'Generation Kind' attribute. + * @see #getGenerationKind() + * @generated + */ + void setGenerationKind(String value); + +} // UIElement diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/UIHierarchyResponse.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/UIHierarchyResponse.java new file mode 100644 index 000000000..ccbd853ed --- /dev/null +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/UIHierarchyResponse.java @@ -0,0 +1,69 @@ +/** + */ +package org.eclipse.rcptt.tesla.core.protocol; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.rcptt.tesla.core.protocol.raw.Response; + +/** + * + * A representation of the model object 'UI Hierarchy Response'. + * + * + *

+ * The following features are supported: + *

+ * + * + * @see org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage#getUIHierarchyResponse() + * @model + * @generated + */ +public interface UIHierarchyResponse extends Response { + /** + * Returns the value of the 'Children' reference list. + * The list contents are of type {@link org.eclipse.rcptt.tesla.core.protocol.UIElement}. + * + *

+ * If the meaning of the 'Children' reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Children' reference list. + * @see org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage#getUIHierarchyResponse_Children() + * @model + * @generated + */ + EList getChildren(); + + /** + * Returns the value of the 'Ui Element' reference. + * + *

+ * If the meaning of the 'Ui Element' reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Ui Element' reference. + * @see #setUiElement(UIElement) + * @see org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage#getUIHierarchyResponse_UiElement() + * @model + * @generated + */ + UIElement getUiElement(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse#getUiElement Ui Element}' reference. + * + * + * @param value the new value of the 'Ui Element' reference. + * @see #getUiElement() + * @generated + */ + void setUiElement(UIElement value); + +} // UIHierarchyResponse diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/ProtocolFactoryImpl.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/ProtocolFactoryImpl.java index 799984337..cee98eec4 100644 --- a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/ProtocolFactoryImpl.java +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/ProtocolFactoryImpl.java @@ -1,23 +1,17 @@ -/******************************************************************************* - * Copyright (c) 2009, 2016 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.protocol.impl; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; + import org.eclipse.emf.ecore.impl.EFactoryImpl; + import org.eclipse.emf.ecore.plugin.EcorePlugin; + import org.eclipse.rcptt.tesla.core.protocol.*; -import org.eclipse.rcptt.tesla.core.protocol.Shutdown; /** * @@ -170,6 +164,8 @@ public EObject create(EClass eClass) { case ProtocolPackage.UPDATE_CONTROL_COMMAND: return createUpdateControlCommand(); case ProtocolPackage.RAP_DOWNLOAD_FILE: return createRapDownloadFile(); case ProtocolPackage.RAP_UPLOAD_FILE: return createRapUploadFile(); + case ProtocolPackage.UI_HIERARCHY_RESPONSE: return createUIHierarchyResponse(); + case ProtocolPackage.UI_ELEMENT: return createUIElement(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -1287,6 +1283,26 @@ public RapUploadFile createRapUploadFile() { return rapUploadFile; } + /** + * + * + * @generated + */ + public UIHierarchyResponse createUIHierarchyResponse() { + UIHierarchyResponseImpl uiHierarchyResponse = new UIHierarchyResponseImpl(); + return uiHierarchyResponse; + } + + /** + * + * + * @generated + */ + public UIElement createUIElement() { + UIElementImpl uiElement = new UIElementImpl(); + return uiElement; + } + /** * * diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/ProtocolPackageImpl.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/ProtocolPackageImpl.java index 4cb86b7e1..08706da03 100644 --- a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/ProtocolPackageImpl.java +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/ProtocolPackageImpl.java @@ -1,15 +1,16 @@ -/******************************************************************************* - * Copyright (c) 2009, 2016 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.protocol.impl; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + import org.eclipse.rcptt.tesla.core.protocol.ActivateCellEditor; import org.eclipse.rcptt.tesla.core.protocol.ApplyCellEditor; import org.eclipse.rcptt.tesla.core.protocol.Assert; @@ -121,21 +122,14 @@ import org.eclipse.rcptt.tesla.core.protocol.Type; import org.eclipse.rcptt.tesla.core.protocol.TypeAction; import org.eclipse.rcptt.tesla.core.protocol.TypeText; +import org.eclipse.rcptt.tesla.core.protocol.UIElement; +import org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse; import org.eclipse.rcptt.tesla.core.protocol.UpdateControlCommand; import org.eclipse.rcptt.tesla.core.protocol.WaitForRestart; import org.eclipse.rcptt.tesla.core.protocol.WaitForState; import org.eclipse.rcptt.tesla.core.protocol.raw.RawPackage; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - /** * * An implementation of the model Package. @@ -899,6 +893,20 @@ public class ProtocolPackageImpl extends EPackageImpl implements ProtocolPackage */ private EClass rapUploadFileEClass = null; + /** + * + * + * @generated + */ + private EClass uiHierarchyResponseEClass = null; + + /** + * + * + * @generated + */ + private EClass uiElementEClass = null; + /** * * @@ -3467,6 +3475,69 @@ public EAttribute getRapUploadFile_Path() { return (EAttribute)rapUploadFileEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + public EClass getUIHierarchyResponse() { + return uiHierarchyResponseEClass; + } + + /** + * + * + * @generated + */ + public EReference getUIHierarchyResponse_Children() { + return (EReference)uiHierarchyResponseEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getUIHierarchyResponse_UiElement() { + return (EReference)uiHierarchyResponseEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getUIElement() { + return uiElementEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getUIElement_HasChildren() { + return (EAttribute)uiElementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getUIElement_Name() { + return (EAttribute)uiElementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getUIElement_GenerationKind() { + return (EAttribute)uiElementEClass.getEStructuralFeatures().get(2); + } + /** * * @@ -3914,6 +3985,15 @@ public void createPackageContents() { createEAttribute(rapUploadFileEClass, RAP_UPLOAD_FILE__BASE64FILE); createEAttribute(rapUploadFileEClass, RAP_UPLOAD_FILE__PATH); + uiHierarchyResponseEClass = createEClass(UI_HIERARCHY_RESPONSE); + createEReference(uiHierarchyResponseEClass, UI_HIERARCHY_RESPONSE__CHILDREN); + createEReference(uiHierarchyResponseEClass, UI_HIERARCHY_RESPONSE__UI_ELEMENT); + + uiElementEClass = createEClass(UI_ELEMENT); + createEAttribute(uiElementEClass, UI_ELEMENT__HAS_CHILDREN); + createEAttribute(uiElementEClass, UI_ELEMENT__NAME); + createEAttribute(uiElementEClass, UI_ELEMENT__GENERATION_KIND); + // Create enums swtDialogKindEEnum = createEEnum(SWT_DIALOG_KIND); assertKindEEnum = createEEnum(ASSERT_KIND); @@ -4057,6 +4137,8 @@ public void initializePackageContents() { updateControlCommandEClass.getESuperTypes().add(theRawPackage.getCommand()); rapDownloadFileEClass.getESuperTypes().add(theRawPackage.getCommand()); rapUploadFileEClass.getESuperTypes().add(theRawPackage.getCommand()); + uiHierarchyResponseEClass.getESuperTypes().add(theRawPackage.getResponse()); + uiElementEClass.getESuperTypes().add(theRawPackage.getElement()); // Initialize classes and features; add operations and parameters initEClass(selectDataEClass, SelectData.class, "SelectData", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -4442,6 +4524,15 @@ public void initializePackageContents() { initEAttribute(getRapUploadFile_Base64file(), theEcorePackage.getEString(), "base64file", null, 0, 1, RapUploadFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getRapUploadFile_Path(), theEcorePackage.getEString(), "path", null, 0, 1, RapUploadFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(uiHierarchyResponseEClass, UIHierarchyResponse.class, "UIHierarchyResponse", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getUIHierarchyResponse_Children(), this.getUIElement(), null, "children", null, 0, -1, UIHierarchyResponse.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getUIHierarchyResponse_UiElement(), this.getUIElement(), null, "uiElement", null, 0, 1, UIHierarchyResponse.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(uiElementEClass, UIElement.class, "UIElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getUIElement_HasChildren(), theEcorePackage.getEBoolean(), "hasChildren", null, 0, 1, UIElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getUIElement_Name(), theEcorePackage.getEString(), "name", null, 0, 1, UIElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getUIElement_GenerationKind(), theEcorePackage.getEString(), "generationKind", null, 0, 1, UIElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + // Initialize enums and add enum literals initEEnum(swtDialogKindEEnum, SWTDialogKind.class, "SWTDialogKind"); addEEnumLiteral(swtDialogKindEEnum, SWTDialogKind.FILE_SELECTOR); diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/UIElementImpl.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/UIElementImpl.java new file mode 100644 index 000000000..7a59daf70 --- /dev/null +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/UIElementImpl.java @@ -0,0 +1,272 @@ +/** + */ +package org.eclipse.rcptt.tesla.core.protocol.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage; +import org.eclipse.rcptt.tesla.core.protocol.UIElement; + +import org.eclipse.rcptt.tesla.core.protocol.raw.impl.ElementImpl; + +/** + * + * An implementation of the model object 'UI Element'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class UIElementImpl extends ElementImpl implements UIElement { + /** + * The default value of the '{@link #isHasChildren() Has Children}' attribute. + * + * + * @see #isHasChildren() + * @generated + * @ordered + */ + protected static final boolean HAS_CHILDREN_EDEFAULT = false; + + /** + * The cached value of the '{@link #isHasChildren() Has Children}' attribute. + * + * + * @see #isHasChildren() + * @generated + * @ordered + */ + protected boolean hasChildren = HAS_CHILDREN_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getGenerationKind() Generation Kind}' attribute. + * + * + * @see #getGenerationKind() + * @generated + * @ordered + */ + protected static final String GENERATION_KIND_EDEFAULT = null; + + /** + * The cached value of the '{@link #getGenerationKind() Generation Kind}' attribute. + * + * + * @see #getGenerationKind() + * @generated + * @ordered + */ + protected String generationKind = GENERATION_KIND_EDEFAULT; + + /** + * + * + * @generated + */ + protected UIElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ProtocolPackage.Literals.UI_ELEMENT; + } + + /** + * + * + * @generated + */ + public boolean isHasChildren() { + return hasChildren; + } + + /** + * + * + * @generated + */ + public void setHasChildren(boolean newHasChildren) { + boolean oldHasChildren = hasChildren; + hasChildren = newHasChildren; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.UI_ELEMENT__HAS_CHILDREN, oldHasChildren, hasChildren)); + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.UI_ELEMENT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public String getGenerationKind() { + return generationKind; + } + + /** + * + * + * @generated + */ + public void setGenerationKind(String newGenerationKind) { + String oldGenerationKind = generationKind; + generationKind = newGenerationKind; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.UI_ELEMENT__GENERATION_KIND, oldGenerationKind, generationKind)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ProtocolPackage.UI_ELEMENT__HAS_CHILDREN: + return isHasChildren(); + case ProtocolPackage.UI_ELEMENT__NAME: + return getName(); + case ProtocolPackage.UI_ELEMENT__GENERATION_KIND: + return getGenerationKind(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ProtocolPackage.UI_ELEMENT__HAS_CHILDREN: + setHasChildren((Boolean)newValue); + return; + case ProtocolPackage.UI_ELEMENT__NAME: + setName((String)newValue); + return; + case ProtocolPackage.UI_ELEMENT__GENERATION_KIND: + setGenerationKind((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ProtocolPackage.UI_ELEMENT__HAS_CHILDREN: + setHasChildren(HAS_CHILDREN_EDEFAULT); + return; + case ProtocolPackage.UI_ELEMENT__NAME: + setName(NAME_EDEFAULT); + return; + case ProtocolPackage.UI_ELEMENT__GENERATION_KIND: + setGenerationKind(GENERATION_KIND_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ProtocolPackage.UI_ELEMENT__HAS_CHILDREN: + return hasChildren != HAS_CHILDREN_EDEFAULT; + case ProtocolPackage.UI_ELEMENT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case ProtocolPackage.UI_ELEMENT__GENERATION_KIND: + return GENERATION_KIND_EDEFAULT == null ? generationKind != null : !GENERATION_KIND_EDEFAULT.equals(generationKind); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (hasChildren: "); + result.append(hasChildren); + result.append(", name: "); + result.append(name); + result.append(", generationKind: "); + result.append(generationKind); + result.append(')'); + return result.toString(); + } + +} //UIElementImpl diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/UIHierarchyResponseImpl.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/UIHierarchyResponseImpl.java new file mode 100644 index 000000000..c91167d25 --- /dev/null +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/impl/UIHierarchyResponseImpl.java @@ -0,0 +1,199 @@ +/** + */ +package org.eclipse.rcptt.tesla.core.protocol.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +import org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage; +import org.eclipse.rcptt.tesla.core.protocol.UIElement; +import org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse; + +import org.eclipse.rcptt.tesla.core.protocol.raw.impl.ResponseImpl; + +/** + * + * An implementation of the model object 'UI Hierarchy Response'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class UIHierarchyResponseImpl extends ResponseImpl implements UIHierarchyResponse { + /** + * The cached value of the '{@link #getChildren() Children}' reference list. + * + * + * @see #getChildren() + * @generated + * @ordered + */ + protected EList children; + + /** + * The cached value of the '{@link #getUiElement() Ui Element}' reference. + * + * + * @see #getUiElement() + * @generated + * @ordered + */ + protected UIElement uiElement; + + /** + * + * + * @generated + */ + protected UIHierarchyResponseImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ProtocolPackage.Literals.UI_HIERARCHY_RESPONSE; + } + + /** + * + * + * @generated + */ + public EList getChildren() { + if (children == null) { + children = new EObjectResolvingEList(UIElement.class, this, ProtocolPackage.UI_HIERARCHY_RESPONSE__CHILDREN); + } + return children; + } + + /** + * + * + * @generated + */ + public UIElement getUiElement() { + if (uiElement != null && uiElement.eIsProxy()) { + InternalEObject oldUiElement = (InternalEObject)uiElement; + uiElement = (UIElement)eResolveProxy(oldUiElement); + if (uiElement != oldUiElement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProtocolPackage.UI_HIERARCHY_RESPONSE__UI_ELEMENT, oldUiElement, uiElement)); + } + } + return uiElement; + } + + /** + * + * + * @generated + */ + public UIElement basicGetUiElement() { + return uiElement; + } + + /** + * + * + * @generated + */ + public void setUiElement(UIElement newUiElement) { + UIElement oldUiElement = uiElement; + uiElement = newUiElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.UI_HIERARCHY_RESPONSE__UI_ELEMENT, oldUiElement, uiElement)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ProtocolPackage.UI_HIERARCHY_RESPONSE__CHILDREN: + return getChildren(); + case ProtocolPackage.UI_HIERARCHY_RESPONSE__UI_ELEMENT: + if (resolve) return getUiElement(); + return basicGetUiElement(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ProtocolPackage.UI_HIERARCHY_RESPONSE__CHILDREN: + getChildren().clear(); + getChildren().addAll((Collection)newValue); + return; + case ProtocolPackage.UI_HIERARCHY_RESPONSE__UI_ELEMENT: + setUiElement((UIElement)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ProtocolPackage.UI_HIERARCHY_RESPONSE__CHILDREN: + getChildren().clear(); + return; + case ProtocolPackage.UI_HIERARCHY_RESPONSE__UI_ELEMENT: + setUiElement((UIElement)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ProtocolPackage.UI_HIERARCHY_RESPONSE__CHILDREN: + return children != null && !children.isEmpty(); + case ProtocolPackage.UI_HIERARCHY_RESPONSE__UI_ELEMENT: + return uiElement != null; + } + return super.eIsSet(featureID); + } + +} //UIHierarchyResponseImpl diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/util/ProtocolAdapterFactory.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/util/ProtocolAdapterFactory.java index 513730960..a3db644dc 100644 --- a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/util/ProtocolAdapterFactory.java +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/util/ProtocolAdapterFactory.java @@ -1,20 +1,7 @@ -/******************************************************************************* - * Copyright (c) 2009, 2016 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.protocol.util; -import org.eclipse.rcptt.tesla.core.protocol.*; - -import org.eclipse.rcptt.tesla.core.protocol.raw.Command; -import org.eclipse.rcptt.tesla.core.protocol.raw.Response; - import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; @@ -22,6 +9,12 @@ import org.eclipse.emf.ecore.EObject; +import org.eclipse.rcptt.tesla.core.protocol.*; + +import org.eclipse.rcptt.tesla.core.protocol.raw.Command; +import org.eclipse.rcptt.tesla.core.protocol.raw.Element; +import org.eclipse.rcptt.tesla.core.protocol.raw.Response; + /** * * The Adapter Factory for the model. @@ -511,6 +504,14 @@ public Adapter caseRapUploadFile(RapUploadFile object) { return createRapUploadFileAdapter(); } @Override + public Adapter caseUIHierarchyResponse(UIHierarchyResponse object) { + return createUIHierarchyResponseAdapter(); + } + @Override + public Adapter caseUIElement(UIElement object) { + return createUIElementAdapter(); + } + @Override public Adapter caseCommand(Command object) { return createCommandAdapter(); } @@ -519,6 +520,10 @@ public Adapter caseResponse(Response object) { return createResponseAdapter(); } @Override + public Adapter caseElement(Element object) { + return createElementAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); } @@ -2050,6 +2055,34 @@ public Adapter createRapUploadFileAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse UI Hierarchy Response}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse + * @generated + */ + public Adapter createUIHierarchyResponseAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.tesla.core.protocol.UIElement UI Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.rcptt.tesla.core.protocol.UIElement + * @generated + */ + public Adapter createUIElementAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.tesla.core.protocol.raw.Command Command}'. * @@ -2078,6 +2111,20 @@ public Adapter createResponseAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.tesla.core.protocol.raw.Element Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.rcptt.tesla.core.protocol.raw.Element + * @generated + */ + public Adapter createElementAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/util/ProtocolSwitch.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/util/ProtocolSwitch.java index 22901211a..d98baeec5 100644 --- a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/util/ProtocolSwitch.java +++ b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/protocol/util/ProtocolSwitch.java @@ -1,25 +1,18 @@ -/******************************************************************************* - * Copyright (c) 2009, 2016 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.protocol.util; -import org.eclipse.rcptt.tesla.core.protocol.*; - -import org.eclipse.rcptt.tesla.core.protocol.raw.Command; -import org.eclipse.rcptt.tesla.core.protocol.raw.Response; - import java.util.List; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; +import org.eclipse.rcptt.tesla.core.protocol.*; + +import org.eclipse.rcptt.tesla.core.protocol.raw.Command; +import org.eclipse.rcptt.tesla.core.protocol.raw.Element; +import org.eclipse.rcptt.tesla.core.protocol.raw.Response; + /** * * The Switch for the model's inheritance hierarchy. @@ -919,6 +912,20 @@ protected T doSwitch(int classifierID, EObject theEObject) { if (result == null) result = defaultCase(theEObject); return result; } + case ProtocolPackage.UI_HIERARCHY_RESPONSE: { + UIHierarchyResponse uiHierarchyResponse = (UIHierarchyResponse)theEObject; + T result = caseUIHierarchyResponse(uiHierarchyResponse); + if (result == null) result = caseResponse(uiHierarchyResponse); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ProtocolPackage.UI_ELEMENT: { + UIElement uiElement = (UIElement)theEObject; + T result = caseUIElement(uiElement); + if (result == null) result = caseElement(uiElement); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -2543,6 +2550,36 @@ public T caseRapUploadFile(RapUploadFile object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'UI Hierarchy Response'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'UI Hierarchy Response'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUIHierarchyResponse(UIHierarchyResponse object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'UI Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'UI Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUIElement(UIElement object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Command'. * @@ -2573,6 +2610,21 @@ public T caseResponse(Response object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseElement(Element object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/ui/util/UiAdapterFactory.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/ui/util/UiAdapterFactory.java old mode 100644 new mode 100755 diff --git a/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/ui/util/UiSwitch.java b/core/org.eclipse.rcptt.tesla.core/gen-src/org/eclipse/rcptt/tesla/core/ui/util/UiSwitch.java old mode 100644 new mode 100755 diff --git a/core/org.eclipse.rcptt.tesla.core/models/protocol.ecore b/core/org.eclipse.rcptt.tesla.core/models/protocol.ecore old mode 100644 new mode 100755 index cb5f87e3e..45c78efd4 --- a/core/org.eclipse.rcptt.tesla.core/models/protocol.ecore +++ b/core/org.eclipse.rcptt.tesla.core/models/protocol.ecore @@ -444,4 +444,14 @@ + + + + + + + + + diff --git a/core/org.eclipse.rcptt.tesla.core/models/protocol.genmodel b/core/org.eclipse.rcptt.tesla.core/models/protocol.genmodel old mode 100644 new mode 100755 diff --git a/modules/rap/bundles/runtime/org.eclipse.rcptt.runtime.ui.rap/META-INF/MANIFEST.MF b/modules/rap/bundles/runtime/org.eclipse.rcptt.runtime.ui.rap/META-INF/MANIFEST.MF index e45239b8f..163b605cf 100644 --- a/modules/rap/bundles/runtime/org.eclipse.rcptt.runtime.ui.rap/META-INF/MANIFEST.MF +++ b/modules/rap/bundles/runtime/org.eclipse.rcptt.runtime.ui.rap/META-INF/MANIFEST.MF @@ -24,7 +24,8 @@ Require-Bundle: org.eclipse.rap.ui, org.eclipse.rcptt.ecl.client.tcp;bundle-version="[2.2.0,3.0.0)", org.eclipse.rcptt.tesla.ui.ide.aspects.rap;bundle-version="[2.2.0,3.0.0)", org.eclipse.rcptt.core.launching;bundle-version="[2.2.0,3.0.0)", - org.eclipse.rcptt.util.swt.rap;bundle-version="[2.2.0,3.0.0)" + org.eclipse.rcptt.util.swt.rap;bundle-version="[2.2.0,3.0.0)", + org.eclipse.rcptt.tesla.recording.aspects.swt.rap Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.rcptt.internal.runtime.ui.rap, diff --git a/modules/rap/bundles/runtime/org.eclipse.rcptt.runtime.ui.rap/plugin.xml b/modules/rap/bundles/runtime/org.eclipse.rcptt.runtime.ui.rap/plugin.xml index 3c78db0f0..6090875c6 100644 --- a/modules/rap/bundles/runtime/org.eclipse.rcptt.runtime.ui.rap/plugin.xml +++ b/modules/rap/bundles/runtime/org.eclipse.rcptt.runtime.ui.rap/plugin.xml @@ -64,6 +64,11 @@ name="TerminateAut" namespace="http://eclipse.org/rcptt/core/ecl"> + + getParentsList(Display display, SWTUIElement swtuiElement) { + Map references = EclipseWorkbenchProvider.getProvider() + .getWorkbenchReference(SWTUIPlayer.getPlayer(display)); + List parents = SWTUIPlayer.getPlayer(display).collectParents(unwrapWidget(swtuiElement), references); + List elements = new ArrayList(); + for (Widget widget : parents) { + SWTUIElement e = null; + if (references.containsKey(widget)) { + e = references.get(widget); + } else { + e = SWTUIPlayer.getPlayer(display).wrap(widget); + } + if (e != null) { + if (!isGoodKind(e.getKind())) { + continue; + } + if (SWTUIPlayer.getPlayer(display).isVisible(e)) { + elements.add(e); + } + } + } + return elements; + } + + public static SWTUIElement getSWTUIParent(Display display, SWTUIElement uiElement) { + List parentsList = getParentsList(display, uiElement); + if (parentsList.size() > 0) { + return parentsList.get(0); + } + return null; + } + + public static boolean isGoodKind(GenericElementKind kind) { + if (kind.is(ElementKind.Unknown) || kind.is(ElementKind.Editor) || kind.is(ElementKind.View)) { + return false; + } + return true; + } +} diff --git a/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt.rap/src/org/eclipse/rcptt/tesla/recording/aspects/swt/rap/IAssertSWTEventListener.java b/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt.rap/src/org/eclipse/rcptt/tesla/recording/aspects/swt/rap/IAssertSWTEventListener.java index 683744f45..8007297c7 100644 --- a/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt.rap/src/org/eclipse/rcptt/tesla/recording/aspects/swt/rap/IAssertSWTEventListener.java +++ b/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt.rap/src/org/eclipse/rcptt/tesla/recording/aspects/swt/rap/IAssertSWTEventListener.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.rcptt.tesla.recording.aspects.swt.rap; +import org.eclipse.rcptt.tesla.core.protocol.raw.Element; +import org.eclipse.rcptt.tesla.internal.ui.player.SWTUIElement; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Widget; @@ -19,4 +21,12 @@ public interface IAssertSWTEventListener extends IAbstractSWTEventListener { public boolean handleEventInFreeze(Widget widget, int type, Event event); public void handleUpdateHover(Control control); + public boolean highlightWidget(Widget widget); + + public boolean updateAssertionPanelWindow(Widget widget); + + public SWTUIElement getSWTUIElement(Element element); + + public Element getElement(SWTUIElement swtUIElement); + } diff --git a/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt.rap/src/org/eclipse/rcptt/tesla/recording/aspects/swt/rap/SWTEventManager.java b/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt.rap/src/org/eclipse/rcptt/tesla/recording/aspects/swt/rap/SWTEventManager.java index b6a5a4394..975b37826 100644 --- a/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt.rap/src/org/eclipse/rcptt/tesla/recording/aspects/swt/rap/SWTEventManager.java +++ b/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt.rap/src/org/eclipse/rcptt/tesla/recording/aspects/swt/rap/SWTEventManager.java @@ -21,7 +21,8 @@ import org.eclipse.rap.rwt.RWT; import org.eclipse.rap.rwt.client.service.JavaScriptExecutor; -import org.eclipse.rcptt.tesla.swt.js.JavaScriptExecutionManager; +import org.eclipse.rcptt.tesla.core.protocol.raw.Element; +import org.eclipse.rcptt.tesla.internal.ui.player.SWTUIElement; import org.eclipse.rcptt.tesla.ui.RWTUtils; import org.eclipse.swt.custom.CCombo; import org.eclipse.swt.widgets.Control; @@ -198,6 +199,42 @@ public static boolean handleEventInFreeze(Widget widget, int type, Event event) return finalResult; } + public static boolean highlightWidget(Widget widget) { + boolean finalResult = false; + for (IAssertSWTEventListener listener : getListeners(IAssertSWTEventListener.class)) { + finalResult = finalResult || listener.highlightWidget(widget); + } + return finalResult; + } + + public static boolean updateAssertionPanelWindow(Widget widget) { + boolean finalResult = false; + for (IAssertSWTEventListener listener : getListeners(IAssertSWTEventListener.class)) { + finalResult = finalResult || listener.updateAssertionPanelWindow(widget); + } + return finalResult; + } + + public static SWTUIElement getSWTUIElement(Element element) { + for (IAssertSWTEventListener listener : getListeners(IAssertSWTEventListener.class)) { + SWTUIElement result = listener.getSWTUIElement(element); + if (null != result) { + return result; + } + } + return null; + } + + public static Element getElement(SWTUIElement swtUIElement) { + for (IAssertSWTEventListener listener : getListeners(IAssertSWTEventListener.class)) { + Element result = listener.getElement(swtUIElement); + if (null != result) { + return result; + } + } + return null; + } + public static void handleUpdateHover(Control widget) { for (IAssertSWTEventListener listener : getListeners(IAssertSWTEventListener.class)) { listener.handleUpdateHover(widget); diff --git a/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.swt.rap/src/org/eclipse/rcptt/tesla/recording/core/swt/rap/SWTAssertManager.java b/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.swt.rap/src/org/eclipse/rcptt/tesla/recording/core/swt/rap/SWTAssertManager.java index 61f6f8578..fcc1bcf5d 100644 --- a/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.swt.rap/src/org/eclipse/rcptt/tesla/recording/core/swt/rap/SWTAssertManager.java +++ b/modules/rap/bundles/runtime/tesla/org.eclipse.rcptt.tesla.recording.swt.rap/src/org/eclipse/rcptt/tesla/recording/core/swt/rap/SWTAssertManager.java @@ -36,8 +36,9 @@ import org.eclipse.rcptt.tesla.core.protocol.raw.Element; import org.eclipse.rcptt.tesla.core.protocol.raw.RawFactory; import org.eclipse.rcptt.tesla.core.protocol.raw.SetMode; -import org.eclipse.rcptt.tesla.core.ui.Item; import org.eclipse.rcptt.tesla.internal.core.TeslaCore; +import org.eclipse.rcptt.tesla.internal.ui.player.FindResult; +import org.eclipse.rcptt.tesla.internal.ui.player.SWTUIElement; import org.eclipse.rcptt.tesla.internal.ui.player.SWTUIPlayer; import org.eclipse.rcptt.tesla.internal.ui.processors.SWTUIProcessor; import org.eclipse.rcptt.tesla.recording.aspects.swt.rap.IAssertSWTEventListener; @@ -51,9 +52,10 @@ import org.eclipse.rcptt.tesla.swt.events.RcpttMouseEvents; import org.eclipse.rcptt.tesla.swt.events.TeslaEventManager; import org.eclipse.rcptt.tesla.ui.RWTUtils; +import org.eclipse.rcptt.tesla.ui.describers.DescriberManager; +import org.eclipse.rcptt.tesla.ui.describers.IWidgetDescriber; import org.eclipse.rcptt.util.ShellUtilsProvider; import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; import org.eclipse.swt.events.PaintEvent; @@ -64,7 +66,6 @@ import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -469,6 +470,52 @@ public void run() { } } + public synchronized boolean highlightWidget(final Widget widget) { + if (widget == null || widget.isDisposed()) { + return false; + } + resetAssertSelection(); + + widget.getDisplay().asyncExec(new Runnable() { + public void run() { + synchronized (widget) { + IWidgetDescriber descr = DescriberManager.getDescriber(widget, 0, 0); + if (null == descr.getBounds()) { + return; + } + updateHover(descr.getBounds(), descr.getPoint(), true, true); + } + } + }); + return true; + } + + public synchronized SWTUIElement getSWTUIElement(Element element) { + SWTUIElement swtUIElement = SWTRecordingHelper.getHelper().findByElement(element); + return swtUIElement; + } + + public synchronized Element getElement(SWTUIElement swtUIElement) { + FindResult result = null; + result = SWTRecordingHelper.getHelper().getLocator().findElement(swtUIElement, true, false, true); + if (result != null) { + return result.element; + } + return null; + } + + public synchronized boolean updateAssertionPanelWindow(Widget widget) { + if (widget == null || widget.isDisposed()) { + return false; + } + + IRecordingDescriber assertDescr = selectAllowedParent(new RecordingWidgetDescriber(widget)); + seachForElement(assertDescr.searchForElement(recorder), true, assertDescr); + freezedCtrl = assertDescr; + + return true; + } + private void assertionLog(String message) { if (TeslaFeatures.isActivityLogging()) { Q7LoggingManager.logMessage(IQ7ActivityLogs.ASSERTIONS, message); diff --git a/rcp/org.eclipse.rcptt.ui/icons/panel/tree.gif b/rcp/org.eclipse.rcptt.ui/icons/panel/tree.gif new file mode 100644 index 000000000..bac72b539 Binary files /dev/null and b/rcp/org.eclipse.rcptt.ui/icons/panel/tree.gif differ diff --git a/rcp/org.eclipse.rcptt.ui/plugin.xml b/rcp/org.eclipse.rcptt.ui/plugin.xml index f56bd840a..ac21d85ee 100644 --- a/rcp/org.eclipse.rcptt.ui/plugin.xml +++ b/rcp/org.eclipse.rcptt.ui/plugin.xml @@ -1130,4 +1130,14 @@ + + + + + + + diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/Images.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/Images.java index fcc2bddce..f88f411a3 100644 --- a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/Images.java +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/Images.java @@ -88,6 +88,7 @@ public class Images { public static final String PANEL_DESELECT_ALL_DISABLED = PREFIX + "panel/d-deselectall.gif"; //$NON-NLS-1$ public static final String PANEL_FILTER = PREFIX + "panel/filter.gif"; //$NON-NLS-1$ + public static final String TREE_VISIBLE = PREFIX + "panel/tree.gif"; //$NON-NLS-1$ // // Preferences diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/Messages.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/Messages.java old mode 100644 new mode 100755 index 84ee12981..91c025e69 --- a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/Messages.java +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/Messages.java @@ -27,9 +27,12 @@ public class Messages extends NLS { public static String AssertImageWindow_TextLabel; public static String AssertImageWindow_Tilte; public static String AssertImageWindow_TypeLabel; + public static String ControlHierarchyView_NameColumnText; + public static String ControlHierarchyView_NameColumnToolTip; public static String AssertionPanelWindow_AddAssertButton; public static String AssertionPanelWindow_AssertImageButton; public static String AssertionPanelWindow_CloseActionName; + public static String AssertionPanelWindow_TreeVisibleToolTip; public static String AssertionPanelWindow_CollapseAllActionToolTip; public static String AssertionPanelWindow_ColumnOperationName; public static String AssertionPanelWindow_ColumnOperationToolTip; diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/messages.properties b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/messages.properties old mode 100644 new mode 100755 index e7eb7a319..975cd2834 --- a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/messages.properties +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/internal/ui/messages.properties @@ -21,6 +21,8 @@ AssertImageWindow_SelectionLabel=Selection: AssertImageWindow_TextLabel=Text: AssertImageWindow_Tilte=Add Image Assertion AssertImageWindow_TypeLabel=Type: +ControlHierarchyView_NameColumnText=Controls hierarchy +ControlHierarchyView_NameColumnToolTip=AUT controls hierarchy AssertionPanelWindow_AddAssertButton=Add AssertionPanelWindow_AssertImageButton=Assert Image AssertionPanelWindow_CloseActionName=Close @@ -28,6 +30,7 @@ AssertionPanelWindow_CollapseAllActionToolTip=Collapse All AssertionPanelWindow_ColumnOperationName=Operation AssertionPanelWindow_ColumnOperationToolTip=Assertion operation AssertionPanelWindow_ColumnPropertyName=Property +AssertionPanelWindow_TreeVisibleToolTip=Show/hide control hierarchy AssertionPanelWindow_ColumnPropertyToolTip=Control property to assert AssertionPanelWindow_DeselectAllActionToolTip=Deselect All AssertionPanelWindow_ExpandAllActionToolTip=Expand All diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/AssertionPanelWindow.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/AssertionPanelWindow.java index b2c6303ad..38ff5f7d7 100644 --- a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/AssertionPanelWindow.java +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/AssertionPanelWindow.java @@ -122,6 +122,28 @@ public class AssertionPanelWindow extends Dialog { private final ImageManager imageManager = new ImageManager(); private final WritableValue hasAssert = new WritableValue(false, Boolean.class); + private final RecordingSupport recordingSupport; + private final Shell parentShell; + + private WidgetDetailsDialog widgetDetailsDialog; + private CommandSet commands; + private AssertInput currentInput; + private IObservableSet checkedObservable; + private Button appendButton; + private List collapsed; + private List references; + private CCombo filterCombo; + private Text filterText; + private String filterValue = ""; + + private CheckboxTreeViewer viewer; + private FontMetrics fontMetrics; + + private Composite treeViewerComposite; + private Composite autControlsWidgetComposite; + private GridData autControlsWidgetCompositeGridData; + private ControlHierarchyView autControlsView; + private final IAction collapseAll = new Action() { { setImageDescriptor(Images.getImageDescriptor(Images.PANEL_COLLAPSE_ALL)); @@ -175,19 +197,19 @@ public void run() { }; }; - private final RecordingSupport recordingSupport; - private final Shell parentShell; + private final IAction treeVisible = new Action() { + { + setImageDescriptor(Images.getImageDescriptor(Images.TREE_VISIBLE)); + setToolTipText(Messages.AssertionPanelWindow_TreeVisibleToolTip); + } - private WidgetDetailsDialog widgetDetailsDialog; - private CommandSet commands; - private AssertInput currentInput; - private IObservableSet checkedObservable; - private Button appendButton; - private List collapsed; - private List references; - private CCombo filterCombo; - private Text filterText; - private String filterValue = ""; + @Override + public void run() { + autControlsWidgetComposite.setVisible(autControlsWidgetCompositeGridData.exclude); + autControlsWidgetCompositeGridData.exclude = !autControlsWidgetCompositeGridData.exclude; + autControlsWidgetComposite.getParent().layout(true, true); + }; + }; public AssertionPanelWindow(RecordingSupport recordingSupport, Shell parentShell) { super(parentShell); @@ -325,10 +347,6 @@ protected Point getInitialSize() { } } - private CheckboxTreeViewer viewer; - - private FontMetrics fontMetrics; - protected TreeViewerColumn createPropertyColumn() { final TreeViewerColumn column = new TreeViewerColumn(viewer, SWT.NONE); column.getColumn().setText(Messages.AssertionPanelWindow_ColumnPropertyName); @@ -461,13 +479,29 @@ protected void processCheck(Object element, boolean checked) { @Override protected Control createContents(Composite parent) { initializeDialogUnits(parent); + final Composite composite = new Composite(parent, SWT.NONE); - composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - composite.setLayout(new GridLayout()); + GridLayoutFactory.fillDefaults().numColumns(2).applyTo(composite); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(composite); + + autControlsWidgetComposite = new Composite(composite, SWT.NONE); + GridLayoutFactory.fillDefaults().numColumns(2).applyTo(autControlsWidgetComposite); + + autControlsWidgetCompositeGridData = new GridData(SWT.FILL, SWT.FILL, true, true); + autControlsWidgetCompositeGridData.exclude = true; + autControlsWidgetComposite.setLayoutData(autControlsWidgetCompositeGridData); + autControlsWidgetComposite.setVisible(false); - final Composite toolbarComposite = new Composite(composite, SWT.NONE); + autControlsView = new ControlHierarchyView(recordingSupport.getAUT()); + autControlsView.createPartControl(autControlsWidgetComposite); + + final Composite assertionComposite = new Composite(composite, SWT.NONE); + GridLayoutFactory.fillDefaults().applyTo(assertionComposite); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(assertionComposite); + + final Composite toolbarComposite = new Composite(assertionComposite, SWT.NONE); GridLayoutFactory.fillDefaults().numColumns(2).applyTo(toolbarComposite); - toolbarComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(toolbarComposite); final ActionToolbar actions = new ActionToolbar() { @Override @@ -477,12 +511,8 @@ protected void fill(ToolBarManager manager) { manager.add(new Separator()); manager.add(expandAll); manager.add(collapseAll); - // if - // ("true".equalsIgnoreCase(Q7Features.getInstance().getValue( - // Q7Features.Q7_IMAGE_ASSERT_SUPPORT))) { - // manager.add(new Separator()); - // manager.add(newImageAssert); - // } + manager.add(new Separator()); + manager.add(treeVisible); dbc.bindValue(Actions.observeEnabled(selectAll), hasAssert); dbc.bindValue(Actions.observeEnabled(deselectAll), hasAssert); @@ -490,7 +520,9 @@ protected void fill(ToolBarManager manager) { dbc.bindValue(Actions.observeEnabled(collapseAll), hasAssert); } }; - actions.create(toolbarComposite).setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false) + .applyTo(actions.create(toolbarComposite)); final MenuToolbar menu = new MenuToolbar() { @Override @@ -503,11 +535,15 @@ public void run() { }); }; }; - menu.create(toolbarComposite).setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false)); + GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).grab(true, false) + .applyTo(menu.create(toolbarComposite)); + + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true) + .applyTo(createTreeViewer(assertionComposite)); - createTreeViewer(composite).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false) + .applyTo(createButtonPanel(assertionComposite)); - createButtonPanel(composite).setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); return composite; } @@ -525,7 +561,7 @@ protected Composite createFilterComposite(Composite parent) { filterComposite.setLayout(filteredCompositeLayout); filterCombo = new CCombo(filterComposite, SWT.READ_ONLY); - filterCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(filterCombo); filterCombo.setItems(new String[] { Messages.AssertionPanelWindow_FilterByProperty, Messages.AssertionPanelWindow_FilterByValue }); filterCombo.select(1); @@ -542,7 +578,7 @@ public void widgetDefaultSelected(SelectionEvent e) { }); filterText = new Text(filterComposite, SWT.SINGLE); - filterText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(filterText); filterText.setMessage(Messages.AssertionPanelWindow_FilterMessage); filterText.addKeyListener(new KeyListener() { @Override @@ -585,8 +621,6 @@ private interface ITreeViewerFilter { public boolean isVisible(AssertImpl object); } - Composite treeViewerComposite = null; - protected Control createTreeViewer(Composite parent) { treeViewerComposite = new Composite(parent, SWT.NONE); treeViewerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); @@ -741,8 +775,6 @@ public void widgetSelected(SelectionEvent e) { } }); - // createVerificationsButton(composite); - appendButton = new Button(composite, SWT.NONE); GridDataFactory.swtDefaults().align(SWT.RIGHT, SWT.CENTER).grab(true, false).hint(120, SWT.DEFAULT) @@ -988,11 +1020,11 @@ public void setInput(CommandSet commands) { setBlockOnOpen(false); open(); } else { - Point size = getShell().getSize(); - Point loc = getInitialLocation(size); - getShell().setLocation(loc); getShell().setVisible(true); } + + autControlsView.expandToElement(commands.getElement()); + currentInput = createAssertTree(commands); viewer.setInput(currentInput); if (currentInput != null && currentInput.getAsserts() != null && currentInput.getAsserts().size() > 0) { @@ -1000,7 +1032,6 @@ public void setInput(CommandSet commands) { } else { viewer.expandToLevel(1); } - // updateVerificationButton(); } else if (getShell() != null && !getShell().isDisposed()) { getShell().setVisible(false); viewer.setInput(AssertInput.EMPTY); diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/ControlHierarchyView.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/ControlHierarchyView.java new file mode 100644 index 000000000..5de248843 --- /dev/null +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/ControlHierarchyView.java @@ -0,0 +1,275 @@ +/******************************************************************************* + * Copyright (c) 2009, 2016 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.ui.panels.assertion; + +import java.util.Iterator; +import java.util.Objects; +import java.util.Stack; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.eclipse.core.runtime.jobs.IJobChangeEvent; +import org.eclipse.core.runtime.jobs.IJobChangeListener; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.TreeColumnLayout; +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.DoubleClickEvent; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.IElementComparer; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TreeViewerColumn; +import org.eclipse.rcptt.internal.ui.Messages; +import org.eclipse.rcptt.launching.AutLaunch; +import org.eclipse.rcptt.tesla.core.protocol.ProtocolFactory; +import org.eclipse.rcptt.tesla.core.protocol.UIElement; +import org.eclipse.rcptt.tesla.core.protocol.raw.Element; +import org.eclipse.rcptt.ui.panels.assertion.tree.AssertionTreeContentProvider; +import org.eclipse.rcptt.ui.panels.assertion.tree.AssertionTreeLabelProvider; +import org.eclipse.rcptt.ui.panels.assertion.tree.AssertionTreeModel; +import org.eclipse.rcptt.ui.panels.assertion.tree.AssertionTreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Tree; + +public class ControlHierarchyView { + + /** + * The ID of the view as specified by the extension. + */ + public static final String ID = "org.eclipse.rcptt.ui.panels.assertion.ControlHierarchyView"; //$NON-NLS-1$ + + private final AutLaunch aut; + + private AssertionTreeViewer viewer; + + private boolean isUpdated = false; + + private AssertionTreeContentProvider contentProvider; + + private Stack parentsStack; + + private IJobChangeListener listener; + + private AtomicBoolean canExpanding = new AtomicBoolean(false); + + public ControlHierarchyView(AutLaunch aut) { + this.aut = aut; + } + + public void createPartControl(Composite parent) { + + final Composite treeComposite = new Composite(parent, SWT.NONE); + final TreeColumnLayout layout = new TreeColumnLayout(); + treeComposite.setLayout(layout); + GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(treeComposite); + + final Tree tree = new Tree(treeComposite, SWT.BORDER | SWT.FULL_SELECTION); + tree.setHeaderVisible(true); + + viewer = new AssertionTreeViewer(tree); + + viewer.setComparer(new IElementComparer() { + @Override + public int hashCode(Object element) { + if (element instanceof AssertionTreeModel) { + AssertionTreeModel model = (AssertionTreeModel) element; + return model.getUIElement().getId().hashCode(); + } + return element.hashCode(); + } + + @Override + public boolean equals(Object object1, Object object2) { + if (object1 instanceof AssertionTreeModel && object2 instanceof AssertionTreeModel) { + AssertionTreeModel model1 = (AssertionTreeModel) object1; + AssertionTreeModel model2 = (AssertionTreeModel) object2; + if (model1.getUIElement() == null || model2.getUIElement() == null) { + return model1.getUIElement() == model2.getUIElement(); + } + if (model1.getUIElement().getId() == null || model2.getUIElement().getId() == null) { + return model1.getUIElement().getId() == model2.getUIElement().getId(); + } + return model1.getUIElement().getId().equals(model2.getUIElement().getId()); + } + return Objects.equals(object1, object2); + } + }); + + layout.setColumnData(createNameColumn().getColumn(), new ColumnWeightData(10)); + + contentProvider = new AssertionTreeContentProvider(); + + viewer.setContentProvider(contentProvider); + viewer.setLabelProvider(new AssertionTreeLabelProvider()); + + viewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + if (event.getSelection() instanceof IStructuredSelection) { + IStructuredSelection selection = (IStructuredSelection) event.getSelection(); + for (Iterator iterator = selection.iterator(); iterator.hasNext();) { + + Object object = iterator.next(); + + if (object instanceof AssertionTreeModel) { + AssertionTreeModel model = (AssertionTreeModel) object; + + UIHierarchyResponseUtilities.highlightWidget(getAut(), model.getUIElement()); + UIHierarchyResponseUtilities.updateAssertionPanelWindow(getAut(), model.getUIElement()); + + isUpdated = true; + } + } + } + } + }); + + viewer.addDoubleClickListener(new IDoubleClickListener() { + public void doubleClick(DoubleClickEvent event) { + if (event.getSelection() instanceof IStructuredSelection) { + IStructuredSelection selection = (IStructuredSelection) event.getSelection(); + for (Iterator iterator = selection.iterator(); iterator.hasNext();) { + + Object object = iterator.next(); + + if (object instanceof AssertionTreeModel) { + AssertionTreeModel model = (AssertionTreeModel) object; + viewer.setExpandedState(model, !viewer.getExpandedState(model)); + } + } + } + } + }); + + AssertionTreeModel input = new AssertionTreeModel(aut, + UIHierarchyResponseUtilities.getUIHierarchyElement(aut, null).getUiElement()); + viewer.setInput(input); + + listener = new IJobChangeListener() { + @Override + public void aboutToRun(IJobChangeEvent event) { + } + + @Override + public void awake(IJobChangeEvent event) { + } + + @Override + public void done(IJobChangeEvent event) { + if (!canExpanding.get()) { + canExpanding.set(true); + } + if (null != parentsStack && !parentsStack.isEmpty()) { + expand(parentsStack.pop()); + } + } + + @Override + public void running(IJobChangeEvent event) { + } + + @Override + public void scheduled(IJobChangeEvent event) { + } + + @Override + public void sleeping(IJobChangeEvent event) { + } + }; + contentProvider.addUpdateCompleteListener(listener); + + } + + protected TreeViewerColumn createNameColumn() { + final TreeViewerColumn column = new TreeViewerColumn(viewer, SWT.NONE); + column.getColumn().setText(Messages.ControlHierarchyView_NameColumnText); + column.getColumn().setToolTipText(Messages.ControlHierarchyView_NameColumnToolTip); + column.setLabelProvider(new ColumnLabelProvider() { + @Override + public String getText(Object object) { + if (object instanceof UIElement) { + UIElement uiElement = (UIElement) object; + return UIHierarchyResponseUtilities.getUIElementCaption(uiElement); + } + return null; + } + }); + return column; + } + + public void setFocus() { + viewer.getControl().setFocus(); + } + + public AutLaunch getAut() { + return this.aut; + } + + public void expandToElement(Element element) { + if (isUpdated) { + isUpdated = false; + return; + } + + UIElement uiElement = ProtocolFactory.eINSTANCE.createUIElement(); + + uiElement.setId(element.getId()); + uiElement.setKind(element.getKind()); + + uiElement = UIHierarchyResponseUtilities.getUIHierarchyElement(aut, uiElement).getUiElement(); + + AssertionTreeModel model = new AssertionTreeModel(getAut(), uiElement); + + parentsStack = new Stack(); + parentsStack.push(model); + setParentsForExpand(model, parentsStack); + + if (canExpanding.get()) { + expand(parentsStack.pop()); + } + } + + private void expand(AssertionTreeModel model) { + if (parentsStack.empty()) { + viewer.setSelection(new StructuredSelection(model), true); + } else { + viewer.setExpandedState(model, true); + } + } + + private void setParentsForExpand(AssertionTreeModel model, Stack parents) { + if (null == model || null == model.getUIElement()) { + return; + } + + AssertionTreeModel parent = (AssertionTreeModel) model.getParent(); + if (null == parent || null == parent.getUIElement()) { + return; + } + + if (!viewer.isItemExists(parent)) { + parents.push(parent); + setParentsForExpand(parent, parents); + return; + } + + if (!viewer.isItemExists(model)) { + parents.push(parent); + setParentsForExpand(parent, parents); + } + + if (!viewer.getExpandedState(parent)) { + viewer.setExpandedState(parent, true); + } + } +} \ No newline at end of file diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/UIHierarchyResponseUtilities.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/UIHierarchyResponseUtilities.java new file mode 100644 index 000000000..9646981e6 --- /dev/null +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/UIHierarchyResponseUtilities.java @@ -0,0 +1,102 @@ +package org.eclipse.rcptt.ui.panels.assertion; + +import org.eclipse.rcptt.core.ecl.core.model.ControlHierarchyState; +import org.eclipse.rcptt.core.ecl.core.model.GetControlHierarchy; +import org.eclipse.rcptt.core.ecl.core.model.Q7CoreFactory; +import org.eclipse.rcptt.internal.ui.Q7UIPlugin; +import org.eclipse.rcptt.launching.AutLaunch; +import org.eclipse.rcptt.tesla.core.protocol.UIElement; +import org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse; + +public class UIHierarchyResponseUtilities { + + public static UIHierarchyResponse getUIHierarchyElement(AutLaunch aut, UIElement uiElement) { + + GetControlHierarchy assertionAUTControlsHierarchy = Q7CoreFactory.eINSTANCE + .createGetControlHierarchy(); + + if (null != uiElement) { + setAUTControlsHierarchyCommandByUIElement(assertionAUTControlsHierarchy, uiElement); + } + + assertionAUTControlsHierarchy.setState(ControlHierarchyState.GET_ELEMENT); + + try { + Object childAUTObject = aut.execute(assertionAUTControlsHierarchy); + if (childAUTObject instanceof UIHierarchyResponse) { + return (UIHierarchyResponse) childAUTObject; + } + } catch (Exception e) { + Q7UIPlugin.log(e); + } + return null; + } + + public static UIHierarchyResponse getUIHierarchyParent(AutLaunch aut, UIElement uiElement) { + + GetControlHierarchy assertionAUTControlsHierarchy = Q7CoreFactory.eINSTANCE + .createGetControlHierarchy(); + + if (null != uiElement) { + setAUTControlsHierarchyCommandByUIElement(assertionAUTControlsHierarchy, uiElement); + } + + assertionAUTControlsHierarchy.setState(ControlHierarchyState.GET_PARENT); + + try { + Object childAUTObject = aut.execute(assertionAUTControlsHierarchy); + if (childAUTObject instanceof UIHierarchyResponse) { + return (UIHierarchyResponse) childAUTObject; + } + } catch (Exception e) { + Q7UIPlugin.log(e); + } + return null; + } + + public static String getUIElementCaption(UIElement uiElement) { + if (null == uiElement.getName()) { + return uiElement.getKind() + " (" + uiElement.getDescription() + ")"; //$NON-NLS-1$ $NON-NLS-2$ + } + return uiElement.getKind() + " : " + uiElement.getName() + //$NON-NLS-1$ + " (" + uiElement.getDescription() + ")"; //$NON-NLS-1$ $NON-NLS-2$ + } + + public static void highlightWidget(AutLaunch aut, UIElement uiElement) { + + GetControlHierarchy assertionAUTControlsHierarchy = Q7CoreFactory.eINSTANCE + .createGetControlHierarchy(); + + assertionAUTControlsHierarchy.setState(ControlHierarchyState.HIGHLIGHT_WIDGET); + setAUTControlsHierarchyCommandByUIElement(assertionAUTControlsHierarchy, uiElement); + + try { + aut.execute(assertionAUTControlsHierarchy); + } catch (Exception e) { + Q7UIPlugin.log(e); + } + } + + public static void updateAssertionPanelWindow(AutLaunch aut, UIElement uiElement) { + + GetControlHierarchy assertionAUTControlsHierarchy = Q7CoreFactory.eINSTANCE + .createGetControlHierarchy(); + + assertionAUTControlsHierarchy.setState(ControlHierarchyState.UPDATE_ASSERT_WINDOW); + setAUTControlsHierarchyCommandByUIElement(assertionAUTControlsHierarchy, uiElement); + + try { + aut.execute(assertionAUTControlsHierarchy); + } catch (Exception e) { + Q7UIPlugin.log(e); + } + } + + public static void setAUTControlsHierarchyCommandByUIElement( + GetControlHierarchy autControlsHierarchyCommand, UIElement uiElement) { + + autControlsHierarchyCommand.setId(uiElement.getId()); + autControlsHierarchyCommand.setKind(uiElement.getKind()); + autControlsHierarchyCommand.setDescription(uiElement.getDescription()); + } +} diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeContentProvider.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeContentProvider.java new file mode 100644 index 000000000..06ba8de4e --- /dev/null +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeContentProvider.java @@ -0,0 +1,64 @@ +package org.eclipse.rcptt.ui.panels.assertion.tree; + +import org.eclipse.core.runtime.jobs.IJobChangeListener; +import org.eclipse.jface.viewers.AbstractTreeViewer; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.ui.progress.DeferredTreeContentManager; + +public class AssertionTreeContentProvider implements ITreeContentProvider { + + private DeferredTreeContentManager manager = null; + + private Object input = null; + + public AssertionTreeContentProvider() { + } + + public void addUpdateCompleteListener(IJobChangeListener listener) { + manager.addUpdateCompleteListener(listener); + } + + @Override + public void dispose() { + + } + + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + input = newInput; + manager = new DeferredTreeContentManager((AbstractTreeViewer) viewer); + } + + @Override + public Object[] getElements(Object object) { + return getChildren(object); + } + + @Override + public Object[] getChildren(Object object) { + return manager.getChildren(object); + } + + @Override + public Object getParent(Object object) { + if (object instanceof AssertionTreeModel) { + return input; + } + + AssertionTreeModel model = (AssertionTreeModel) object; + if (null == model || null == model.getUIElement()) { + return input; + } + AssertionTreeModel parent = (AssertionTreeModel) model.getParent(); + if (null == parent || null == parent.getUIElement()) { + return input; + } + return parent; + } + + @Override + public boolean hasChildren(Object object) { + return manager.mayHaveChildren(object); + } +} \ No newline at end of file diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeDefferedAdapter.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeDefferedAdapter.java new file mode 100644 index 000000000..c10faa1a9 --- /dev/null +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeDefferedAdapter.java @@ -0,0 +1,20 @@ +package org.eclipse.rcptt.ui.panels.assertion.tree; + +import org.eclipse.core.runtime.IAdapterFactory; + +public class AssertionTreeDefferedAdapter implements IAdapterFactory { + + @Override + public Object getAdapter(Object adaptableObject, Class adapterType) { + if (adaptableObject instanceof AssertionTreeModel) { + return new AssertionTreeDefferedModel((AssertionTreeModel) adaptableObject); + } + return null; + } + + @Override + public Class[] getAdapterList() { + return new Class[] { AssertionTreeModel.class }; + } + +} diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeDefferedModel.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeDefferedModel.java new file mode 100644 index 000000000..d99e05f28 --- /dev/null +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeDefferedModel.java @@ -0,0 +1,61 @@ +package org.eclipse.rcptt.ui.panels.assertion.tree; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.jobs.ISchedulingRule; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.progress.IDeferredWorkbenchAdapter; +import org.eclipse.ui.progress.IElementCollector; + +public class AssertionTreeDefferedModel implements IDeferredWorkbenchAdapter { + + private final AssertionTreeModel model; + private Object[] cache; + + public AssertionTreeDefferedModel(AssertionTreeModel model) { + this.model = model; + } + + @Override + public Object[] getChildren(Object object) { + return getCheckedChildren(); + } + + @Override + public ImageDescriptor getImageDescriptor(Object object) { + return null; + } + + @Override + public String getLabel(Object object) { + return model.getLabel(); + } + + @Override + public Object getParent(Object object) { + return model.getParent(); + } + + @Override + public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) { + Object[] children = getChildren(object); + collector.add(children, monitor); + } + + @Override + public boolean isContainer() { + return getCheckedChildren().length > 0; + } + + @Override + public ISchedulingRule getRule(Object object) { + return null; + } + + private Object[] getCheckedChildren() { + if (cache == null) { + cache = model.getChildren(); + } + return cache; + } + +} \ No newline at end of file diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeLabelProvider.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeLabelProvider.java new file mode 100644 index 000000000..80c85099e --- /dev/null +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeLabelProvider.java @@ -0,0 +1,13 @@ +package org.eclipse.rcptt.ui.panels.assertion.tree; + +import org.eclipse.jface.viewers.LabelProvider; + +public class AssertionTreeLabelProvider extends LabelProvider { + @Override + public String getText(Object object) { + if (object instanceof AssertionTreeModel) { + return ((AssertionTreeModel) object).getLabel(); + } + return super.getText(object); + } +} \ No newline at end of file diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeModel.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeModel.java new file mode 100644 index 000000000..2d2567400 --- /dev/null +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeModel.java @@ -0,0 +1,72 @@ +package org.eclipse.rcptt.ui.panels.assertion.tree; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.rcptt.launching.AutLaunch; +import org.eclipse.rcptt.tesla.core.protocol.UIElement; +import org.eclipse.rcptt.tesla.core.protocol.UIHierarchyResponse; +import org.eclipse.rcptt.ui.panels.assertion.UIHierarchyResponseUtilities; + +public class AssertionTreeModel { + + private final AutLaunch aut; + private final UIElement uiElement; + + public AssertionTreeModel(AutLaunch aut, UIElement uiElement) { + this.aut = aut; + this.uiElement = uiElement; + } + + public UIElement getUIElement() { + return uiElement; + } + + public String getLabel() { + return UIHierarchyResponseUtilities.getUIElementCaption(uiElement); + } + + public Object[] getChildren() { + List list = new ArrayList(); + for (Object object : getChildren(uiElement)) { + list.add(new AssertionTreeModel(aut, (UIElement) object)); + } + return (AssertionTreeModel[]) list.toArray(new AssertionTreeModel[list.size()]); + } + + public Object getParent() { + return new AssertionTreeModel(aut, (UIElement) getParent(uiElement)); + } + + public boolean hasChildren() { + return hasChildren(uiElement); + } + + private Object[] getChildren(Object parent) { + if (!(parent instanceof UIElement)) { + return null; + } + UIHierarchyResponse response = UIHierarchyResponseUtilities.getUIHierarchyElement(aut, (UIElement) parent); + List list = new ArrayList(); + for (UIElement uiElement : response.getChildren()) { + list.add(uiElement); + } + return (UIElement[]) list.toArray(new UIElement[list.size()]); + } + + private Object getParent(Object object) { + if (!(object instanceof UIElement)) { + return null; + } + UIHierarchyResponse response = UIHierarchyResponseUtilities.getUIHierarchyParent(aut, (UIElement) object); + return response.getUiElement(); + } + + private boolean hasChildren(Object object) { + if (!(object instanceof UIElement)) { + return false; + } + UIElement uiElement = (UIElement) object; + return uiElement.isHasChildren(); + } +} \ No newline at end of file diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeViewer.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeViewer.java new file mode 100644 index 000000000..160a0fb55 --- /dev/null +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/assertion/tree/AssertionTreeViewer.java @@ -0,0 +1,16 @@ +package org.eclipse.rcptt.ui.panels.assertion.tree; + +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.widgets.Tree; + +public class AssertionTreeViewer extends TreeViewer { + + public AssertionTreeViewer(Tree tree) { + super(tree); + } + + public boolean isItemExists(Object object) { + return null != findItem(object); + } + +} diff --git a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/main/ControlPanelWindow.java b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/main/ControlPanelWindow.java old mode 100644 new mode 100755 index c282ab03c..817a355f4 --- a/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/main/ControlPanelWindow.java +++ b/rcp/org.eclipse.rcptt.ui/src/org/eclipse/rcptt/ui/panels/main/ControlPanelWindow.java @@ -114,22 +114,26 @@ public class ControlPanelWindow extends Dialog { private final Scenario scenario = ScenarioFactory.eINSTANCE .createScenario(); - private final WritableValue testCase = new WritableValue(null, + private final WritableValue testCase = new WritableValue(null, ITestCase.class); + private final ShellAdapter closeListener = new ParentShellCloseListener(); + private final Listener keyListener = new RecordingShortcutListener(); + private AssertionPanelWindow assertionWindow; private EmbeddedTabFolder tabFolder; private CoolBar coolBar; private StatusBarComposite statusBar; private ContextsTable contextsTable; - private final ShellAdapter closeListener = new ParentShellCloseListener(); - private final Listener keyListener = new RecordingShortcutListener(); - private VerificationsTable verificationsTable; private static ControlPanelWindow window; + private CTabItem script; + + private ScriptComposite scriptPart; + public static synchronized ControlPanelWindow openControlPanel( Shell parentShell, ITestCase testCase) throws ModelException { if (window != null && window.getShell() != null @@ -157,7 +161,7 @@ private ControlPanelWindow(Shell parentShell, ITestCase testCase) super((Shell) null); this.parentShell = parentShell; - setShellStyle(SWT.RESIZE /* | SWT.TOOL */| SWT.CLOSE /* | SWT.ON_TOP */); + setShellStyle(SWT.RESIZE | SWT.CLOSE); if (testCase != null) { setModel(testCase); copyContent((Scenario) testCase.getNamedElement(), this.scenario); @@ -210,7 +214,7 @@ protected Control createContents(Composite parent) { scriptPart = new ScriptComposite(internalModel, model != null ? (IFile) getModel().getResource() : null, getShell(), SWT.SCROLL_LOCK); - ComputedValue recordingMode = new ComputedValue() { + ComputedValue recordingMode = new ComputedValue() { @Override protected Object calculate() { return recordingSupport.getMode(); @@ -282,9 +286,8 @@ public void run() { }; }; statusBar.createControl(parent); - // statusBar.getControl().addKeyListener(keyListener); dbc.bindValue(WidgetProperties.text().observe(getShell()), - new ComputedValue() { + new ComputedValue() { @Override protected Object calculate() { StringBuilder text = new StringBuilder( @@ -370,18 +373,6 @@ private CTabFolder createTabFolder(Composite parent) { tabFolder.setUnselectedCloseVisible(false); tabFolder.setUnselectedImageVisible(true); - // ThemeManagerAdapter themePreferences = new ThemeManagerAdapter( - // PlatformUI.getWorkbench().getThemeManager()); - // - // DefaultThemeListener themeListener = new DefaultThemeListener( - // tabFolder, themePreferences); - // themePreferences.addListener(themeListener); - // PreferenceStoreAdapter apiPreferences = new PreferenceStoreAdapter( - // PrefUtil.getAPIPreferenceStore()); - // new DefaultSimpleTabListener(apiPreferences, - // IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, - // tabFolder); - final Color c1 = new Color(Display.getCurrent(), 232, 238, 244); final Color c2 = new Color(Display.getCurrent(), 153, 180, 209); CTabFolder control = (CTabFolder) tabFolder; @@ -394,7 +385,6 @@ public void widgetDisposed(DisposeEvent e) { } }); - // tabFolder.getControl().addKeyListener(keyListener); return tabFolder; } @@ -439,7 +429,7 @@ protected void fill(MenuManager manager) { Messages.ControlPanelWindow_SaveAction) { { dbc.bindValue(Actions.observeEnabled(this), - new ComputedValue() { + new ComputedValue() { @Override protected Object calculate() { return getModel() != null; @@ -462,7 +452,7 @@ public void run() { } }); dbc.bindValue(Actions.observeToolTipText(saveAction), - new ComputedValue() { + new ComputedValue() { @Override protected Object calculate() { if (getModel() != null) { @@ -519,17 +509,17 @@ public void run() { } }; }; - dbc.bindValue(Actions.observeEnabled(action), new ComputedValue( + dbc.bindValue(Actions.observeEnabled(action), new ComputedValue( Boolean.TYPE) { @Override - protected Object calculate() { + protected Boolean calculate() { RecordingMode mode = recordingSupport.getMode(); return mode == RecordingMode.Stopped || mode == RecordingMode.Replaying; } }); dbc.bindValue(Actions.observeImageDescriptor(action), - new ComputedValue() { + new ComputedValue() { @Override protected Object calculate() { if (recordingSupport.getMode() == RecordingMode.Replaying) { @@ -539,7 +529,7 @@ protected Object calculate() { } } }); - dbc.bindValue(Actions.observeToolTipText(action), new ComputedValue() { + dbc.bindValue(Actions.observeToolTipText(action), new ComputedValue() { @Override protected Object calculate() { if (recordingSupport.getMode() == RecordingMode.Replaying) { @@ -563,29 +553,28 @@ public void run() { } }; }; - dbc.bindValue(Actions.observeEnabled(action), new ComputedValue( + dbc.bindValue(Actions.observeEnabled(action), new ComputedValue( Boolean.TYPE) { @Override - protected Object calculate() { + protected Boolean calculate() { RecordingMode mode = recordingSupport.getMode(); return mode == RecordingMode.Stopped || mode != RecordingMode.Replaying; } }); - dbc.bindValue(Actions.observeImageDescriptor(action), - new ComputedValue() { - @Override - protected Object calculate() { - RecordingMode mode = recordingSupport.getMode(); - if (mode == RecordingMode.Stopped - || mode == RecordingMode.Replaying) { - return Images.getImageDescriptor(Images.RECORD); - } else { - return Images.getImageDescriptor(Images.STOP); - } - } - }); - dbc.bindValue(Actions.observeToolTipText(action), new ComputedValue() { + dbc.bindValue(Actions.observeImageDescriptor(action), new ComputedValue() { + @Override + protected Object calculate() { + RecordingMode mode = recordingSupport.getMode(); + if (mode == RecordingMode.Stopped + || mode == RecordingMode.Replaying) { + return Images.getImageDescriptor(Images.RECORD); + } else { + return Images.getImageDescriptor(Images.STOP); + } + } + }); + dbc.bindValue(Actions.observeToolTipText(action), new ComputedValue() { @Override protected Object calculate() { RecordingMode mode = recordingSupport.getMode(); @@ -600,10 +589,10 @@ protected Object calculate() { return action; } - private final ComputedValue modeEnablementObservable = new ComputedValue( + private final ComputedValue modeEnablementObservable = new ComputedValue( Boolean.TYPE) { @Override - protected Object calculate() { + protected Boolean calculate() { RecordingMode mode = recordingSupport.getMode(); return mode != RecordingMode.Stopped && mode != RecordingMode.Replaying @@ -611,10 +600,6 @@ protected Object calculate() { } }; - private CTabItem script; - - private ScriptComposite scriptPart; - private IAction createRecordingModeAction() { IAction action = new Action("", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$ @Override @@ -622,14 +607,23 @@ public void run() { recordingSupport.setMode(RecordingMode.Recording); } }; - action.setImageDescriptor(Images - .getImageDescriptor(Images.PANEL_MODE_RECORD)); - action.setToolTipText(Messages.ControlPanelWindow_SwitchToRecordModeActionToolTip); + dbc.bindValue(Actions.observeImageDescriptor(action), new ComputedValue() { + @Override + protected Object calculate() { + return Images.getImageDescriptor(Images.PANEL_MODE_RECORD); + } + }); + dbc.bindValue(Actions.observeToolTipText(action), new ComputedValue() { + @Override + protected Object calculate() { + return Messages.ControlPanelWindow_SwitchToRecordModeActionToolTip; + } + }); dbc.bindValue(Actions.observeEnabled(action), modeEnablementObservable); - dbc.bindValue(Actions.observeChecked(action), new ComputedValue( + dbc.bindValue(Actions.observeChecked(action), new ComputedValue( Boolean.TYPE) { @Override - protected Object calculate() { + protected Boolean calculate() { return recordingSupport.getMode() == RecordingMode.Recording; } }); @@ -643,14 +637,23 @@ public void run() { recordingSupport.setMode(RecordingMode.Asserting); } }; - action.setImageDescriptor(Images - .getImageDescriptor(Images.PANEL_MODE_ASSERT)); - action.setToolTipText(Messages.ControlPanelWindow_SwitchToAssertModeActionToolTip); + dbc.bindValue(Actions.observeImageDescriptor(action), new ComputedValue() { + @Override + protected Object calculate() { + return Images.getImageDescriptor(Images.PANEL_MODE_ASSERT); + } + }); + dbc.bindValue(Actions.observeToolTipText(action), new ComputedValue() { + @Override + protected Object calculate() { + return Messages.ControlPanelWindow_SwitchToAssertModeActionToolTip; + } + }); dbc.bindValue(Actions.observeEnabled(action), modeEnablementObservable); - dbc.bindValue(Actions.observeChecked(action), new ComputedValue( + dbc.bindValue(Actions.observeChecked(action), new ComputedValue( Boolean.TYPE) { @Override - protected Object calculate() { + protected Boolean calculate() { return recordingSupport.getMode() == RecordingMode.Asserting; } }); @@ -664,14 +667,23 @@ public void run() { recordingSupport.setMode(RecordingMode.ImageRecognition); } }; - action.setImageDescriptor(Images - .getImageDescriptor(Images.PANEL_MODE_IML)); - action.setToolTipText(Messages.ControlPanelWindow_SwitchToRecognitionModeActionToolTip); + dbc.bindValue(Actions.observeImageDescriptor(action), new ComputedValue() { + @Override + protected Object calculate() { + return Images.getImageDescriptor(Images.PANEL_MODE_IML); + } + }); + dbc.bindValue(Actions.observeToolTipText(action), new ComputedValue() { + @Override + protected Object calculate() { + return Messages.ControlPanelWindow_SwitchToRecognitionModeActionToolTip; + } + }); dbc.bindValue(Actions.observeEnabled(action), modeEnablementObservable); - dbc.bindValue(Actions.observeChecked(action), new ComputedValue( + dbc.bindValue(Actions.observeChecked(action), new ComputedValue( Boolean.TYPE) { @Override - protected Object calculate() { + protected Boolean calculate() { return recordingSupport.getMode() == RecordingMode.ImageRecognition; } }); @@ -795,7 +807,8 @@ private void save() { MessageDialog.ERROR, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, - IDialogConstants.CANCEL_LABEL }, 0); + IDialogConstants.CANCEL_LABEL }, + 0); int value = dialog.open(); // Number of pressed button if (value == 0) { saveAs(); @@ -828,7 +841,8 @@ private boolean openSaveDialog() { Messages.ControlPanelWindow_SaveDialogMsg, MessageDialog.QUESTION_WITH_CANCEL, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, - IDialogConstants.CANCEL_LABEL }, 0); + IDialogConstants.CANCEL_LABEL }, + 0); int returnCode = dialog.open(); // Number of pressed button if (returnCode == 0) { if (getModel() != null) { @@ -851,8 +865,6 @@ private void selectTab(CTabItem tab) { tabFolder.setSelection(tab); } - - @Override protected IDialogSettings getDialogBoundsSettings() { final IDialogSettings root = Q7UIPlugin.getDefault() @@ -1018,6 +1030,7 @@ private String getStopRecordShortcutMessage() { return ""; } + // TODO: remove private void updateAssetionWindow() { switch (recordingSupport.getMode()) { case Asserting: diff --git a/runtime/org.eclipse.rcptt.runtime.ui/META-INF/MANIFEST.MF b/runtime/org.eclipse.rcptt.runtime.ui/META-INF/MANIFEST.MF index 23e08ed47..4ffbf02a6 100644 --- a/runtime/org.eclipse.rcptt.runtime.ui/META-INF/MANIFEST.MF +++ b/runtime/org.eclipse.rcptt.runtime.ui/META-INF/MANIFEST.MF @@ -14,7 +14,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.rcptt.tesla.swt;bundle-version="[2.2.0,3.0.0)", org.eclipse.rcptt.tesla.core.am;bundle-version="[2.2.0,3.0.0)", org.eclipse.rcptt.ecl.server.tcp;bundle-version="[2.2.0,3.0.0)", - org.eclipse.rcptt.tesla.swt.aspects;bundle-version="[2.2.0,3.0.0)", org.eclipse.rcptt.reporting;bundle-version="[2.2.0,3.0.0)", org.eclipse.rcptt.ecl.debug.runtime;bundle-version="[2.2.0,3.0.0)", org.eclipse.debug.core;resolution:=optional, @@ -25,7 +24,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.rcptt.tesla.ui.ide.aspects;bundle-version="[2.2.0,3.0.0)", org.eclipse.rcptt.core.launching;bundle-version="[2.2.0,3.0.0)", org.eclipse.rcptt.util;bundle-version="[2.2.0,3.0.0)", - org.eclipse.rcptt.core.swt;bundle-version="[2.2.0,3.0.0)" + org.eclipse.rcptt.core.swt;bundle-version="[2.2.0,3.0.0)", + org.eclipse.rcptt.tesla.recording.aspects.swt;bundle-version="[2.2.0,3.0.0)" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.rcptt.internal.runtime.ui, diff --git a/runtime/org.eclipse.rcptt.runtime.ui/plugin.xml b/runtime/org.eclipse.rcptt.runtime.ui/plugin.xml old mode 100644 new mode 100755 index eef103beb..a8311dedb --- a/runtime/org.eclipse.rcptt.runtime.ui/plugin.xml +++ b/runtime/org.eclipse.rcptt.runtime.ui/plugin.xml @@ -52,6 +52,11 @@ name="SetQ7Option" namespace="http://eclipse.org/rcptt/core/ecl"> + + getParentsList(Display display, SWTUIElement swtuiElement) { + Map references = EclipseWorkbenchProvider.getProvider() + .getWorkbenchReference(SWTUIPlayer.getPlayer(display)); + List parents = SWTUIPlayer.getPlayer(display).collectParents(unwrapWidget(swtuiElement), references); + List elements = new ArrayList(); + for (Widget widget : parents) { + SWTUIElement e = null; + if (references.containsKey(widget)) { + e = references.get(widget); + } else { + e = SWTUIPlayer.getPlayer(display).wrap(widget); + } + if (e != null) { + if (!isGoodKind(e.getKind())) { + continue; + } + if (SWTUIPlayer.getPlayer(display).isVisible(e)) { + elements.add(e); + } + } + } + return elements; + } + + public static SWTUIElement getSWTUIParent(Display display, SWTUIElement uiElement) { + List parentsList = getParentsList(display, uiElement); + if (parentsList.size() > 0) { + return parentsList.get(0); + } + return null; + } + + public static boolean isGoodKind(GenericElementKind kind) { + if (kind.is(ElementKind.Unknown) || kind.is(ElementKind.Editor) || kind.is(ElementKind.View)) { + return false; + } + return true; + } +} diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt/src/org/eclipse/rcptt/tesla/recording/aspects/IAssertSWTEventListener.java b/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt/src/org/eclipse/rcptt/tesla/recording/aspects/IAssertSWTEventListener.java index 9e9a1973f..e673c17f6 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt/src/org/eclipse/rcptt/tesla/recording/aspects/IAssertSWTEventListener.java +++ b/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt/src/org/eclipse/rcptt/tesla/recording/aspects/IAssertSWTEventListener.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.rcptt.tesla.recording.aspects; +import org.eclipse.rcptt.tesla.core.protocol.raw.Element; +import org.eclipse.rcptt.tesla.internal.ui.player.SWTUIElement; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Widget; @@ -17,4 +19,12 @@ public interface IAssertSWTEventListener extends IAbstractSWTEventListener { public boolean handleEventInFreeze(Widget widget, int type, Event event); + public boolean highlightWidget(Widget widget); + + public boolean updateAssertionPanelWindow(Widget widget); + + public SWTUIElement getSWTUIElement(Element element); + + public Element getElement(SWTUIElement swtUIElement); + } diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt/src/org/eclipse/rcptt/tesla/recording/aspects/SWTEventManager.java b/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt/src/org/eclipse/rcptt/tesla/recording/aspects/SWTEventManager.java index 26ca4a346..e6cdca6e3 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt/src/org/eclipse/rcptt/tesla/recording/aspects/SWTEventManager.java +++ b/runtime/tesla/org.eclipse.rcptt.tesla.recording.aspects.swt/src/org/eclipse/rcptt/tesla/recording/aspects/SWTEventManager.java @@ -19,6 +19,8 @@ import java.util.Set; import java.util.WeakHashMap; +import org.eclipse.rcptt.tesla.core.protocol.raw.Element; +import org.eclipse.rcptt.tesla.internal.ui.player.SWTUIElement; import org.eclipse.swt.custom.CCombo; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.widgets.Control; @@ -178,6 +180,42 @@ public static boolean handleEventInFreeze(Widget widget, int type, return finalResult; } + public static boolean highlightWidget(Widget widget) { + boolean finalResult = false; + for (IAssertSWTEventListener listener : getListeners(IAssertSWTEventListener.class)) { + finalResult = finalResult || listener.highlightWidget(widget); + } + return finalResult; + } + + public static boolean updateAssertionPanelWindow(Widget widget) { + boolean finalResult = false; + for (IAssertSWTEventListener listener : getListeners(IAssertSWTEventListener.class)) { + finalResult = finalResult || listener.updateAssertionPanelWindow(widget); + } + return finalResult; + } + + public static SWTUIElement getSWTUIElement(Element element) { + for (IAssertSWTEventListener listener : getListeners(IAssertSWTEventListener.class)) { + SWTUIElement result = listener.getSWTUIElement(element); + if (null != result) { + return result; + } + } + return null; + } + + public static Element getElement(SWTUIElement swtUIElement) { + for (IAssertSWTEventListener listener : getListeners(IAssertSWTEventListener.class)) { + Element result = listener.getElement(swtUIElement); + if (null != result) { + return result; + } + } + return null; + } + public static void recordCombo(CCombo combo) { comboList.add(new WeakReference(combo)); // Remove disposed ones diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.recording.swt/src/org/eclipse/rcptt/tesla/recording/core/swt/SWTAssertManager.java b/runtime/tesla/org.eclipse.rcptt.tesla.recording.swt/src/org/eclipse/rcptt/tesla/recording/core/swt/SWTAssertManager.java index c10e03974..c1747a1be 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.recording.swt/src/org/eclipse/rcptt/tesla/recording/core/swt/SWTAssertManager.java +++ b/runtime/tesla/org.eclipse.rcptt.tesla.recording.swt/src/org/eclipse/rcptt/tesla/recording/core/swt/SWTAssertManager.java @@ -36,6 +36,8 @@ import org.eclipse.rcptt.tesla.core.protocol.raw.RawFactory; import org.eclipse.rcptt.tesla.core.protocol.raw.SetMode; import org.eclipse.rcptt.tesla.internal.core.TeslaCore; +import org.eclipse.rcptt.tesla.internal.ui.player.FindResult; +import org.eclipse.rcptt.tesla.internal.ui.player.SWTUIElement; import org.eclipse.rcptt.tesla.internal.ui.player.SWTUIPlayer; import org.eclipse.rcptt.tesla.internal.ui.processors.SWTUIProcessor; import org.eclipse.rcptt.tesla.recording.aspects.IAssertSWTEventListener; @@ -47,6 +49,8 @@ import org.eclipse.rcptt.tesla.recording.core.TeslaRecorder; import org.eclipse.rcptt.tesla.recording.core.swt.util.RecordedEvent; import org.eclipse.rcptt.tesla.swt.events.TeslaEventManager; +import org.eclipse.rcptt.tesla.ui.describers.DescriberManager; +import org.eclipse.rcptt.tesla.ui.describers.IWidgetDescriber; import org.eclipse.rcptt.util.ShellUtilsProvider; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; @@ -484,6 +488,51 @@ public void run() { } } + public synchronized boolean highlightWidget(final Widget widget) { + if (widget == null || widget.isDisposed()) { + return false; + } + resetAssertSelection(); + + widget.getDisplay().asyncExec(new Runnable() { + public void run() { + synchronized (widget) { + IWidgetDescriber descr = DescriberManager.getDescriber(widget, 0, 0); + if (null == descr.getBounds()) { + return; + } + updateHover(descr.getBounds(), descr.getPoint(), true, true); + } + } + }); + return true; + } + + public synchronized SWTUIElement getSWTUIElement(Element element) { + SWTUIElement swtUIElement = SWTRecordingHelper.getHelper().findByElement(element); + return swtUIElement; + } + + public synchronized Element getElement(SWTUIElement swtUIElement) { + FindResult result = null; + result = SWTRecordingHelper.getHelper().getLocator().findElement(swtUIElement, true, false, true); + if (result != null) { + return result.element; + } + return null; + } + + public synchronized boolean updateAssertionPanelWindow(Widget widget) { + if (widget == null || widget.isDisposed()) { + return false; + } + + IRecordingDescriber assertDescr = selectAllowedParent(new RecordingWidgetDescriber(widget)); + seachForElement(assertDescr.searchForElement(recorder), true, assertDescr); + freezedCtrl = assertDescr; + + return true; + } public boolean isShortcutRequest(Event e, String[] shortcuts) { if (shortcuts == null) { @@ -514,19 +563,15 @@ private void showPopupMenu(Event event, Control c, "show popup menu for: " + c.getClass().toString()); } Menu menu = null; - player.getEvents().sendEvent(c, SWT.MenuDetect, event.x, event.y, - SWT.BUTTON2); + player.getEvents().sendEvent(c, SWT.MenuDetect, event.x, event.y, SWT.BUTTON2); menu = c.getMenu(); if (menu != null && !menu.isDisposed()) { player.getEvents().sendEvent(menu, SWT.Show); - // menu.setVisible(true); Menu popupMenu = new Menu(getShell(c), SWT.POP_UP); clearPopupMenus(); copyMenuTo(menu, popupMenu); menus.add(popupMenu); popupMenu.setVisible(true); - - // showMenuAt(event, c, menu); } } @@ -630,12 +675,11 @@ private void showMenuAt(Event event, Control c, Menu menu) { Point pos = c.toDisplay(event.x, event.y); Point size = bar.computeSize(SWT.DEFAULT, SWT.DEFAULT); menuShell.setBounds(pos.x, pos.y, size.x + 5, size.y + 5); - // sh.setMenuBar(bar); menuShell.layout(); menuShell.open(); } - private Shell getShell(Widget widget) { + public Shell getShell(Widget widget) { if (widget instanceof TreeItem) { return (((TreeItem) widget).getParent()).getShell(); } @@ -716,8 +760,6 @@ private synchronized void updateHover(Rectangle bounds, Point point, region.add(0, bounds.height - p0y, 2, p0y); if (controlEquals) { - // p0x = bounds.width; - // p0y = bounds.height; region.add(0, 0, bounds.width, 2); region.add(0, bounds.height - 2, bounds.width, 2); region.add(0, 0, 2, bounds.height); @@ -733,15 +775,13 @@ private synchronized void updateHover(Rectangle bounds, Point point, selectionShell.setRegion(region); if (!selectionShell.isVisible()) { selectionShell.setVisible(true); - // selectionShell.open(); } selectionShell.redraw(); - // selectionShell.forceActive(); selectionShell.moveAbove(null); selectionShell.setAlpha(127); } - private synchronized void callCreateHover(final boolean value, Shell parent) { + public synchronized void callCreateHover(final boolean value, Shell parent) { if (!menuShells.isEmpty()) { return; } @@ -767,37 +807,12 @@ public void run() { } } } - // if (selectionShell != null && value == true) { - // Composite currentParent = selectionShell.getParent(); - // boolean reCreate = false; - // if (currentParent != null) { - // reCreate = !currentParent.equals(parent); - // } else { - // reCreate = (parent != null); - // } - // if (reCreate) { - // selectionShell.dispose(); - // selectionShell = null; - // } - // } if (selectionShell == null && value == true) { - // if (parent != null) { - // selectionShell = new Shell(parent, SWT.NO_TRIM | SWT.ON_TOP | - // SWT.TOOL); - // } else { selectionShell = new Shell(SWT.NO_TRIM | SWT.ON_TOP | SWT.TOOL); - // } - selectionShell.setBackground(selectionShell.getDisplay() .getSystemColor(SWT.COLOR_RED)); selectionShell.setText("Hover"); - // selectionShell.addMouseMoveListener(new MouseMoveListener() { - // public void mouseMove(MouseEvent e) { - // if (freezedCtrl != null && freezedCtrl instanceof Control) { - // ((Control) freezedCtrl).getShell().setFocus(); - // } - // } - // }); + selectionShell.setData("isHover", true); } else if (value == false) { if (selectionShell != null) { selectionShell.dispose(); @@ -855,6 +870,7 @@ private void seachForElement(Element element, boolean fixed, focus.setElement(EcoreUtil.copy(element)); focus.setPointFixed(fixed); if (fixed) { + // System.out.println("clicked: " + element.getId()); if (TeslaFeatures.isActivityLogging()) { Q7LoggingManager.logMessage(IQ7ActivityLogs.ASSERTIONS, "assert properties of element: "); @@ -887,6 +903,7 @@ public void run() { selectionShell.setBackground(selectionShell.getDisplay() .getSystemColor(SWT.COLOR_RED)); selectionShell.setText("Hover"); + selectionShell.setData("isHover", true); disposeMenuPopups(); clearPopupMenus(); } diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.swt/src/org/eclipse/rcptt/tesla/internal/ui/player/UIJobCollector.java b/runtime/tesla/org.eclipse.rcptt.tesla.swt/src/org/eclipse/rcptt/tesla/internal/ui/player/UIJobCollector.java index d2474d680..f9900569f 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.swt/src/org/eclipse/rcptt/tesla/internal/ui/player/UIJobCollector.java +++ b/runtime/tesla/org.eclipse.rcptt.tesla.swt/src/org/eclipse/rcptt/tesla/internal/ui/player/UIJobCollector.java @@ -221,7 +221,7 @@ protected JobStatus calcJobStatus(Job job, long delay) { return detectJobStatus(job, delay); } - private static final Set IGNORED_BY_DEFAULT = Collections.unmodifiableSet(new HashSet<>(asList( + private static final Set IGNORED_BY_DEFAULT = Collections.unmodifiableSet(new HashSet(asList( "org.eclipse.jdt.internal.core.search.processing.JobManager$1$ProgressJob", "org.eclipse.ui.internal.progress.ProgressViewUpdater$1", "org.eclipse.ui.internal.progress.WorkbenchSiteProgressService$SiteUpdateJob", @@ -376,8 +376,8 @@ public void apply(Node node) { } private void logJobInformation(List realJobs, List jobsInUI) { - List otherJobs = new ArrayList<>(jobs.keySet()); - Set jobInStepMode = new HashSet<>(); + List otherJobs = new ArrayList(jobs.keySet()); + Set jobInStepMode = new HashSet(); for (Job job : otherJobs) { if (getOrCreateJobInfo(job).jobInStepMode) jobInStepMode.add(job); @@ -419,10 +419,10 @@ private void logJobInformation(List realJobs, List jobsInUI) { public boolean isEmpty(Context context, Q7WaitInfoRoot info) { // Filter already executed UI jobs with async finish status. - List realJobs = new ArrayList<>(); + List realJobs = new ArrayList(); long current = System.currentTimeMillis(); boolean wasInStepMode = false; - List jobsInUI = new ArrayList<>(); + List jobsInUI = new ArrayList(); synchronized (jobs) { // Remove all canceled jobs removeCanceledJobs(); @@ -682,7 +682,7 @@ private void removeCanceledJobs() { private Set getSuperClassNames(Job job) { Class cl = job.getClass(); - Set names = new HashSet<>(); + Set names = new HashSet(); while (true) { if (cl.equals(Job.class)) { break; @@ -757,7 +757,7 @@ public int getCount() { public List getJobs() { synchronized (jobs) { - ArrayList rv = new ArrayList<>(); + ArrayList rv = new ArrayList(); for (JobInfo info : jobs.values()) if (info.isActive()) rv.add(info.job); @@ -795,7 +795,7 @@ public void join(long timeout) throws InterruptedException { } private boolean isJoinEmpty() { - List realJobs = new ArrayList<>(); + List realJobs = new ArrayList(); synchronized (jobs) { if (jobs.isEmpty()) { return true; diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.swt/src/org/eclipse/rcptt/tesla/internal/ui/processors/SWTUIProcessor.java b/runtime/tesla/org.eclipse.rcptt.tesla.swt/src/org/eclipse/rcptt/tesla/internal/ui/processors/SWTUIProcessor.java index ff709e0b0..293d367df 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.swt/src/org/eclipse/rcptt/tesla/internal/ui/processors/SWTUIProcessor.java +++ b/runtime/tesla/org.eclipse.rcptt.tesla.swt/src/org/eclipse/rcptt/tesla/internal/ui/processors/SWTUIProcessor.java @@ -299,7 +299,8 @@ public class SWTUIProcessor implements ITeslaCommandProcessor, ProtocolPackage.Literals.CLICK_COLUMN, ProtocolPackage.Literals.MOUSE_EVENT }; - private static final Set SKIP_ACTIVATION_FOR_SHELLS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( + private static final Set SKIP_ACTIVATION_FOR_SHELLS = Collections + .unmodifiableSet(new HashSet(Arrays.asList( "ContextInformationPopup.createContextInfoPopup()"))); protected static ProtocolFactory factory = ProtocolFactory.eINSTANCE; @@ -877,7 +878,7 @@ private static Point getMouseEventPoint(MouseEvent cmd, Rectangle bounds, return new Point(x, y); } - private static final Map mouseToEventType = new HashMap<>(); + private static final Map mouseToEventType = new HashMap(); static { mouseToEventType.put(MouseEventKind.DOUBLE_CLICK, SWT.MouseDoubleClick); @@ -2483,7 +2484,7 @@ protected Response handleSetSelection(final SetSelection command) { return response; } - final List sels = new ArrayList<>(); + final List sels = new ArrayList(); sels.add(asStringArray(command.getPath())); for (final MultiSelectionItem item : items) { sels.add(asStringArray(item.getPath())); @@ -2527,7 +2528,7 @@ private void updateSelectionFailedMessage(final SetSelection command, else if (!command.getPath().isEmpty() || !command.getAdditionalItems().isEmpty()) { - List items = new ArrayList<>(); + List items = new ArrayList(); String[] path = asStringArray(command.getPath()); if (path != null) items.add(path); @@ -2879,7 +2880,7 @@ else if (lastCommand instanceof SelectCommand) { IWorkbenchWindow[] windows = PlatformUI.getWorkbench() .getWorkbenchWindows(); for (IWorkbenchWindow win : windows) { - Set processed = new HashSet<>(); + Set processed = new HashSet(); processChildren(win, root2, processed); }