Skip to content

Commit

Permalink
[2026] Add the children layout strategy as a node children features
Browse files Browse the repository at this point in the history
Bug: eclipse-sirius#2026
Signed-off-by: Guillaume Coutable <guillaume.coutable@obeo.fr>
  • Loading branch information
gcoutable authored and sbegaudeau committed Jun 6, 2023
1 parent a88b731 commit 943d9a6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ It will start by improving a bit performances since diagrams were persisted twic
- https://github.com/eclipse-sirius/sirius-components/issues/1968[#1968] [sirius-web] Fix a regression introduced with the feature 1907, where for the papaya studio, colors are only searched in the first _ColorPalette_.
- https://github.com/eclipse-sirius/sirius-components/issues/1991[#1991] [form] Fix an issue where widgets from different groups share the same ID.
- https://github.com/eclipse-sirius/sirius-components/issues/1305[#1305] [diagram] Fix an issue where the default tools of the palette's tool sections where not updated.
- https://github.com/eclipse-sirius/sirius-components/issues/2008[#2008] [view] Make edge tool more robust for applications which use a custom IViewRepresentationDescriptionSearchService.
- https://github.com/eclipse-sirius/sirius-components/issues/2008[#2008] [view] Make edge tool more robust for applications which use a custom IViewRepresentationDescriptionSearchService
- https://github.com/eclipse-sirius/sirius-components/issues/2027[#2027] [diagram] Support both versions of the ITool interface in the imageURL data fetchers
- https://github.com/eclipse-sirius/sirius-components/issues/2026[#2026] [view] Display the layout strategy description of a node description in the explorer view again

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IChildCreationExtender;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
Expand Down Expand Up @@ -72,8 +73,8 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
*/
protected void addNamePropertyDescriptor(Object object) {
this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(),
this.getString("_UI_ColorPalette_name_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_ColorPalette_name_feature", "_UI_ColorPalette_type"),
ViewPackage.Literals.COLOR_PALETTE__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
this.getString("_UI_ColorPalette_name_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_ColorPalette_name_feature", "_UI_ColorPalette_type"),
ViewPackage.Literals.COLOR_PALETTE__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
Expand Down Expand Up @@ -179,7 +180,7 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors
*/
@Override
public ResourceLocator getResourceLocator() {
return ViewEditPlugin.INSTANCE;
return ((IChildCreationExtender) this.adapterFactory).getResourceLocator();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object objec
if (this.childrenFeatures == null) {
super.getChildrenFeatures(object);
this.childrenFeatures.add(ViewPackage.Literals.NODE_DESCRIPTION__PALETTE);
this.childrenFeatures.add(ViewPackage.Literals.NODE_DESCRIPTION__CHILDREN_LAYOUT_STRATEGY);
this.childrenFeatures.add(ViewPackage.Literals.NODE_DESCRIPTION__STYLE);
this.childrenFeatures.add(ViewPackage.Literals.NODE_DESCRIPTION__CONDITIONAL_STYLES);
this.childrenFeatures.add(ViewPackage.Literals.NODE_DESCRIPTION__CHILDREN_DESCRIPTIONS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IChildCreationExtender;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
Expand Down Expand Up @@ -132,7 +133,7 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors
*/
@Override
public ResourceLocator getResourceLocator() {
return ViewEditPlugin.INSTANCE;
return ((IChildCreationExtender) this.adapterFactory).getResourceLocator();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
<genClasses ecoreClass="view.ecore#//NodeDescription">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute view.ecore#//NodeDescription/collapsible"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference view.ecore#//NodeDescription/palette"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference view.ecore#//NodeDescription/childrenLayoutStrategy"/>
<genFeatures notify="false" children="true" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference view.ecore#//NodeDescription/childrenLayoutStrategy"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference view.ecore#//NodeDescription/style"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference view.ecore#//NodeDescription/conditionalStyles"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference view.ecore#//NodeDescription/childrenDescriptions"/>
Expand Down

0 comments on commit 943d9a6

Please sign in to comment.