diff options
author | Pavel Agapov | 2015-08-19 13:10:39 +0000 |
---|---|---|
committer | Pavel Agapov | 2015-08-19 13:10:39 +0000 |
commit | 620d170fc775b51c812827debd5f5561c708857a (patch) | |
tree | cca836b14d3a2e387de1c70c7cf084bf931547f7 | |
parent | bd3f1835f1d9c4fae4123194dad3e2e20c24aea2 (diff) | |
download | org.eclipse.rcptt-620d170fc775b51c812827debd5f5561c708857a.tar.gz org.eclipse.rcptt-620d170fc775b51c812827debd5f5561c708857a.tar.xz org.eclipse.rcptt-620d170fc775b51c812827debd5f5561c708857a.zip |
[474197] Support assertion of native message boxes
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=474197
Change-Id: Ibe658132d62cecf997f438b89a2d2af9aef4b804
Signed-off-by: Pavel Agapov <pavel.agapov@xored.com>
29 files changed, 799 insertions, 27 deletions
diff --git a/core/org.eclipse.rcptt.tesla.ecl-feature/feature.xml b/core/org.eclipse.rcptt.tesla.ecl-feature/feature.xml index 19373c349..96f415f6c 100644 --- a/core/org.eclipse.rcptt.tesla.ecl-feature/feature.xml +++ b/core/org.eclipse.rcptt.tesla.ecl-feature/feature.xml @@ -26,7 +26,7 @@ id="org.eclipse.rcptt.tesla.ecl" download-size="0" install-size="0" - version="2.0.0.qualifier" + version="2.1.0.qualifier" unpack="false"/> <plugin diff --git a/core/org.eclipse.rcptt.tesla.ecl/META-INF/MANIFEST.MF b/core/org.eclipse.rcptt.tesla.ecl/META-INF/MANIFEST.MF index 75d66dc86..ed0a53921 100644 --- a/core/org.eclipse.rcptt.tesla.ecl/META-INF/MANIFEST.MF +++ b/core/org.eclipse.rcptt.tesla.ecl/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.rcptt.tesla.ecl;singleton:=true -Bundle-Version: 2.0.0.qualifier +Bundle-Version: 2.1.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/GetLastMessageBox.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/GetLastMessageBox.java new file mode 100644 index 000000000..496561090 --- /dev/null +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/GetLastMessageBox.java @@ -0,0 +1,18 @@ +/** + */ +package org.eclipse.rcptt.tesla.ecl.model; + +import org.eclipse.rcptt.ecl.core.Command; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Get Last Message Box</b></em>'. + * <!-- end-user-doc --> + * + * + * @see org.eclipse.rcptt.tesla.ecl.model.TeslaPackage#getGetLastMessageBox() + * @model annotation="http://www.eclipse.org/ecl/docs description='Gets last shown MessageBox info. If MessageBox was not shown, then error is returned.' returns='MessageBoxInfo' example='set-dialog-result MessageBox 128\r\nget-view \"Q7 Quality Mockups\" | get-group \"MessageBox Test\" | get-button \"Message Box with YES/NO Buttons\" | click\r\nwith [get-last-message-box] {\r\n get-property title | equals \"Warning\" | verify-true\r\n get-property message | equals \"Yes or No?\" | verify-true\r\n}'" + * @generated + */ +public interface GetLastMessageBox extends Command { +} // GetLastMessageBox diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/MessageBoxInfo.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/MessageBoxInfo.java new file mode 100644 index 000000000..912650d94 --- /dev/null +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/MessageBoxInfo.java @@ -0,0 +1,77 @@ +/** + */ +package org.eclipse.rcptt.tesla.ecl.model; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Message Box Info</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo#getTitle <em>Title</em>}</li> + * <li>{@link org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo#getMessage <em>Message</em>}</li> + * </ul> + * + * @see org.eclipse.rcptt.tesla.ecl.model.TeslaPackage#getMessageBoxInfo() + * @model + * @generated + */ +public interface MessageBoxInfo extends EObject { + /** + * Returns the value of the '<em><b>Title</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Title</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Title</em>' attribute. + * @see #setTitle(String) + * @see org.eclipse.rcptt.tesla.ecl.model.TeslaPackage#getMessageBoxInfo_Title() + * @model + * @generated + */ + String getTitle(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo#getTitle <em>Title</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Title</em>' attribute. + * @see #getTitle() + * @generated + */ + void setTitle(String value); + + /** + * Returns the value of the '<em><b>Message</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Message</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Message</em>' attribute. + * @see #setMessage(String) + * @see org.eclipse.rcptt.tesla.ecl.model.TeslaPackage#getMessageBoxInfo_Message() + * @model + * @generated + */ + String getMessage(); + + /** + * Sets the value of the '{@link org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo#getMessage <em>Message</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Message</em>' attribute. + * @see #getMessage() + * @generated + */ + void setMessage(String value); + +} // MessageBoxInfo diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/TeslaFactory.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/TeslaFactory.java index a0b1ce740..6093c82f3 100644 --- a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/TeslaFactory.java +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/TeslaFactory.java @@ -1281,6 +1281,24 @@ public interface TeslaFactory extends EFactory { RestartAut createRestartAut(); /** + * Returns a new object of class '<em>Message Box Info</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Message Box Info</em>'. + * @generated + */ + MessageBoxInfo createMessageBoxInfo(); + + /** + * Returns a new object of class '<em>Get Last Message Box</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Get Last Message Box</em>'. + * @generated + */ + GetLastMessageBox createGetLastMessageBox(); + + /** * Returns the package supported by this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/TeslaPackage.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/TeslaPackage.java index 2af9eb449..a252d2078 100644 --- a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/TeslaPackage.java +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/TeslaPackage.java @@ -9941,6 +9941,80 @@ public interface TeslaPackage extends EPackage { int RESTART_AUT_FEATURE_COUNT = CorePackage.COMMAND_FEATURE_COUNT + 0; /** + * The meta object id for the '{@link org.eclipse.rcptt.tesla.ecl.model.impl.MessageBoxInfoImpl <em>Message Box Info</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.rcptt.tesla.ecl.model.impl.MessageBoxInfoImpl + * @see org.eclipse.rcptt.tesla.ecl.model.impl.TeslaPackageImpl#getMessageBoxInfo() + * @generated + */ + int MESSAGE_BOX_INFO = 144; + + /** + * The feature id for the '<em><b>Title</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MESSAGE_BOX_INFO__TITLE = 0; + + /** + * The feature id for the '<em><b>Message</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MESSAGE_BOX_INFO__MESSAGE = 1; + + /** + * The number of structural features of the '<em>Message Box Info</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MESSAGE_BOX_INFO_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.rcptt.tesla.ecl.model.impl.GetLastMessageBoxImpl <em>Get Last Message Box</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.rcptt.tesla.ecl.model.impl.GetLastMessageBoxImpl + * @see org.eclipse.rcptt.tesla.ecl.model.impl.TeslaPackageImpl#getGetLastMessageBox() + * @generated + */ + int GET_LAST_MESSAGE_BOX = 145; + + /** + * The feature id for the '<em><b>Host</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int GET_LAST_MESSAGE_BOX__HOST = CorePackage.COMMAND__HOST; + + /** + * The feature id for the '<em><b>Bindings</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int GET_LAST_MESSAGE_BOX__BINDINGS = CorePackage.COMMAND__BINDINGS; + + /** + * The number of structural features of the '<em>Get Last Message Box</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int GET_LAST_MESSAGE_BOX_FEATURE_COUNT = CorePackage.COMMAND_FEATURE_COUNT + 0; + + /** * The meta object id for the '{@link org.eclipse.rcptt.tesla.ecl.model.Button <em>Button</em>}' enum. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -9948,7 +10022,7 @@ public interface TeslaPackage extends EPackage { * @see org.eclipse.rcptt.tesla.ecl.model.impl.TeslaPackageImpl#getButton() * @generated */ - int BUTTON = 144; + int BUTTON = 146; /** * The meta object id for the '<em>Element Kind</em>' data type. @@ -9958,7 +10032,7 @@ public interface TeslaPackage extends EPackage { * @see org.eclipse.rcptt.tesla.ecl.model.impl.TeslaPackageImpl#getElementKind() * @generated */ - int ELEMENT_KIND = 145; + int ELEMENT_KIND = 147; /** @@ -13602,6 +13676,48 @@ public interface TeslaPackage extends EPackage { EClass getRestartAut(); /** + * Returns the meta object for class '{@link org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo <em>Message Box Info</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Message Box Info</em>'. + * @see org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo + * @generated + */ + EClass getMessageBoxInfo(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo#getTitle <em>Title</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Title</em>'. + * @see org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo#getTitle() + * @see #getMessageBoxInfo() + * @generated + */ + EAttribute getMessageBoxInfo_Title(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo#getMessage <em>Message</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Message</em>'. + * @see org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo#getMessage() + * @see #getMessageBoxInfo() + * @generated + */ + EAttribute getMessageBoxInfo_Message(); + + /** + * Returns the meta object for class '{@link org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox <em>Get Last Message Box</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Get Last Message Box</em>'. + * @see org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox + * @generated + */ + EClass getGetLastMessageBox(); + + /** * Returns the meta object for enum '{@link org.eclipse.rcptt.tesla.ecl.model.Button <em>Button</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -16685,6 +16801,42 @@ public interface TeslaPackage extends EPackage { EClass RESTART_AUT = eINSTANCE.getRestartAut(); /** + * The meta object literal for the '{@link org.eclipse.rcptt.tesla.ecl.model.impl.MessageBoxInfoImpl <em>Message Box Info</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.rcptt.tesla.ecl.model.impl.MessageBoxInfoImpl + * @see org.eclipse.rcptt.tesla.ecl.model.impl.TeslaPackageImpl#getMessageBoxInfo() + * @generated + */ + EClass MESSAGE_BOX_INFO = eINSTANCE.getMessageBoxInfo(); + + /** + * The meta object literal for the '<em><b>Title</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute MESSAGE_BOX_INFO__TITLE = eINSTANCE.getMessageBoxInfo_Title(); + + /** + * The meta object literal for the '<em><b>Message</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute MESSAGE_BOX_INFO__MESSAGE = eINSTANCE.getMessageBoxInfo_Message(); + + /** + * The meta object literal for the '{@link org.eclipse.rcptt.tesla.ecl.model.impl.GetLastMessageBoxImpl <em>Get Last Message Box</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.rcptt.tesla.ecl.model.impl.GetLastMessageBoxImpl + * @see org.eclipse.rcptt.tesla.ecl.model.impl.TeslaPackageImpl#getGetLastMessageBox() + * @generated + */ + EClass GET_LAST_MESSAGE_BOX = eINSTANCE.getGetLastMessageBox(); + + /** * The meta object literal for the '{@link org.eclipse.rcptt.tesla.ecl.model.Button <em>Button</em>}' enum. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/GetLastMessageBoxImpl.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/GetLastMessageBoxImpl.java new file mode 100644 index 000000000..ecacefef6 --- /dev/null +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/GetLastMessageBoxImpl.java @@ -0,0 +1,39 @@ +/** + */ +package org.eclipse.rcptt.tesla.ecl.model.impl; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.rcptt.ecl.core.impl.CommandImpl; + +import org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox; +import org.eclipse.rcptt.tesla.ecl.model.TeslaPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Get Last Message Box</b></em>'. + * <!-- end-user-doc --> + * + * @generated + */ +public class GetLastMessageBoxImpl extends CommandImpl implements GetLastMessageBox { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected GetLastMessageBoxImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return TeslaPackage.Literals.GET_LAST_MESSAGE_BOX; + } + +} //GetLastMessageBoxImpl diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/MessageBoxInfoImpl.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/MessageBoxInfoImpl.java new file mode 100644 index 000000000..7738ffa10 --- /dev/null +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/MessageBoxInfoImpl.java @@ -0,0 +1,217 @@ +/** + */ +package org.eclipse.rcptt.tesla.ecl.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.emf.ecore.impl.EObjectImpl; + +import org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo; +import org.eclipse.rcptt.tesla.ecl.model.TeslaPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Message Box Info</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.MessageBoxInfoImpl#getTitle <em>Title</em>}</li> + * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.MessageBoxInfoImpl#getMessage <em>Message</em>}</li> + * </ul> + * + * @generated + */ +public class MessageBoxInfoImpl extends EObjectImpl implements MessageBoxInfo { + /** + * The default value of the '{@link #getTitle() <em>Title</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTitle() + * @generated + * @ordered + */ + protected static final String TITLE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getTitle() <em>Title</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTitle() + * @generated + * @ordered + */ + protected String title = TITLE_EDEFAULT; + + /** + * The default value of the '{@link #getMessage() <em>Message</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMessage() + * @generated + * @ordered + */ + protected static final String MESSAGE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getMessage() <em>Message</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMessage() + * @generated + * @ordered + */ + protected String message = MESSAGE_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected MessageBoxInfoImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return TeslaPackage.Literals.MESSAGE_BOX_INFO; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getTitle() { + return title; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setTitle(String newTitle) { + String oldTitle = title; + title = newTitle; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.MESSAGE_BOX_INFO__TITLE, oldTitle, title)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getMessage() { + return message; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setMessage(String newMessage) { + String oldMessage = message; + message = newMessage; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.MESSAGE_BOX_INFO__MESSAGE, oldMessage, message)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case TeslaPackage.MESSAGE_BOX_INFO__TITLE: + return getTitle(); + case TeslaPackage.MESSAGE_BOX_INFO__MESSAGE: + return getMessage(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case TeslaPackage.MESSAGE_BOX_INFO__TITLE: + setTitle((String)newValue); + return; + case TeslaPackage.MESSAGE_BOX_INFO__MESSAGE: + setMessage((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case TeslaPackage.MESSAGE_BOX_INFO__TITLE: + setTitle(TITLE_EDEFAULT); + return; + case TeslaPackage.MESSAGE_BOX_INFO__MESSAGE: + setMessage(MESSAGE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case TeslaPackage.MESSAGE_BOX_INFO__TITLE: + return TITLE_EDEFAULT == null ? title != null : !TITLE_EDEFAULT.equals(title); + case TeslaPackage.MESSAGE_BOX_INFO__MESSAGE: + return MESSAGE_EDEFAULT == null ? message != null : !MESSAGE_EDEFAULT.equals(message); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (title: "); + result.append(title); + result.append(", message: "); + result.append(message); + result.append(')'); + return result.toString(); + } + +} //MessageBoxInfoImpl diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/TeslaFactoryImpl.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/TeslaFactoryImpl.java index dd85976ee..4bc6af27d 100644 --- a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/TeslaFactoryImpl.java +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/TeslaFactoryImpl.java @@ -77,6 +77,7 @@ import org.eclipse.rcptt.tesla.ecl.model.GetGroup; import org.eclipse.rcptt.tesla.ecl.model.GetItem; import org.eclipse.rcptt.tesla.ecl.model.GetItems; import org.eclipse.rcptt.tesla.ecl.model.GetLabel; +import org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox; import org.eclipse.rcptt.tesla.ecl.model.GetLeftRuler; import org.eclipse.rcptt.tesla.ecl.model.GetLink; import org.eclipse.rcptt.tesla.ecl.model.GetList; @@ -114,6 +115,7 @@ import org.eclipse.rcptt.tesla.ecl.model.IsEmpty; import org.eclipse.rcptt.tesla.ecl.model.KeyType; import org.eclipse.rcptt.tesla.ecl.model.Matches; import org.eclipse.rcptt.tesla.ecl.model.Maximize; +import org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo; import org.eclipse.rcptt.tesla.ecl.model.Minimize; import org.eclipse.rcptt.tesla.ecl.model.Mouse; import org.eclipse.rcptt.tesla.ecl.model.OpenDeclaration; @@ -342,6 +344,8 @@ public class TeslaFactoryImpl extends EFactoryImpl implements TeslaFactory { case TeslaPackage.DECRYPT: return createDecrypt(); case TeslaPackage.DECRYPT_RESULT: return createDecryptResult(); case TeslaPackage.RESTART_AUT: return createRestartAut(); + case TeslaPackage.MESSAGE_BOX_INFO: return createMessageBoxInfo(); + case TeslaPackage.GET_LAST_MESSAGE_BOX: return createGetLastMessageBox(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } @@ -1639,6 +1643,26 @@ public class TeslaFactoryImpl extends EFactoryImpl implements TeslaFactory { } /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public MessageBoxInfo createMessageBoxInfo() { + MessageBoxInfoImpl messageBoxInfo = new MessageBoxInfoImpl(); + return messageBoxInfo; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public GetLastMessageBox createGetLastMessageBox() { + GetLastMessageBoxImpl getLastMessageBox = new GetLastMessageBoxImpl(); + return getLastMessageBox; + } + + /** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/TeslaPackageImpl.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/TeslaPackageImpl.java index d03b348e5..681647e4e 100644 --- a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/TeslaPackageImpl.java +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/impl/TeslaPackageImpl.java @@ -85,6 +85,7 @@ import org.eclipse.rcptt.tesla.ecl.model.GetGroup; import org.eclipse.rcptt.tesla.ecl.model.GetItem; import org.eclipse.rcptt.tesla.ecl.model.GetItems; import org.eclipse.rcptt.tesla.ecl.model.GetLabel; +import org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox; import org.eclipse.rcptt.tesla.ecl.model.GetLeftRuler; import org.eclipse.rcptt.tesla.ecl.model.GetLink; import org.eclipse.rcptt.tesla.ecl.model.GetList; @@ -122,6 +123,7 @@ import org.eclipse.rcptt.tesla.ecl.model.IsEmpty; import org.eclipse.rcptt.tesla.ecl.model.KeyType; import org.eclipse.rcptt.tesla.ecl.model.Matches; import org.eclipse.rcptt.tesla.ecl.model.Maximize; +import org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo; import org.eclipse.rcptt.tesla.ecl.model.Minimize; import org.eclipse.rcptt.tesla.ecl.model.Mouse; import org.eclipse.rcptt.tesla.ecl.model.OpenDeclaration; @@ -1193,6 +1195,20 @@ public class TeslaPackageImpl extends EPackageImpl implements TeslaPackage { * <!-- end-user-doc --> * @generated */ + private EClass messageBoxInfoEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass getLastMessageBoxEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ private EEnum buttonEEnum = null; /** @@ -4373,6 +4389,42 @@ public class TeslaPackageImpl extends EPackageImpl implements TeslaPackage { * <!-- end-user-doc --> * @generated */ + public EClass getMessageBoxInfo() { + return messageBoxInfoEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getMessageBoxInfo_Title() { + return (EAttribute)messageBoxInfoEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getMessageBoxInfo_Message() { + return (EAttribute)messageBoxInfoEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getGetLastMessageBox() { + return getLastMessageBoxEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ public EEnum getButton() { return buttonEEnum; } @@ -4902,6 +4954,12 @@ public class TeslaPackageImpl extends EPackageImpl implements TeslaPackage { restartAutEClass = createEClass(RESTART_AUT); + messageBoxInfoEClass = createEClass(MESSAGE_BOX_INFO); + createEAttribute(messageBoxInfoEClass, MESSAGE_BOX_INFO__TITLE); + createEAttribute(messageBoxInfoEClass, MESSAGE_BOX_INFO__MESSAGE); + + getLastMessageBoxEClass = createEClass(GET_LAST_MESSAGE_BOX); + // Create enums buttonEEnum = createEEnum(BUTTON); @@ -5088,6 +5146,7 @@ public class TeslaPackageImpl extends EPackageImpl implements TeslaPackage { unfocusEClass.getESuperTypes().add(this.getControlCommand()); decryptEClass.getESuperTypes().add(theCorePackage.getCommand()); restartAutEClass.getESuperTypes().add(theCorePackage.getCommand()); + getLastMessageBoxEClass.getESuperTypes().add(theCorePackage.getCommand()); // Initialize classes and features; add operations and parameters initEClass(waitEClass, Wait.class, "Wait", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -5578,6 +5637,12 @@ public class TeslaPackageImpl extends EPackageImpl implements TeslaPackage { initEClass(restartAutEClass, RestartAut.class, "RestartAut", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(messageBoxInfoEClass, MessageBoxInfo.class, "MessageBoxInfo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getMessageBoxInfo_Title(), theEcorePackage.getEString(), "title", null, 0, 1, MessageBoxInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getMessageBoxInfo_Message(), theEcorePackage.getEString(), "message", null, 0, 1, MessageBoxInfo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(getLastMessageBoxEClass, GetLastMessageBox.class, "GetLastMessageBox", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + // Initialize enums and add enum literals initEEnum(buttonEEnum, Button.class, "Button"); addEEnumLiteral(buttonEEnum, Button.NONE); @@ -7261,6 +7326,14 @@ public class TeslaPackageImpl extends EPackageImpl implements TeslaPackage { new String[] { "description", "Restarts AUT.\nCan be used if there in no File/Restart option in AUT.\n\nPlease note that <a href=\"#wait-until-eclipse-is-ready\">wait-until-eclipse-is-ready</a> command should be used \nimmidiately after restart-aut command. ", "example", "get-view \"Package Explorer\" | get-tree | get-menu \"New/Java Project\" | click\nwith [get-window \"New Java Project\"] {\n with [get-editbox -after [get-label \"Project name:\"]] {\n set-text MyProjec\n set-text MyProject\n }\n get-button Finish | click\n}\n\nrestart-aut\n\nwait-until-eclipse-is-ready\n\nget-view \"Package Explorer\" | get-tree | get-property itemCount | equals 1 | verify-true" + }); + addAnnotation + (getLastMessageBoxEClass, + source, + new String[] { + "description", "Gets last shown MessageBox info. If MessageBox was not shown, then error is returned.", + "returns", "MessageBoxInfo", + "example", "set-dialog-result MessageBox 128\r\nget-view \"Q7 Quality Mockups\" | get-group \"MessageBox Test\" | get-button \"Message Box with YES/NO Buttons\" | click\r\nwith [get-last-message-box] {\r\n get-property title | equals \"Warning\" | verify-true\r\n get-property message | equals \"Yes or No?\" | verify-true\r\n}" }); } diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/util/TeslaAdapterFactory.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/util/TeslaAdapterFactory.java index 81f16c410..59dd463c4 100644 --- a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/util/TeslaAdapterFactory.java +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/util/TeslaAdapterFactory.java @@ -77,6 +77,7 @@ import org.eclipse.rcptt.tesla.ecl.model.GetGroup; import org.eclipse.rcptt.tesla.ecl.model.GetItem; import org.eclipse.rcptt.tesla.ecl.model.GetItems; import org.eclipse.rcptt.tesla.ecl.model.GetLabel; +import org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox; import org.eclipse.rcptt.tesla.ecl.model.GetLeftRuler; import org.eclipse.rcptt.tesla.ecl.model.GetLink; import org.eclipse.rcptt.tesla.ecl.model.GetList; @@ -114,6 +115,7 @@ import org.eclipse.rcptt.tesla.ecl.model.IsEmpty; import org.eclipse.rcptt.tesla.ecl.model.KeyType; import org.eclipse.rcptt.tesla.ecl.model.Matches; import org.eclipse.rcptt.tesla.ecl.model.Maximize; +import org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo; import org.eclipse.rcptt.tesla.ecl.model.Minimize; import org.eclipse.rcptt.tesla.ecl.model.Mouse; import org.eclipse.rcptt.tesla.ecl.model.OpenDeclaration; @@ -796,6 +798,14 @@ public class TeslaAdapterFactory extends AdapterFactoryImpl { return createRestartAutAdapter(); } @Override + public Adapter caseMessageBoxInfo(MessageBoxInfo object) { + return createMessageBoxInfoAdapter(); + } + @Override + public Adapter caseGetLastMessageBox(GetLastMessageBox object) { + return createGetLastMessageBoxAdapter(); + } + @Override public Adapter caseCommand(Command object) { return createCommandAdapter(); } @@ -2840,6 +2850,34 @@ public class TeslaAdapterFactory extends AdapterFactoryImpl { } /** + * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo <em>Message Box Info</em>}'. + * <!-- begin-user-doc --> + * 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. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo + * @generated + */ + public Adapter createMessageBoxInfoAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox <em>Get Last Message Box</em>}'. + * <!-- begin-user-doc --> + * 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. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox + * @generated + */ + public Adapter createGetLastMessageBoxAdapter() { + return null; + } + + /** * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.ecl.core.Command <em>Command</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; diff --git a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/util/TeslaSwitch.java b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/util/TeslaSwitch.java index 34de77c27..458a2bae5 100644 --- a/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/util/TeslaSwitch.java +++ b/core/org.eclipse.rcptt.tesla.ecl/gen-src/org/eclipse/rcptt/tesla/ecl/model/util/TeslaSwitch.java @@ -77,6 +77,7 @@ import org.eclipse.rcptt.tesla.ecl.model.GetGroup; import org.eclipse.rcptt.tesla.ecl.model.GetItem; import org.eclipse.rcptt.tesla.ecl.model.GetItems; import org.eclipse.rcptt.tesla.ecl.model.GetLabel; +import org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox; import org.eclipse.rcptt.tesla.ecl.model.GetLeftRuler; import org.eclipse.rcptt.tesla.ecl.model.GetLink; import org.eclipse.rcptt.tesla.ecl.model.GetList; @@ -114,6 +115,7 @@ import org.eclipse.rcptt.tesla.ecl.model.IsEmpty; import org.eclipse.rcptt.tesla.ecl.model.KeyType; import org.eclipse.rcptt.tesla.ecl.model.Matches; import org.eclipse.rcptt.tesla.ecl.model.Maximize; +import org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo; import org.eclipse.rcptt.tesla.ecl.model.Minimize; import org.eclipse.rcptt.tesla.ecl.model.Mouse; import org.eclipse.rcptt.tesla.ecl.model.OpenDeclaration; @@ -1325,6 +1327,19 @@ public class TeslaSwitch<T> { if (result == null) result = defaultCase(theEObject); return result; } + case TeslaPackage.MESSAGE_BOX_INFO: { + MessageBoxInfo messageBoxInfo = (MessageBoxInfo)theEObject; + T result = caseMessageBoxInfo(messageBoxInfo); + if (result == null) result = defaultCase(theEObject); + return result; + } + case TeslaPackage.GET_LAST_MESSAGE_BOX: { + GetLastMessageBox getLastMessageBox = (GetLastMessageBox)theEObject; + T result = caseGetLastMessageBox(getLastMessageBox); + if (result == null) result = caseCommand(getLastMessageBox); + if (result == null) result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } } @@ -3490,6 +3505,36 @@ public class TeslaSwitch<T> { } /** + * Returns the result of interpreting the object as an instance of '<em>Message Box Info</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Message Box Info</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMessageBoxInfo(MessageBoxInfo object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Get Last Message Box</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Get Last Message Box</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGetLastMessageBox(GetLastMessageBox object) { + return null; + } + + /** * Returns the result of interpreting the object as an instance of '<em>Command</em>'. * <!-- begin-user-doc --> * This implementation returns null; diff --git a/core/org.eclipse.rcptt.tesla.ecl/model/tesla.ecore b/core/org.eclipse.rcptt.tesla.ecl/model/tesla.ecore index 7f346f4f1..2dd8df399 100644 --- a/core/org.eclipse.rcptt.tesla.ecl/model/tesla.ecore +++ b/core/org.eclipse.rcptt.tesla.ecl/model/tesla.ecore @@ -1732,6 +1732,17 @@ <details key="example" value="get-view "Package Explorer" | get-tree | get-menu "New/Java Project" | click
with [get-window "New Java Project"] {
 with [get-editbox -after [get-label "Project name:"]] {
 set-text MyProjec
 set-text MyProject
 }
 get-button Finish | click
}

