Skip to content

Commit

Permalink
Allow users to add a description to the parameters of operations. Thi…
Browse files Browse the repository at this point in the history
…s commit closes eclipse-vorto#119

Signed-off-by: Erle Czar Mantos <[email protected]>
  • Loading branch information
Erle Czar Mantos committed Mar 30, 2016
1 parent 9618e25 commit c18c0d2
Show file tree
Hide file tree
Showing 14 changed files with 195 additions and 56 deletions.
1 change: 1 addition & 0 deletions bundles/org.eclipse.vorto.core/model/Functionblock.ecore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<eClassifiers xsi:type="ecore:EClass" name="Param">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="multiplicity" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Event">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,23 @@ public interface FunctionblockPackage extends EPackage {
*/
int PARAM__NAME = 1;

/**
* The feature id for the '<em><b>Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PARAM__DESCRIPTION = 2;

/**
* The number of structural features of the '<em>Param</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PARAM_FEATURE_COUNT = 2;
int PARAM_FEATURE_COUNT = 3;

/**
* The meta object id for the '{@link org.eclipse.vorto.core.api.model.functionblock.impl.PrimitiveParamImpl <em>Primitive Param</em>}' class.
Expand Down Expand Up @@ -536,6 +545,15 @@ public interface FunctionblockPackage extends EPackage {
*/
int PRIMITIVE_PARAM__NAME = PARAM__NAME;

/**
* The feature id for the '<em><b>Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int PRIMITIVE_PARAM__DESCRIPTION = PARAM__DESCRIPTION;

/**
* The feature id for the '<em><b>Type</b></em>' attribute.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -582,6 +600,15 @@ public interface FunctionblockPackage extends EPackage {
*/
int REF_PARAM__NAME = PARAM__NAME;

/**
* The feature id for the '<em><b>Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int REF_PARAM__DESCRIPTION = PARAM__DESCRIPTION;

/**
* The feature id for the '<em><b>Type</b></em>' reference.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -1000,6 +1027,17 @@ public interface FunctionblockPackage extends EPackage {
*/
EAttribute getParam_Name();

/**
* Returns the meta object for the attribute '{@link org.eclipse.vorto.core.api.model.functionblock.Param#getDescription <em>Description</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Description</em>'.
* @see org.eclipse.vorto.core.api.model.functionblock.Param#getDescription()
* @see #getParam()
* @generated
*/
EAttribute getParam_Description();

/**
* Returns the meta object for class '{@link org.eclipse.vorto.core.api.model.functionblock.Event <em>Event</em>}'.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -1350,6 +1388,14 @@ interface Literals {
*/
EAttribute PARAM__NAME = eINSTANCE.getParam_Name();

/**
* The meta object literal for the '<em><b>Description</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute PARAM__DESCRIPTION = eINSTANCE.getParam_Description();

/**
* The meta object literal for the '{@link org.eclipse.vorto.core.api.model.functionblock.impl.EventImpl <em>Event</em>}' class.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* <ul>
* <li>{@link org.eclipse.vorto.core.api.model.functionblock.Param#isMultiplicity <em>Multiplicity</em>}</li>
* <li>{@link org.eclipse.vorto.core.api.model.functionblock.Param#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.vorto.core.api.model.functionblock.Param#getDescription <em>Description</em>}</li>
* </ul>
*
* @see org.eclipse.vorto.core.api.model.functionblock.FunctionblockPackage#getParam()
Expand Down Expand Up @@ -74,4 +75,30 @@ public interface Param extends EObject {
*/
void setName(String value);

/**
* Returns the value of the '<em><b>Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Description</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Description</em>' attribute.
* @see #setDescription(String)
* @see org.eclipse.vorto.core.api.model.functionblock.FunctionblockPackage#getParam_Description()
* @model
* @generated
*/
String getDescription();

/**
* Sets the value of the '{@link org.eclipse.vorto.core.api.model.functionblock.Param#getDescription <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Description</em>' attribute.
* @see #getDescription()
* @generated
*/
void setDescription(String value);

} // Param
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public String toString() {
if (eIsProxy()) return super.toString();

StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(" (name: "); //$NON-NLS-1$
result.append(name);
result.append(')');
return result.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public EObject create(EClass eClass) {
case FunctionblockPackage.PARAM: return createParam();
case FunctionblockPackage.EVENT: return createEvent();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,17 +615,17 @@ public String toString() {
if (eIsProxy()) return super.toString();

StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(" (name: "); //$NON-NLS-1$
result.append(name);
result.append(", namespace: ");
result.append(", namespace: "); //$NON-NLS-1$
result.append(namespace);
result.append(", version: ");
result.append(", version: "); //$NON-NLS-1$
result.append(version);
result.append(", description: ");
result.append(", description: "); //$NON-NLS-1$
result.append(description);
result.append(", displayname: ");
result.append(", displayname: "); //$NON-NLS-1$
result.append(displayname);
result.append(", category: ");
result.append(", category: "); //$NON-NLS-1$
result.append(category);
result.append(')');
return result.toString();
Expand Down
Loading

0 comments on commit c18c0d2

Please sign in to comment.