Skip to content

Commit

Permalink
[2044] Custom icons to edges and nodes label in view dsl
Browse files Browse the repository at this point in the history
Bug: #2044
Signed-off-by: Michaël Charfadi <michael.charfadi@obeosoft.com>
  • Loading branch information
mcharfadi committed Sep 14, 2023
1 parent b03349d commit 390e542
Show file tree
Hide file tree
Showing 31 changed files with 1,439 additions and 275 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Expand Up @@ -91,6 +91,8 @@ This will be fixed in the next version.
- https://github.com/eclipse-sirius/sirius-web/issues/2254[#2254] [diagram] Add the possibility to specify precondition on diagram tools
- https://github.com/eclipse-sirius/sirius-web/issues/2252[#2252] [diagram] It's now possible to contribute custom frontend-defined tools in a React Flow diagram palette.
To illustrate this new feature, we contribute a new tool on the _Papaya Diagram_, it's available only on _OperationalActivity_ and it simply opens a dialog with the node label content.
- https://github.com/eclipse-sirius/sirius-web/issues/2044[#2044] [view] Add custom icons to edges and nodes label in view dsl.


=== Improvements

Expand Down
Expand Up @@ -151,5 +151,15 @@ public ConditionalEdgeStyleBuilder showIcon(java.lang.Boolean value) {
return this;
}

/**
* Setter for LabelIcon.
*
* @generated
*/
public ConditionalEdgeStyleBuilder labelIcon(java.lang.String value) {
this.getConditionalEdgeStyle().setLabelIcon(value);
return this;
}

}

Expand Up @@ -142,5 +142,15 @@ public EdgeStyleBuilder showIcon(java.lang.Boolean value) {
return this;
}

/**
* Setter for LabelIcon.
*
* @generated
*/
public EdgeStyleBuilder labelIcon(java.lang.String value) {
this.getEdgeStyle().setLabelIcon(value);
return this;
}

}

Expand Up @@ -169,5 +169,15 @@ public IconLabelNodeStyleDescriptionBuilder showIcon(java.lang.Boolean value) {
return this;
}

/**
* Setter for LabelIcon.
*
* @generated
*/
public IconLabelNodeStyleDescriptionBuilder labelIcon(java.lang.String value) {
this.getIconLabelNodeStyleDescription().setLabelIcon(value);
return this;
}

}

Expand Up @@ -168,6 +168,16 @@ public ImageNodeStyleDescriptionBuilder showIcon(java.lang.Boolean value) {
this.getImageNodeStyleDescription().setShowIcon(value);
return this;
}
/**
* Setter for LabelIcon.
*
* @generated
*/
public ImageNodeStyleDescriptionBuilder labelIcon(java.lang.String value) {
this.getImageNodeStyleDescription().setLabelIcon(value);
return this;
}

/**
* Setter for Shape.
*
Expand Down
Expand Up @@ -153,5 +153,15 @@ public NodeStyleDescriptionBuilder showIcon(java.lang.Boolean value) {
return this;
}

/**
* Setter for LabelIcon.
*
* @generated
*/
public NodeStyleDescriptionBuilder labelIcon(java.lang.String value) {
this.getNodeStyleDescription().setLabelIcon(value);
return this;
}

}

Expand Up @@ -168,6 +168,16 @@ public RectangularNodeStyleDescriptionBuilder showIcon(java.lang.Boolean value)
this.getRectangularNodeStyleDescription().setShowIcon(value);
return this;
}
/**
* Setter for LabelIcon.
*
* @generated
*/
public RectangularNodeStyleDescriptionBuilder labelIcon(java.lang.String value) {
this.getRectangularNodeStyleDescription().setLabelIcon(value);
return this;
}