restart-aut

wait-until-eclipse-is-ready

get-view "Package Explorer" | get-tree | get-property itemCount | equals 1 | verify-true"/> </eAnnotations> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="MessageBoxInfo"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="message" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="GetLastMessageBox" eSuperTypes="../../org.eclipse.rcptt.ecl.core/model/ecl.ecore#//Command"> + <eAnnotations source="http://www.eclipse.org/ecl/docs"> + <details key="description" value="Gets last shown MessageBox info. If MessageBox was not shown, then error is returned."/> + <details key="returns" value="MessageBoxInfo"/> + <details key="example" value="set-dialog-result MessageBox 128
get-view "Q7 Quality Mockups" | get-group "MessageBox Test" | get-button "Message Box with YES/NO Buttons" | click
with [get-last-message-box] {
 get-property title | equals "Warning" | verify-true
 get-property message | equals "Yes or No?" | verify-true
}"/> + </eAnnotations> + </eClassifiers> <eSubpackages name="diagram" nsURI="http://eclipse.org/rcptt/tesla/ecl/diagram" nsPrefix="org.eclipse.rcptt.ecl.tesla.diagram"> <eClassifiers xsi:type="ecore:EClass" name="GetDiagram" eSuperTypes="#//Selector"> diff --git a/core/org.eclipse.rcptt.tesla.ecl/pom.xml b/core/org.eclipse.rcptt.tesla.ecl/pom.xml index f44e70ebc..fcf197580 100644 --- a/core/org.eclipse.rcptt.tesla.ecl/pom.xml +++ b/core/org.eclipse.rcptt.tesla.ecl/pom.xml @@ -8,6 +8,6 @@ </parent> <groupId>org.eclipse.rcptt</groupId> <artifactId>org.eclipse.rcptt.tesla.ecl</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.1.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/META-INF/MANIFEST.MF b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/META-INF/MANIFEST.MF index 1f174bd9f..cbe2f0d68 100644 --- a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/META-INF/MANIFEST.MF +++ b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: RCPTT Runtime ECL Implementation Bundle-SymbolicName: org.eclipse.rcptt.tesla.ecl.impl;singleton:=true -Bundle-Version: 2.0.0.qualifier +Bundle-Version: 2.1.0.qualifier Bundle-Vendor: Eclipse RCP Testing Tool Project Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: org.eclipse.rcptt.tesla.ecl;bundle-version="[2.0.0,3.0.0)", diff --git a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/plugin.xml b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/plugin.xml index 0d762cfd9..c98fa7d5e 100644 --- a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/plugin.xml +++ b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/plugin.xml @@ -760,6 +760,11 @@ name="GetWidgetDetails" namespace="http://eclipse.org/rcptt/tesla/ecl"> </scriptlet> + <scriptlet + class="org.eclipse.rcptt.tesla.ecl.internal.impl.commands.GetLastMessageBoxService" + name="GetLastMessageBox" + namespace="http://eclipse.org/rcptt/tesla/ecl"> + </scriptlet> </extension> <extension point="org.eclipse.rcptt.tesla.swt.jobCollector"> diff --git a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/pom.xml b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/pom.xml index 9621b54fe..e3cee90b8 100644 --- a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/pom.xml +++ b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/pom.xml @@ -8,6 +8,6 @@ </parent> <groupId>org.eclipse.rcptt.tesla.ecl</groupId> <artifactId>org.eclipse.rcptt.tesla.ecl.impl</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.1.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/src/org/eclipse/rcptt/tesla/ecl/internal/impl/commands/GetLastMessageBoxService.java b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/src/org/eclipse/rcptt/tesla/ecl/internal/impl/commands/GetLastMessageBoxService.java new file mode 100644 index 000000000..75af3d0fa --- /dev/null +++ b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/src/org/eclipse/rcptt/tesla/ecl/internal/impl/commands/GetLastMessageBoxService.java @@ -0,0 +1,26 @@ +package org.eclipse.rcptt.tesla.ecl.internal.impl.commands; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.rcptt.ecl.core.Command; +import org.eclipse.rcptt.ecl.runtime.ICommandService; +import org.eclipse.rcptt.ecl.runtime.IProcess; +import org.eclipse.rcptt.tesla.ecl.internal.impl.TeslaImplPlugin; +import org.eclipse.rcptt.tesla.ecl.model.GetLastMessageBox; +import org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo; +import org.eclipse.rcptt.tesla.swt.dialogs.SWTDialogManager; + +public class GetLastMessageBoxService implements ICommandService { + public IStatus service(Command command, IProcess context) throws CoreException { + if (!(command instanceof GetLastMessageBox)) { + return Status.CANCEL_STATUS; + } + final MessageBoxInfo info = SWTDialogManager.getMessageBoxInfo(); + if (info == null) { + return TeslaImplPlugin.err("Message box info is absent."); + } + context.getOutput().write(info); + return Status.OK_STATUS; + } +} diff --git a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/src/org/eclipse/rcptt/tesla/ecl/internal/impl/commands/GetPropertyService.java b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/src/org/eclipse/rcptt/tesla/ecl/internal/impl/commands/GetPropertyService.java index e23d91be6..dfbe4c6b9 100644 --- a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/src/org/eclipse/rcptt/tesla/ecl/internal/impl/commands/GetPropertyService.java +++ b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.impl/src/org/eclipse/rcptt/tesla/ecl/internal/impl/commands/GetPropertyService.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.rcptt.tesla.ecl.internal.impl.commands; +import java.lang.reflect.Field; import java.util.AbstractList; import org.eclipse.core.runtime.CoreException; @@ -29,6 +30,7 @@ import org.eclipse.rcptt.tesla.ecl.impl.TeslaBridge; import org.eclipse.rcptt.tesla.ecl.internal.impl.TeslaImplPlugin; import org.eclipse.rcptt.tesla.ecl.model.ControlHandler; import org.eclipse.rcptt.tesla.ecl.model.GetProperty; +import org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo; import org.eclipse.rcptt.tesla.ecl.model.TeslaFactory; import org.eclipse.rcptt.tesla.ecl.model.VerifyHandler; @@ -38,18 +40,28 @@ public class GetPropertyService implements ICommandService { throws InterruptedException, CoreException { TeslaBridge.waitDelay(); GetProperty gp = (GetProperty) command; - if (gp.isRaw()) { - return serviceRawGet(gp, context); - } - VerifyHandler handler = TeslaFactory.eINSTANCE.createVerifyHandler(); EObject object = gp.getObject(); if (object instanceof ControlHandler) { + if (gp.isRaw()) { + return serviceRawGet(gp, context); + } + VerifyHandler handler = TeslaFactory.eINSTANCE.createVerifyHandler(); Element element = TeslaBridge.find((ControlHandler) object); handler.setElement(element); handler.setAttribute(gp.getName()); handler.setIndex(gp.getIndex()); context.getOutput().write(handler); return Status.OK_STATUS; + } else if (object instanceof MessageBoxInfo) { + final MessageBoxInfo info = (MessageBoxInfo) object; + try { + final Field field = info.getClass().getDeclaredField(gp.getName()); + field.setAccessible(true); + context.getOutput().write(field.get(info).toString()); + } catch (Exception e) { + return propertyGetError(gp.getName()); + } + return Status.OK_STATUS; } return propertyGetError(gp.getName()); } diff --git a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.runtime-feature/feature.xml b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.runtime-feature/feature.xml index d6c9a3129..6b6f503b6 100644 --- a/runtime/ecl/org.eclipse.rcptt.tesla.ecl.runtime-feature/feature.xml +++ b/runtime/ecl/org.eclipse.rcptt.tesla.ecl.runtime-feature/feature.xml @@ -19,7 +19,7 @@ <requires> <import feature="org.eclipse.rcptt.tesla" version="2.0.0.qualifier"/> - <import feature="org.eclipse.rcptt.tesla.runtime" version="2.0.0.qualifier"/> + <import feature="org.eclipse.rcptt.tesla.runtime" version="2.1.0.qualifier"/> <import feature="org.eclipse.rcptt.ecl.core" version="2.1.0.qualifier"/> <import plugin="org.eclipse.rcptt.tesla.ecl"/> </requires> @@ -28,7 +28,7 @@ id="org.eclipse.rcptt.tesla.ecl.impl" download-size="0" install-size="0" - version="2.0.0.qualifier" + version="2.1.0.qualifier" unpack="false"/> </feature> diff --git a/runtime/org.eclipse.rcptt.runtime-feature/feature.xml b/runtime/org.eclipse.rcptt.runtime-feature/feature.xml index 3dc5fcfc6..697b56958 100644 --- a/runtime/org.eclipse.rcptt.runtime-feature/feature.xml +++ b/runtime/org.eclipse.rcptt.runtime-feature/feature.xml @@ -19,7 +19,7 @@ <requires> <import feature="org.eclipse.rcptt.tesla" version="2.0.0.qualifier"/> - <import feature="org.eclipse.rcptt.tesla.runtime" version="2.0.0.qualifier"/> + <import feature="org.eclipse.rcptt.tesla.runtime" version="2.1.0.qualifier"/> <import feature="org.eclipse.rcptt.tesla.ecl" version="2.1.0.qualifier"/> <import feature="org.eclipse.rcptt.tesla.ecl.runtime" version="2.0.0.qualifier"/> <import feature="org.eclipse.rcptt.ecl.server" version="2.0.0.qualifier"/> @@ -60,14 +60,14 @@ id="org.eclipse.rcptt.tesla.ecl" download-size="0" install-size="0" - version="2.0.0.qualifier" + version="2.1.0.qualifier" unpack="false"/> <plugin id="org.eclipse.rcptt.tesla.ecl.impl" download-size="0" install-size="0" - version="2.0.0.qualifier" + version="2.1.0.qualifier" unpack="false"/> <plugin diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.runtime-feature/feature.xml b/runtime/tesla/org.eclipse.rcptt.tesla.runtime-feature/feature.xml index 5a937dba7..4edd3f072 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.runtime-feature/feature.xml +++ b/runtime/tesla/org.eclipse.rcptt.tesla.runtime-feature/feature.xml @@ -2,7 +2,7 @@ <feature id="org.eclipse.rcptt.tesla.runtime" label="RCPTT Runtime Eclipse 3.x" - version="2.0.0.qualifier" + version="2.1.0.qualifier" provider-name="%providerName"> <description> @@ -162,7 +162,7 @@ id="org.eclipse.rcptt.tesla.swt.aspects" download-size="0" install-size="0" - version="2.0.0.qualifier" + version="2.1.0.qualifier" unpack="false"/> <plugin diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.runtime-feature/pom.xml b/runtime/tesla/org.eclipse.rcptt.tesla.runtime-feature/pom.xml index 4dd3db7f5..21663569e 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.runtime-feature/pom.xml +++ b/runtime/tesla/org.eclipse.rcptt.tesla.runtime-feature/pom.xml @@ -8,6 +8,6 @@ </parent> <groupId>org.eclipse.rcptt.tesla.features</groupId> <artifactId>org.eclipse.rcptt.tesla.runtime</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.1.0-SNAPSHOT</version> <packaging>eclipse-feature</packaging> </project> diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.runtime.e4x-feature/feature.xml b/runtime/tesla/org.eclipse.rcptt.tesla.runtime.e4x-feature/feature.xml index f8850a883..b309ff3ee 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.runtime.e4x-feature/feature.xml +++ b/runtime/tesla/org.eclipse.rcptt.tesla.runtime.e4x-feature/feature.xml @@ -2,7 +2,7 @@ <feature id="org.eclipse.rcptt.tesla.runtime" label="RCPTT Runtime Eclipse 4.x" - version="2.0.0.qualifier" + version="2.1.0.qualifier" provider-name="%providerName"> <description> @@ -266,7 +266,7 @@ id="org.eclipse.rcptt.tesla.swt.aspects" download-size="0" install-size="0" - version="2.0.0.qualifier" + version="2.1.0.qualifier" unpack="false"/> <plugin diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.runtime.e4x-feature/pom.xml b/runtime/tesla/org.eclipse.rcptt.tesla.runtime.e4x-feature/pom.xml index 5adde017b..d6c248197 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.runtime.e4x-feature/pom.xml +++ b/runtime/tesla/org.eclipse.rcptt.tesla.runtime.e4x-feature/pom.xml @@ -8,6 +8,6 @@ </parent> <groupId>org.eclipse.rcptt.tesla.e4x.features</groupId> <artifactId>org.eclipse.rcptt.tesla.runtime</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.1.0-SNAPSHOT</version> <packaging>eclipse-feature</packaging> </project> diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/META-INF/MANIFEST.MF b/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/META-INF/MANIFEST.MF index 5efb8c011..a8b189239 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/META-INF/MANIFEST.MF +++ b/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: RCPTT Runtime SWT Support Aspects Bundle-SymbolicName: org.eclipse.rcptt.tesla.swt.aspects;singleton:=true -Bundle-Version: 2.0.0.qualifier +Bundle-Version: 2.1.0.qualifier Bundle-Vendor: Eclipse RCP Testing Tool Project Require-Bundle: org.aspectj.runtime;visibility:=reexport, org.eclipse.swt, @@ -10,7 +10,8 @@ Require-Bundle: org.aspectj.runtime;visibility:=reexport, org.eclipse.rcptt.tesla.core.context;bundle-version="[2.0.0,3.0.0)", org.eclipse.rcptt.tesla.core.am;bundle-version="[2.0.0,3.0.0)", org.eclipse.rcptt.watson.core;bundle-version="[2.0.0,3.0.0)", - org.eclipse.rcptt.util;bundle-version="[2.0.0,3.0.0)" + org.eclipse.rcptt.util;bundle-version="[2.0.0,3.0.0)", + org.eclipse.rcptt.tesla.ecl onEnvironment: JavaSE-1.6 Import-Package: org.osgi.framework Eclipse-SupplementBundle: org.eclipse.swt diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/pom.xml b/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/pom.xml index ab8dd3325..5955b471b 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/pom.xml +++ b/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/pom.xml @@ -8,7 +8,7 @@ </parent> <groupId>org.eclipse.rcptt.tesla</groupId> <artifactId>org.eclipse.rcptt.tesla.swt.aspects</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.1.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> <dependencies> <dependency> diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/src/org/eclipse/rcptt/tesla/swt/aspects/DisplayAspect.aj b/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/src/org/eclipse/rcptt/tesla/swt/aspects/DisplayAspect.aj index 7a0058f6b..4975454aa 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/src/org/eclipse/rcptt/tesla/swt/aspects/DisplayAspect.aj +++ b/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/src/org/eclipse/rcptt/tesla/swt/aspects/DisplayAspect.aj @@ -169,6 +169,7 @@ public aspect DisplayAspect { if (!TeslaEventManager.getManager().getShowingAlert()) { try { if (TeslaEventManager.getManager().hasListeners()) { + SWTDialogManager.setMessageBoxInfo(dialog); if (SWTDialogManager.hasMessageBoxInfo()) { return SWTDialogManager.getMessageBoxResult(); } diff --git a/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/src/org/eclipse/rcptt/tesla/swt/dialogs/SWTDialogManager.java b/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/src/org/eclipse/rcptt/tesla/swt/dialogs/SWTDialogManager.java index be63d6671..b6ce2e7cf 100644 --- a/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/src/org/eclipse/rcptt/tesla/swt/dialogs/SWTDialogManager.java +++ b/runtime/tesla/org.eclipse.rcptt.tesla.swt.aspects/src/org/eclipse/rcptt/tesla/swt/dialogs/SWTDialogManager.java @@ -15,13 +15,17 @@ import java.util.List; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; +import org.eclipse.rcptt.tesla.ecl.model.MessageBoxInfo; +import org.eclipse.rcptt.tesla.ecl.model.TeslaFactory; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.widgets.MessageBox; public class SWTDialogManager { private static List<String> fileDialogValues = new ArrayList<String>(); private static List<String> folderDialogValues = new ArrayList<String>(); private static List<Integer> messageBoxValues = new ArrayList<Integer>(); + private static MessageBoxInfo lastMessageBoxInfo = null; private static List<RGB> colorValues = new ArrayList<RGB>(); private static List<FontData> fontValues = new ArrayList<FontData>(); private static boolean cancelMessageBoxesDisplay = false; @@ -88,6 +92,10 @@ public class SWTDialogManager { public static Integer getMessageBoxResult() { return messageBoxValues.remove(0); } + + public static MessageBoxInfo getMessageBoxInfo() { + return lastMessageBoxInfo; + } public static void addFileDialogInfo(String value) { fileDialogValues.add(0, value); @@ -97,8 +105,14 @@ public class SWTDialogManager { folderDialogValues.add(0, value); } - public static void addMessageBoxInfo(int value) { - messageBoxValues.add(0, value); + public static void addMessageBoxInfo(int result) { + messageBoxValues.add(0, result); + } + + public static void setMessageBoxInfo(MessageBox dialog) { + lastMessageBoxInfo = TeslaFactory.eINSTANCE.createMessageBoxInfo(); + lastMessageBoxInfo.setTitle(dialog.getText()); + lastMessageBoxInfo.setMessage(dialog.getMessage()); } public static void addFontInfo(FontData value) { @@ -113,6 +127,7 @@ public class SWTDialogManager { fileDialogValues.clear(); folderDialogValues.clear(); messageBoxValues.clear(); + lastMessageBoxInfo = null; colorValues.clear(); fontValues.clear(); } |