Added 'get-status-message' and 'get-status-trace' command
Signed-off-by: Viktoria Dlugopolskaya <viksnsk@gmail.com>
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/CommandsFactory.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/CommandsFactory.java
index b55dfbc..fcfeb1e 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/CommandsFactory.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/CommandsFactory.java
@@ -192,6 +192,24 @@
FindInWorkspace createFindInWorkspace();
/**
+ * Returns a new object of class '<em>Get Status Message</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Get Status Message</em>'.
+ * @generated
+ */
+ GetStatusMessage createGetStatusMessage();
+
+ /**
+ * Returns a new object of class '<em>Get Status Trace</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Get Status Trace</em>'.
+ * @generated
+ */
+ GetStatusTrace createGetStatusTrace();
+
+ /**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/CommandsPackage.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/CommandsPackage.java
index a4cc60a..d197944 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/CommandsPackage.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/CommandsPackage.java
@@ -14,6 +14,7 @@
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
import org.eclipse.rcptt.ecl.core.CorePackage;
/**
@@ -896,6 +897,99 @@
/**
+ * The meta object id for the '{@link org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusMessageImpl <em>Get Status Message</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusMessageImpl
+ * @see org.eclipse.rcptt.ecl.platform.commands.impl.CommandsPackageImpl#getGetStatusMessage()
+ * @generated
+ */
+ int GET_STATUS_MESSAGE = 18;
+
+ /**
+ * The feature id for the '<em><b>Host</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GET_STATUS_MESSAGE__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_STATUS_MESSAGE__BINDINGS = CorePackage.COMMAND__BINDINGS;
+
+ /**
+ * The feature id for the '<em><b>Status</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GET_STATUS_MESSAGE__STATUS = CorePackage.COMMAND_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Get Status Message</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GET_STATUS_MESSAGE_FEATURE_COUNT = CorePackage.COMMAND_FEATURE_COUNT + 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusTraceImpl <em>Get Status Trace</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusTraceImpl
+ * @see org.eclipse.rcptt.ecl.platform.commands.impl.CommandsPackageImpl#getGetStatusTrace()
+ * @generated
+ */
+ int GET_STATUS_TRACE = 19;
+
+ /**
+ * The feature id for the '<em><b>Host</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GET_STATUS_TRACE__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_STATUS_TRACE__BINDINGS = CorePackage.COMMAND__BINDINGS;
+
+ /**
+ * The feature id for the '<em><b>Status</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GET_STATUS_TRACE__STATUS = CorePackage.COMMAND_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Get Status Trace</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GET_STATUS_TRACE_FEATURE_COUNT = CorePackage.COMMAND_FEATURE_COUNT + 1;
+
+
+ /**
* Returns the meta object for class '{@link org.eclipse.rcptt.ecl.platform.commands.ListPlugins <em>List Plugins</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1274,6 +1368,48 @@
EAttribute getFindInWorkspace_All();
/**
+ * Returns the meta object for class '{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage <em>Get Status Message</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Get Status Message</em>'.
+ * @see org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage
+ * @generated
+ */
+ EClass getGetStatusMessage();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage#getStatus <em>Status</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Status</em>'.
+ * @see org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage#getStatus()
+ * @see #getGetStatusMessage()
+ * @generated
+ */
+ EReference getGetStatusMessage_Status();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace <em>Get Status Trace</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Get Status Trace</em>'.
+ * @see org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace
+ * @generated
+ */
+ EClass getGetStatusTrace();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace#getStatus <em>Status</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Status</em>'.
+ * @see org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace#getStatus()
+ * @see #getGetStatusTrace()
+ * @generated
+ */
+ EReference getGetStatusTrace_Status();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1619,6 +1755,42 @@
*/
EAttribute FIND_IN_WORKSPACE__ALL = eINSTANCE.getFindInWorkspace_All();
+ /**
+ * The meta object literal for the '{@link org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusMessageImpl <em>Get Status Message</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusMessageImpl
+ * @see org.eclipse.rcptt.ecl.platform.commands.impl.CommandsPackageImpl#getGetStatusMessage()
+ * @generated
+ */
+ EClass GET_STATUS_MESSAGE = eINSTANCE.getGetStatusMessage();
+
+ /**
+ * The meta object literal for the '<em><b>Status</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GET_STATUS_MESSAGE__STATUS = eINSTANCE.getGetStatusMessage_Status();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusTraceImpl <em>Get Status Trace</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusTraceImpl
+ * @see org.eclipse.rcptt.ecl.platform.commands.impl.CommandsPackageImpl#getGetStatusTrace()
+ * @generated
+ */
+ EClass GET_STATUS_TRACE = eINSTANCE.getGetStatusTrace();
+
+ /**
+ * The meta object literal for the '<em><b>Status</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GET_STATUS_TRACE__STATUS = eINSTANCE.getGetStatusTrace_Status();
+
}
} //CommandsPackage
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/GetStatusMessage.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/GetStatusMessage.java
new file mode 100644
index 0000000..a7c69e4
--- /dev/null
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/GetStatusMessage.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 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.ecl.platform.commands;
+
+import org.eclipse.rcptt.ecl.core.Command;
+import org.eclipse.rcptt.ecl.core.ProcessStatus;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Get Status Message</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage#getStatus <em>Status</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.rcptt.ecl.platform.commands.CommandsPackage#getGetStatusMessage()
+ * @model annotation="http://www.eclipse.org/ecl/docs description='Takes ProcessStatus from input and returns first root cause.' returns='String with first root cause.' example='try {\n\tthrow-error \"Error ocurred\"\n} -error [val e] -catch {\n\t$e | get-status-trace | log\n}'"
+ * @generated
+ */
+public interface GetStatusMessage extends Command {
+ /**
+ * Returns the value of the '<em><b>Status</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Status</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Status</em>' reference.
+ * @see #setStatus(ProcessStatus)
+ * @see org.eclipse.rcptt.ecl.platform.commands.CommandsPackage#getGetStatusMessage_Status()
+ * @model required="true"
+ * @generated
+ */
+ ProcessStatus getStatus();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage#getStatus <em>Status</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Status</em>' reference.
+ * @see #getStatus()
+ * @generated
+ */
+ void setStatus(ProcessStatus value);
+
+} // GetStatusMessage
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/GetStatusTrace.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/GetStatusTrace.java
new file mode 100644
index 0000000..cdf181a
--- /dev/null
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/GetStatusTrace.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 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.ecl.platform.commands;
+
+import org.eclipse.rcptt.ecl.core.Command;
+import org.eclipse.rcptt.ecl.core.ProcessStatus;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Get Status Trace</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace#getStatus <em>Status</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.rcptt.ecl.platform.commands.CommandsPackage#getGetStatusTrace()
+ * @model annotation="http://www.eclipse.org/ecl/docs description='Takes ProcessStatus from input and returns trace.' returns='String with status trace.' example='try {\n\tthrow-error \"Error ocurred\"\n} -error [val e] -catch {\n\t$e | get-status-trace | log\n}'"
+ * @generated
+ */
+public interface GetStatusTrace extends Command {
+ /**
+ * Returns the value of the '<em><b>Status</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Status</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Status</em>' reference.
+ * @see #setStatus(ProcessStatus)
+ * @see org.eclipse.rcptt.ecl.platform.commands.CommandsPackage#getGetStatusTrace_Status()
+ * @model required="true"
+ * @generated
+ */
+ ProcessStatus getStatus();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace#getStatus <em>Status</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Status</em>' reference.
+ * @see #getStatus()
+ * @generated
+ */
+ void setStatus(ProcessStatus value);
+
+} // GetStatusTrace
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/CommandsFactoryImpl.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/CommandsFactoryImpl.java
index 2dd7666..89dd6ad 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/CommandsFactoryImpl.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/CommandsFactoryImpl.java
@@ -82,6 +82,8 @@
case CommandsPackage.SUBSTITUTE_VARIABLES: return createSubstituteVariables();
case CommandsPackage.GET_WORKSPACE_LOCATION: return createGetWorkspaceLocation();
case CommandsPackage.FIND_IN_WORKSPACE: return createFindInWorkspace();
+ case CommandsPackage.GET_STATUS_MESSAGE: return createGetStatusMessage();
+ case CommandsPackage.GET_STATUS_TRACE: return createGetStatusTrace();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -272,6 +274,26 @@
* <!-- end-user-doc -->
* @generated
*/
+ public GetStatusMessage createGetStatusMessage() {
+ GetStatusMessageImpl getStatusMessage = new GetStatusMessageImpl();
+ return getStatusMessage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public GetStatusTrace createGetStatusTrace() {
+ GetStatusTraceImpl getStatusTrace = new GetStatusTraceImpl();
+ return getStatusTrace;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public CommandsPackage getCommandsPackage() {
return (CommandsPackage)getEPackage();
}
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/CommandsPackageImpl.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/CommandsPackageImpl.java
index 943fb2b..3f56310 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/CommandsPackageImpl.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/CommandsPackageImpl.java
@@ -18,6 +18,7 @@
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
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;
@@ -29,6 +30,8 @@
import org.eclipse.rcptt.ecl.platform.commands.Echo;
import org.eclipse.rcptt.ecl.platform.commands.FindInWorkspace;
import org.eclipse.rcptt.ecl.platform.commands.GetLog;
+import org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage;
+import org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace;
import org.eclipse.rcptt.ecl.platform.commands.GetWorkspaceLocation;
import org.eclipse.rcptt.ecl.platform.commands.Launch;
import org.eclipse.rcptt.ecl.platform.commands.ListFeatures;
@@ -178,6 +181,20 @@
private EClass findInWorkspaceEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass getStatusMessageEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass getStatusTraceEClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -567,6 +584,42 @@
}
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGetStatusMessage() {
+ return getStatusMessageEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGetStatusMessage_Status() {
+ return (EReference)getStatusMessageEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getGetStatusTrace() {
+ return getStatusTraceEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getGetStatusTrace_Status() {
+ return (EReference)getStatusTraceEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -647,6 +700,12 @@
findInWorkspaceEClass = createEClass(FIND_IN_WORKSPACE);
createEAttribute(findInWorkspaceEClass, FIND_IN_WORKSPACE__PATH);
createEAttribute(findInWorkspaceEClass, FIND_IN_WORKSPACE__ALL);
+
+ getStatusMessageEClass = createEClass(GET_STATUS_MESSAGE);
+ createEReference(getStatusMessageEClass, GET_STATUS_MESSAGE__STATUS);
+
+ getStatusTraceEClass = createEClass(GET_STATUS_TRACE);
+ createEReference(getStatusTraceEClass, GET_STATUS_TRACE__STATUS);
}
/**
@@ -699,6 +758,8 @@
substituteVariablesEClass.getESuperTypes().add(theCorePackage.getCommand());
getWorkspaceLocationEClass.getESuperTypes().add(theCorePackage.getCommand());
findInWorkspaceEClass.getESuperTypes().add(theCorePackage.getCommand());
+ getStatusMessageEClass.getESuperTypes().add(theCorePackage.getCommand());
+ getStatusTraceEClass.getESuperTypes().add(theCorePackage.getCommand());
// Initialize classes and features; add operations and parameters
initEClass(listPluginsEClass, ListPlugins.class, "ListPlugins", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -755,6 +816,12 @@
initEAttribute(getFindInWorkspace_Path(), theEcorePackage.getEString(), "path", "", 1, 1, FindInWorkspace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getFindInWorkspace_All(), theEcorePackage.getEBoolean(), "all", "false", 0, 1, FindInWorkspace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(getStatusMessageEClass, GetStatusMessage.class, "GetStatusMessage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getGetStatusMessage_Status(), theCorePackage.getProcessStatus(), null, "status", null, 1, 1, GetStatusMessage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(getStatusTraceEClass, GetStatusTrace.class, "GetStatusTrace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getGetStatusTrace_Status(), theCorePackage.getProcessStatus(), null, "status", null, 1, 1, GetStatusTrace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
// Create resource
createResource(eNS_URI);
@@ -952,6 +1019,22 @@
"returns", "list of matched paths",
"example", "find-in-workspace \"project/dir1.*/dir2/file.*.txt\"",
"recorded", "false"
+ });
+ addAnnotation
+ (getStatusMessageEClass,
+ source,
+ new String[] {
+ "description", "Takes ProcessStatus from input and returns first root cause.",
+ "returns", "String with first root cause.",
+ "example", "try {\n\tthrow-error \"Error ocurred\"\n} -error [val e] -catch {\n\t$e | get-status-trace | log\n}"
+ });
+ addAnnotation
+ (getStatusTraceEClass,
+ source,
+ new String[] {
+ "description", "Takes ProcessStatus from input and returns trace.",
+ "returns", "String with status trace.",
+ "example", "try {\n\tthrow-error \"Error ocurred\"\n} -error [val e] -catch {\n\t$e | get-status-trace | log\n}"
});
}
@@ -975,6 +1058,16 @@
(getEcho_Str(),
source,
new String[] {
+ });
+ addAnnotation
+ (getGetStatusMessage_Status(),
+ source,
+ new String[] {
+ });
+ addAnnotation
+ (getGetStatusTrace_Status(),
+ source,
+ new String[] {
});
}
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/GetStatusMessageImpl.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/GetStatusMessageImpl.java
new file mode 100644
index 0000000..210abc4
--- /dev/null
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/GetStatusMessageImpl.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 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.ecl.platform.commands.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.rcptt.ecl.core.ProcessStatus;
+import org.eclipse.rcptt.ecl.core.impl.CommandImpl;
+import org.eclipse.rcptt.ecl.platform.commands.CommandsPackage;
+import org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Get Status Message</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusMessageImpl#getStatus <em>Status</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class GetStatusMessageImpl extends CommandImpl implements GetStatusMessage {
+ /**
+ * The cached value of the '{@link #getStatus() <em>Status</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getStatus()
+ * @generated
+ * @ordered
+ */
+ protected ProcessStatus status;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GetStatusMessageImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return CommandsPackage.Literals.GET_STATUS_MESSAGE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ProcessStatus getStatus() {
+ if (status != null && status.eIsProxy()) {
+ InternalEObject oldStatus = (InternalEObject)status;
+ status = (ProcessStatus)eResolveProxy(oldStatus);
+ if (status != oldStatus) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommandsPackage.GET_STATUS_MESSAGE__STATUS, oldStatus, status));
+ }
+ }
+ return status;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ProcessStatus basicGetStatus() {
+ return status;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatus(ProcessStatus newStatus) {
+ ProcessStatus oldStatus = status;
+ status = newStatus;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.GET_STATUS_MESSAGE__STATUS, oldStatus, status));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case CommandsPackage.GET_STATUS_MESSAGE__STATUS:
+ if (resolve) return getStatus();
+ return basicGetStatus();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case CommandsPackage.GET_STATUS_MESSAGE__STATUS:
+ setStatus((ProcessStatus)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case CommandsPackage.GET_STATUS_MESSAGE__STATUS:
+ setStatus((ProcessStatus)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case CommandsPackage.GET_STATUS_MESSAGE__STATUS:
+ return status != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //GetStatusMessageImpl
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/GetStatusTraceImpl.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/GetStatusTraceImpl.java
new file mode 100644
index 0000000..0cec22a
--- /dev/null
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/impl/GetStatusTraceImpl.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 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.ecl.platform.commands.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.rcptt.ecl.core.ProcessStatus;
+import org.eclipse.rcptt.ecl.core.impl.CommandImpl;
+import org.eclipse.rcptt.ecl.platform.commands.CommandsPackage;
+import org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Get Status Trace</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.rcptt.ecl.platform.commands.impl.GetStatusTraceImpl#getStatus <em>Status</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class GetStatusTraceImpl extends CommandImpl implements GetStatusTrace {
+ /**
+ * The cached value of the '{@link #getStatus() <em>Status</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getStatus()
+ * @generated
+ * @ordered
+ */
+ protected ProcessStatus status;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected GetStatusTraceImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return CommandsPackage.Literals.GET_STATUS_TRACE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ProcessStatus getStatus() {
+ if (status != null && status.eIsProxy()) {
+ InternalEObject oldStatus = (InternalEObject)status;
+ status = (ProcessStatus)eResolveProxy(oldStatus);
+ if (status != oldStatus) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommandsPackage.GET_STATUS_TRACE__STATUS, oldStatus, status));
+ }
+ }
+ return status;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ProcessStatus basicGetStatus() {
+ return status;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatus(ProcessStatus newStatus) {
+ ProcessStatus oldStatus = status;
+ status = newStatus;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.GET_STATUS_TRACE__STATUS, oldStatus, status));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case CommandsPackage.GET_STATUS_TRACE__STATUS:
+ if (resolve) return getStatus();
+ return basicGetStatus();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case CommandsPackage.GET_STATUS_TRACE__STATUS:
+ setStatus((ProcessStatus)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case CommandsPackage.GET_STATUS_TRACE__STATUS:
+ setStatus((ProcessStatus)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case CommandsPackage.GET_STATUS_TRACE__STATUS:
+ return status != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //GetStatusTraceImpl
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/util/CommandsAdapterFactory.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/util/CommandsAdapterFactory.java
index 1955655..4b4956f 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/util/CommandsAdapterFactory.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/util/CommandsAdapterFactory.java
@@ -150,6 +150,14 @@
return createFindInWorkspaceAdapter();
}
@Override
+ public Adapter caseGetStatusMessage(GetStatusMessage object) {
+ return createGetStatusMessageAdapter();
+ }
+ @Override
+ public Adapter caseGetStatusTrace(GetStatusTrace object) {
+ return createGetStatusTraceAdapter();
+ }
+ @Override
public Adapter caseCommand(Command object) {
return createCommandAdapter();
}
@@ -426,6 +434,34 @@
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage <em>Get Status Message</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.ecl.platform.commands.GetStatusMessage
+ * @generated
+ */
+ public Adapter createGetStatusMessageAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace <em>Get Status Trace</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.ecl.platform.commands.GetStatusTrace
+ * @generated
+ */
+ public Adapter createGetStatusTraceAdapter() {
+ 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/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/util/CommandsSwitch.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/util/CommandsSwitch.java
index 42e9ae8..1cd67b9 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/util/CommandsSwitch.java
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/gen-src/org/eclipse/rcptt/ecl/platform/commands/util/CommandsSwitch.java
@@ -219,6 +219,20 @@
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case CommandsPackage.GET_STATUS_MESSAGE: {
+ GetStatusMessage getStatusMessage = (GetStatusMessage)theEObject;
+ T result = caseGetStatusMessage(getStatusMessage);
+ if (result == null) result = caseCommand(getStatusMessage);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case CommandsPackage.GET_STATUS_TRACE: {
+ GetStatusTrace getStatusTrace = (GetStatusTrace)theEObject;
+ T result = caseGetStatusTrace(getStatusTrace);
+ if (result == null) result = caseCommand(getStatusTrace);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default: return defaultCase(theEObject);
}
}
@@ -494,6 +508,36 @@
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Get Status Message</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 Status Message</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGetStatusMessage(GetStatusMessage object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Get Status Trace</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 Status Trace</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGetStatusTrace(GetStatusTrace 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/ecl/plugins/org.eclipse.rcptt.ecl.platform/model/commands.ecore b/ecl/plugins/org.eclipse.rcptt.ecl.platform/model/commands.ecore
index 02b5ea3..97d7065 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.platform/model/commands.ecore
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/model/commands.ecore
@@ -181,4 +181,26 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="all" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"
defaultValueLiteral="false"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="GetStatusMessage" eSuperTypes="../../org.eclipse.rcptt.ecl.core/model/ecl.ecore#//Command">
+ <eAnnotations source="http://www.eclipse.org/ecl/docs">
+ <details key="description" value="Takes ProcessStatus from input and returns first root cause."/>
+ <details key="returns" value="String with first root cause."/>
+ <details key="example" value="try {
	throw-error "Error ocurred"
} -error [val e] -catch {
	$e | get-status-trace | log
}"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="status" lowerBound="1"
+ eType="ecore:EClass ../../org.eclipse.rcptt.ecl.core/model/ecl.ecore#//ProcessStatus">
+ <eAnnotations source="http://www.eclipse.org/ecl/input"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="GetStatusTrace" eSuperTypes="../../org.eclipse.rcptt.ecl.core/model/ecl.ecore#//Command">
+ <eAnnotations source="http://www.eclipse.org/ecl/docs">
+ <details key="description" value="Takes ProcessStatus from input and returns trace."/>
+ <details key="returns" value="String with status trace."/>
+ <details key="example" value="try {
	throw-error "Error ocurred"
} -error [val e] -catch {
	$e | get-status-trace | log
}"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="status" lowerBound="1"
+ eType="ecore:EClass ../../org.eclipse.rcptt.ecl.core/model/ecl.ecore#//ProcessStatus">
+ <eAnnotations source="http://www.eclipse.org/ecl/input"/>
+ </eStructuralFeatures>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/plugin.xml b/ecl/plugins/org.eclipse.rcptt.ecl.platform/plugin.xml
index 4bfe861..e13ed70 100644
--- a/ecl/plugins/org.eclipse.rcptt.ecl.platform/plugin.xml
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/plugin.xml
@@ -119,6 +119,16 @@
name="FindInWorkspace"
namespace="http://www.eclipse.org/ecl/platform/commands.ecore">
</scriptlet>
+ <scriptlet
+ class="org.eclipse.rcptt.ecl.platform.internal.commands.GetStatusMessageService"
+ name="GetStatusMessage"
+ namespace="http://www.eclipse.org/ecl/platform/commands.ecore">
+ </scriptlet>
+ <scriptlet
+ class="org.eclipse.rcptt.ecl.platform.internal.commands.GetStatusTraceService"
+ name="GetStatusTrace"
+ namespace="http://www.eclipse.org/ecl/platform/commands.ecore">
+ </scriptlet>
</extension>
<extension
point="org.eclipse.rcptt.ecl.core.listenSource">
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/src/org/eclipse/rcptt/ecl/platform/internal/commands/GetStatusMessageService.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/src/org/eclipse/rcptt/ecl/platform/internal/commands/GetStatusMessageService.java
new file mode 100644
index 0000000..e846a58
--- /dev/null
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/src/org/eclipse/rcptt/ecl/platform/internal/commands/GetStatusMessageService.java
@@ -0,0 +1,37 @@
+package org.eclipse.rcptt.ecl.platform.internal.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.core.ProcessStatus;
+import org.eclipse.rcptt.ecl.platform.commands.GetStatusMessage;
+import org.eclipse.rcptt.ecl.runtime.ICommandService;
+import org.eclipse.rcptt.ecl.runtime.IProcess;
+
+public class GetStatusMessageService implements ICommandService {
+
+ public IStatus service(Command command, IProcess context)
+ throws InterruptedException, CoreException {
+ GetStatusMessage getStatusMessage = (GetStatusMessage) command;
+ ProcessStatus status = getStatusMessage.getStatus();
+ String message = getMessageFromStatus(status);
+ context.getOutput().write(message);
+ return Status.OK_STATUS;
+ }
+
+ public static String getMessageFromStatus(ProcessStatus status) {
+ while (!status.getChildren().isEmpty()) {
+ status = status.getChildren().get(0);
+ }
+ String message = "Unknown reason";
+ if (status.getMessage() != null
+ && !status.getMessage().trim().equals("")) {
+ message = status.getMessage();
+ } else if (status.getException() != null) {
+ message = status.getException().getMessage();
+ }
+ return message;
+ }
+
+}
diff --git a/ecl/plugins/org.eclipse.rcptt.ecl.platform/src/org/eclipse/rcptt/ecl/platform/internal/commands/GetStatusTraceService.java b/ecl/plugins/org.eclipse.rcptt.ecl.platform/src/org/eclipse/rcptt/ecl/platform/internal/commands/GetStatusTraceService.java
new file mode 100644
index 0000000..a81ab77
--- /dev/null
+++ b/ecl/plugins/org.eclipse.rcptt.ecl.platform/src/org/eclipse/rcptt/ecl/platform/internal/commands/GetStatusTraceService.java
@@ -0,0 +1,41 @@
+package org.eclipse.rcptt.ecl.platform.internal.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.core.ProcessStatus;
+import org.eclipse.rcptt.ecl.platform.commands.GetStatusTrace;
+import org.eclipse.rcptt.ecl.runtime.ICommandService;
+import org.eclipse.rcptt.ecl.runtime.IProcess;
+
+public class GetStatusTraceService implements ICommandService {
+
+ public IStatus service(Command command, IProcess context)
+ throws InterruptedException, CoreException {
+ GetStatusTrace getStatusTrace = (GetStatusTrace) command;
+ ProcessStatus status = getStatusTrace.getStatus();
+ String trace = getTraceFromStatus(status);
+ context.getOutput().write(trace);
+ return Status.OK_STATUS;
+ }
+
+ private static String getTraceFromStatus(ProcessStatus status) {
+ StringBuilder sb = new StringBuilder();
+ processTrace(sb, status);
+ return sb.toString();
+ }
+
+ private static void processTrace(StringBuilder sb, ProcessStatus status) {
+ if (status.getChildren().isEmpty()) {
+ String message = GetStatusMessageService.getMessageFromStatus(status);
+ sb.insert(0, String.format("%s\n", message));
+ } else {
+ sb.insert(0, String.format("\tat %s\n", status.getMessage()));
+ for (int i = status.getChildren().size() - 1; i >= 0; i--) {
+ processTrace(sb, status.getChildren().get(i));
+ }
+ }
+ }
+
+}