/**
* Setter for WithHeader.
*
Expand Down
Expand Up @@ -64,6 +64,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
this.addTargetArrowStylePropertyDescriptor(object);
this.addEdgeWidthPropertyDescriptor(object);
this.addShowIconPropertyDescriptor(object);
this.addLabelIconPropertyDescriptor(object);
}
return this.itemPropertyDescriptors;
}
Expand Down Expand Up @@ -189,6 +190,17 @@ protected void addShowIconPropertyDescriptor(Object object) {
DiagramPackage.Literals.EDGE_STYLE__SHOW_ICON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Label Icon feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected void addLabelIconPropertyDescriptor(Object object) {
this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(),
this.getString("_UI_EdgeStyle_labelIcon_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_EdgeStyle_labelIcon_feature", "_UI_EdgeStyle_type"),
DiagramPackage.Literals.EDGE_STYLE__LABEL_ICON, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This returns ConditionalEdgeStyle.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
*
Expand Down Expand Up @@ -243,6 +255,7 @@ public void notifyChanged(Notification notification) {
case DiagramPackage.CONDITIONAL_EDGE_STYLE__TARGET_ARROW_STYLE:
case DiagramPackage.CONDITIONAL_EDGE_STYLE__EDGE_WIDTH:
case DiagramPackage.CONDITIONAL_EDGE_STYLE__SHOW_ICON:
case DiagramPackage.CONDITIONAL_EDGE_STYLE__LABEL_ICON:
this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
Expand Down
Expand Up @@ -61,6 +61,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
this.addTargetArrowStylePropertyDescriptor(object);
this.addEdgeWidthPropertyDescriptor(object);
this.addShowIconPropertyDescriptor(object);
this.addLabelIconPropertyDescriptor(object);
}
return this.itemPropertyDescriptors;
}
Expand Down Expand Up @@ -175,6 +176,17 @@ protected void addShowIconPropertyDescriptor(Object object) {
DiagramPackage.Literals.EDGE_STYLE__SHOW_ICON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Label Icon feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected void addLabelIconPropertyDescriptor(Object object) {
this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(),
this.getString("_UI_EdgeStyle_labelIcon_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_EdgeStyle_labelIcon_feature", "_UI_EdgeStyle_type"),
DiagramPackage.Literals.EDGE_STYLE__LABEL_ICON, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This returns EdgeStyle.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
*
Expand Down Expand Up @@ -228,6 +240,7 @@ public void notifyChanged(Notification notification) {
case DiagramPackage.EDGE_STYLE__TARGET_ARROW_STYLE:
case DiagramPackage.EDGE_STYLE__EDGE_WIDTH:
case DiagramPackage.EDGE_STYLE__SHOW_ICON:
case DiagramPackage.EDGE_STYLE__LABEL_ICON:
this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
Expand Down
Expand Up @@ -65,6 +65,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
this.addWidthComputationExpressionPropertyDescriptor(object);
this.addHeightComputationExpressionPropertyDescriptor(object);
this.addShowIconPropertyDescriptor(object);
this.addLabelIconPropertyDescriptor(object);
}
return this.itemPropertyDescriptors;
}
Expand Down Expand Up @@ -218,6 +219,18 @@ protected void addShowIconPropertyDescriptor(Object object) {
DiagramPackage.Literals.NODE_STYLE_DESCRIPTION__SHOW_ICON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Label Icon feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected void addLabelIconPropertyDescriptor(Object object) {
this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(),
this.getString("_UI_NodeStyleDescription_labelIcon_feature"),
this.getString("_UI_PropertyDescriptor_description", "_UI_NodeStyleDescription_labelIcon_feature", "_UI_NodeStyleDescription_type"),
DiagramPackage.Literals.NODE_STYLE_DESCRIPTION__LABEL_ICON, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This returns IconLabelNodeStyleDescription.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
*
Expand Down Expand Up @@ -274,6 +287,7 @@ public void notifyChanged(Notification notification) {
case DiagramPackage.ICON_LABEL_NODE_STYLE_DESCRIPTION__WIDTH_COMPUTATION_EXPRESSION:
case DiagramPackage.ICON_LABEL_NODE_STYLE_DESCRIPTION__HEIGHT_COMPUTATION_EXPRESSION:
case DiagramPackage.ICON_LABEL_NODE_STYLE_DESCRIPTION__SHOW_ICON:
case DiagramPackage.ICON_LABEL_NODE_STYLE_DESCRIPTION__LABEL_ICON:
this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
Expand Down
Expand Up @@ -64,6 +64,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
this.addWidthComputationExpressionPropertyDescriptor(object);
this.addHeightComputationExpressionPropertyDescriptor(object);
this.addShowIconPropertyDescriptor(object);
this.addLabelIconPropertyDescriptor(object);
this.addShapePropertyDescriptor(object);
}
return this.itemPropertyDescriptors;
Expand Down Expand Up @@ -218,6 +219,18 @@ protected void addShowIconPropertyDescriptor(Object object) {
DiagramPackage.Literals.NODE_STYLE_DESCRIPTION__SHOW_ICON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Label Icon feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected void addLabelIconPropertyDescriptor(Object object) {
this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(),
this.getString("_UI_NodeStyleDescription_labelIcon_feature"),
this.getString("_UI_PropertyDescriptor_description", "_UI_NodeStyleDescription_labelIcon_feature", "_UI_NodeStyleDescription_type"),
DiagramPackage.Literals.NODE_STYLE_DESCRIPTION__LABEL_ICON, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Shape feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
Expand Down Expand Up @@ -286,6 +299,7 @@ public void notifyChanged(Notification notification) {
case DiagramPackage.IMAGE_NODE_STYLE_DESCRIPTION__WIDTH_COMPUTATION_EXPRESSION:
case DiagramPackage.IMAGE_NODE_STYLE_DESCRIPTION__HEIGHT_COMPUTATION_EXPRESSION:
case DiagramPackage.IMAGE_NODE_STYLE_DESCRIPTION__SHOW_ICON:
case DiagramPackage.IMAGE_NODE_STYLE_DESCRIPTION__LABEL_ICON:
case DiagramPackage.IMAGE_NODE_STYLE_DESCRIPTION__SHAPE:
this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
Expand Down
Expand Up @@ -65,6 +65,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
this.addWidthComputationExpressionPropertyDescriptor(object);
this.addHeightComputationExpressionPropertyDescriptor(object);
this.addShowIconPropertyDescriptor(object);
this.addLabelIconPropertyDescriptor(object);
this.addWithHeaderPropertyDescriptor(object);
}
return this.itemPropertyDescriptors;
Expand Down Expand Up @@ -219,6 +220,18 @@ protected void addShowIconPropertyDescriptor(Object object) {
DiagramPackage.Literals.NODE_STYLE_DESCRIPTION__SHOW_ICON, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Label Icon feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected void addLabelIconPropertyDescriptor(Object object) {
this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(),
this.getString("_UI_NodeStyleDescription_labelIcon_feature"),
this.getString("_UI_PropertyDescriptor_description", "_UI_NodeStyleDescription_labelIcon_feature", "_UI_NodeStyleDescription_type"),
DiagramPackage.Literals.NODE_STYLE_DESCRIPTION__LABEL_ICON, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the With Header feature. <!-- begin-user-doc --> <!-- end-user-doc -->
*
Expand Down Expand Up @@ -287,6 +300,7 @@ public void notifyChanged(Notification notification) {
case DiagramPackage.RECTANGULAR_NODE_STYLE_DESCRIPTION__WIDTH_COMPUTATION_EXPRESSION:
case DiagramPackage.RECTANGULAR_NODE_STYLE_DESCRIPTION__HEIGHT_COMPUTATION_EXPRESSION:
case DiagramPackage.RECTANGULAR_NODE_STYLE_DESCRIPTION__SHOW_ICON:
case DiagramPackage.RECTANGULAR_NODE_STYLE_DESCRIPTION__LABEL_ICON:
case DiagramPackage.RECTANGULAR_NODE_STYLE_DESCRIPTION__WITH_HEADER:
this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
Expand Down

0 comments on commit 390e542

Please sign in to comment.