Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL grammar with yaml format and ROS2 support #182

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions plugins/de.fraunhofer.ipa.ros.edit/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,13 @@ _UI_Parameter_value_feature = Value
_UI_Package_fromGitRepo_feature = From Git Repo
_UI_Package_dependency_feature = Dependency
_UI_AmentPackage_type = Ament Package
_UI_InterfaceType_type = Interface Type
_UI_QualityOfService_type = Quality Of Service
_UI_InterfaceType_namespace_feature = Namespace
_UI_InterfaceType_name_feature = Name
_UI_InterfaceType_qos_feature = Qos
_UI_QualityOfService_QoSProfile_feature = Qo SProfile
_UI_QualityOfService_History_feature = History
_UI_QualityOfService_Depth_feature = Depth
_UI_QualityOfService_Reliability_feature = Reliability
_UI_QualityOfService_Durability_feature = Durability
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class ActionClientItemProvider extends NamespacedElementItemProvider {
public class ActionClientItemProvider extends InterfaceTypeItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class ActionServerItemProvider extends NamespacedElementItemProvider {
public class ActionServerItemProvider extends InterfaceTypeItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import ros.NamespacedElement;
import ros.InterfaceType;
import ros.RosFactory;
import ros.RosPackage;

/**
* This is the item provider adapter for a {@link ros.NamespacedElement} object.
* This is the item provider adapter for a {@link ros.InterfaceType} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class NamespacedElementItemProvider
public class InterfaceTypeItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
Expand All @@ -48,7 +48,7 @@ public class NamespacedElementItemProvider
* <!-- end-user-doc -->
* @generated
*/
public NamespacedElementItemProvider(AdapterFactory adapterFactory) {
public InterfaceTypeItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}

Expand All @@ -64,6 +64,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
super.getPropertyDescriptors(object);

addNamePropertyDescriptor(object);
addQosPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
Expand All @@ -79,9 +80,9 @@ protected void addNamePropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_NamespacedElement_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_NamespacedElement_name_feature", "_UI_NamespacedElement_type"),
RosPackage.Literals.NAMESPACED_ELEMENT__NAME,
getString("_UI_InterfaceType_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_InterfaceType_name_feature", "_UI_InterfaceType_type"),
RosPackage.Literals.INTERFACE_TYPE__NAME,
true,
false,
false,
Expand All @@ -90,6 +91,28 @@ protected void addNamePropertyDescriptor(Object object) {
null));
}

/**
* This adds a property descriptor for the Qos feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addQosPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_InterfaceType_qos_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_InterfaceType_qos_feature", "_UI_InterfaceType_type"),
RosPackage.Literals.INTERFACE_TYPE__QOS,
true,
false,
true,
null,
null,
null));
}

/**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
Expand All @@ -102,7 +125,7 @@ protected void addNamePropertyDescriptor(Object object) {
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(RosPackage.Literals.NAMESPACED_ELEMENT__NAMESPACE);
childrenFeatures.add(RosPackage.Literals.INTERFACE_TYPE__NAMESPACE);
}
return childrenFeatures;
}
Expand All @@ -121,14 +144,14 @@ protected EStructuralFeature getChildFeature(Object object, Object child) {
}

/**
* This returns NamespacedElement.gif.
* This returns InterfaceType.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/NamespacedElement"));
return overlayImage(object, getResourceLocator().getImage("full/obj16/InterfaceType"));
}

/**
Expand All @@ -139,12 +162,12 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
String label = ((NamespacedElement)object).getName();
String label = ((InterfaceType)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_NamespacedElement_type") :
getString("_UI_NamespacedElement_type") + " " + label;
getString("_UI_InterfaceType_type") :
getString("_UI_InterfaceType_type") + " " + label;
}


/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
Expand All @@ -157,11 +180,11 @@ public String getText(Object object) {
public void notifyChanged(Notification notification) {
updateChildren(notification);

switch (notification.getFeatureID(NamespacedElement.class)) {
case RosPackage.NAMESPACED_ELEMENT__NAME:
switch (notification.getFeatureID(InterfaceType.class)) {
case RosPackage.INTERFACE_TYPE__NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case RosPackage.NAMESPACED_ELEMENT__NAMESPACE:
case RosPackage.INTERFACE_TYPE__NAMESPACE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
Expand All @@ -181,17 +204,17 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors

newChildDescriptors.add
(createChildParameter
(RosPackage.Literals.NAMESPACED_ELEMENT__NAMESPACE,
(RosPackage.Literals.INTERFACE_TYPE__NAMESPACE,
RosFactory.eINSTANCE.createGlobalNamespace()));

newChildDescriptors.add
(createChildParameter
(RosPackage.Literals.NAMESPACED_ELEMENT__NAMESPACE,
(RosPackage.Literals.INTERFACE_TYPE__NAMESPACE,
RosFactory.eINSTANCE.createRelativeNamespace()));

newChildDescriptors.add
(createChildParameter
(RosPackage.Literals.NAMESPACED_ELEMENT__NAMESPACE,
(RosPackage.Literals.INTERFACE_TYPE__NAMESPACE,
RosFactory.eINSTANCE.createPrivateNamespace()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class ParameterItemProvider extends NamespacedElementItemProvider {
public class ParameterItemProvider extends InterfaceTypeItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class PublisherItemProvider extends NamespacedElementItemProvider {
public class PublisherItemProvider extends InterfaceTypeItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down
Loading