Skip to content

Commit

Permalink
[1618] Split View into dedicated subpackages
Browse files Browse the repository at this point in the history
Bug: eclipse-sirius#1618
Signed-off-by: Guillaume Coutable <guillaume.coutable@obeo.fr>
  • Loading branch information
gcoutable authored and AxelRICHARD committed Jun 26, 2023
1 parent 6724e2b commit 58f87ad
Show file tree
Hide file tree
Showing 626 changed files with 40,112 additions and 33,783 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The help text can include multiple lines (separated by `\n`), but no text format
:image:doc/images/Widget_Help_Tooltip.png[Example of a help tooltip on a widget]
- https://github.com/eclipse-sirius/sirius-components/issues/2048[#2048] [diagram] Add a basic support for the resize. It is possible to reduce the size of a node less than the space needed to display all children.
- https://github.com/eclipse-sirius/sirius-components/issues/2064[#2064] [forms] Make the `IWidgetDescriptor` API more flexible.
- https://github.com/eclipse-sirius/sirius-components/issues/1618[#1618] [view] Split the view metamodel into dedicated subpackages.

== v2023.6.0

Expand Down
15 changes: 7 additions & 8 deletions integration-tests/cypress/e2e/project/edit/color-palette.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('/projects/:projectId/edit - Color Palette', () => {
cy.getByTestId('create-object').click();
cy.getByTestId('FixedColor').should('exist').click();
cy.getByTestId('Name').type('color_test{enter}');
cy.getByTestId('Value').type('#e5f5f8{enter}');
cy.get('[data-testid="Value"] > div > textarea').first().type('#e5f5f8{enter}');
cy.getByTestId('color_test').should('exist');
});

Expand All @@ -58,22 +58,21 @@ describe('/projects/:projectId/edit - Color Palette', () => {
it('can select color from color palette in node style properties', () => {
cy.getByTestId('ViewNewModel-toggle').click();
cy.getByTestId('View-toggle').click();
cy.get('[title="view::DiagramDescription"]').dblclick();
cy.get('[title="diagram::DiagramDescription"]').dblclick();
cy.getByTestId('Entity1 Node-toggle').click();
cy.get('[title="view::RectangularNodeStyleDescription"]').click();
cy.get('[title="diagram::RectangularNodeStyleDescription"]').click();
cy.getByTestId('Label Color').click().get('[data-value="color_dark"]').should('exist').click();
cy.getByTestId('Color').click().get('[data-value="color_dark"]').should('exist').click();
cy.getByTestId('Border Color').click().get('[data-value="border_blue"]').should('exist').click();
});

it('can select color from color palette in edge style properties', () => {
cy.getByTestId('ViewNewModel-toggle').click();
cy.getByTestId('View-toggle').click();
cy.get('[title="view::DiagramDescription"]').dblclick();
cy.get('[title="diagram::DiagramDescription"]').dblclick();
cy.getByTestId('LinkedTo Edge-toggle').click();
cy.get('[title="view::EdgeStyle"]').click();
cy.get('[title="diagram::EdgeStyle"]').click();
cy.getByTestId('Color').click();
cy.contains('FixedColor color_blue').click();
});

});
});
3 changes: 2 additions & 1 deletion integration-tests/cypress/e2e/project/edit/studio.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ describe('/projects/:projectId/edit - Studio', () => {
it('Check the new object domain list', () => {
cy.getByTestId('DomainNewModel-more').click();
cy.getByTestId('new-object').click();
cy.getByTestId('domain').click().get('[data-value="http://www.eclipse.org/sirius-web/domain"]').should('exist');
cy.getByTestId('domain').click();
cy.get('[data-value="http://www.eclipse.org/sirius-web/domain"]').should('exist');
cy.getByTestId('domain').get('[data-value="http://www.eclipse.org/sirius-web/view"]').should('exist');
cy.getByTestId('domain').get('[data-value="http://www.obeo.fr/dsl/designer/sample/flow"]').should('exist');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.PageDescription;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.components.view.form.FormFactory;
import org.eclipse.sirius.components.view.form.PageDescription;
import org.springframework.stereotype.Service;

import io.micrometer.core.instrument.Counter;
Expand Down Expand Up @@ -100,7 +100,7 @@ private boolean addGroup(IEditingContext editingContext, String pageId, int inde
}

private void createNewGroupInPageDescription(PageDescription pageDescription, int index) {
var groupDescription = ViewFactory.eINSTANCE.createGroupDescription();
var groupDescription = FormFactory.eINSTANCE.createGroupDescription();
pageDescription.getGroups().add(index, groupDescription);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.FormDescription;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.components.view.form.FormDescription;
import org.eclipse.sirius.components.view.form.FormFactory;
import org.springframework.stereotype.Service;

import io.micrometer.core.instrument.Counter;
Expand Down Expand Up @@ -100,8 +100,8 @@ private boolean addPage(IEditingContext editingContext, IFormDescriptionEditorCo
}

private void createNewPageWithDefaultEmptyGroupInFormDescription(FormDescription formDescription, int index) {
var pageDescription = ViewFactory.eINSTANCE.createPageDescription();
var groupDescription = ViewFactory.eINSTANCE.createGroupDescription();
var pageDescription = FormFactory.eINSTANCE.createPageDescription();
var groupDescription = FormFactory.eINSTANCE.createGroupDescription();
pageDescription.getGroups().add(groupDescription);
formDescription.getPages().add(index, pageDescription);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.GroupDescription;
import org.eclipse.sirius.components.view.PageDescription;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.components.view.form.FormFactory;
import org.eclipse.sirius.components.view.form.GroupDescription;
import org.eclipse.sirius.components.view.form.PageDescription;
import org.springframework.stereotype.Service;

import io.micrometer.core.instrument.Counter;
Expand Down Expand Up @@ -98,9 +98,9 @@ private boolean addToolbarAction(IEditingContext editingContext, IFormDescriptio
}
if (optionalSelf.isPresent()) {
Object container = optionalSelf.get();
var toolbarActionDescription = ViewFactory.eINSTANCE.createButtonDescription();
var toolbarActionDescription = FormFactory.eINSTANCE.createButtonDescription();
toolbarActionDescription.setName("ToolbarAction");
var toolbarActionDescriptionStyle = ViewFactory.eINSTANCE.createButtonDescriptionStyle();
var toolbarActionDescriptionStyle = FormFactory.eINSTANCE.createButtonDescriptionStyle();
toolbarActionDescription.setStyle(toolbarActionDescriptionStyle);
if (container instanceof GroupDescription groupDescription) {
groupDescription.getToolbarActions().add(toolbarActionDescription);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.formdescriptioneditors.IWidgetDescriptionProvider;
import org.eclipse.sirius.components.view.FlexDirection;
import org.eclipse.sirius.components.view.FlexboxContainerDescription;
import org.eclipse.sirius.components.view.GroupDescription;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.components.view.ViewPackage;
import org.eclipse.sirius.components.view.WidgetDescription;
import org.eclipse.sirius.components.view.form.FlexDirection;
import org.eclipse.sirius.components.view.form.FlexboxContainerDescription;
import org.eclipse.sirius.components.view.form.FormFactory;
import org.eclipse.sirius.components.view.form.FormPackage;
import org.eclipse.sirius.components.view.form.GroupDescription;
import org.eclipse.sirius.components.view.form.WidgetDescription;
import org.springframework.stereotype.Service;

import io.micrometer.core.instrument.Counter;
Expand Down Expand Up @@ -138,15 +138,15 @@ private EClassifier getWidgetDescriptionType(String kind) {
return optionalType.get();
}
}
return ViewPackage.eINSTANCE.getEClassifier(kind + "Description");
return FormPackage.eINSTANCE.getEClassifier(kind + "Description");
}

private void createStyle(WidgetDescription widgetDescription) {
EStructuralFeature styleFeature = widgetDescription.eClass().getEStructuralFeature("style");
if (styleFeature instanceof EReference) {
EClassifier eClassifier = styleFeature.getEType();
if (eClassifier instanceof EClass) {
var widgetDescriptionStyle = ViewFactory.eINSTANCE.create((EClass) eClassifier);
var widgetDescriptionStyle = FormFactory.eINSTANCE.create((EClass) eClassifier);
if (eClassifier.isInstance(widgetDescriptionStyle)) {
widgetDescription.eSet(styleFeature, widgetDescriptionStyle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.GroupDescription;
import org.eclipse.sirius.components.view.PageDescription;
import org.eclipse.sirius.components.view.form.GroupDescription;
import org.eclipse.sirius.components.view.form.PageDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.FormDescription;
import org.eclipse.sirius.components.view.PageDescription;
import org.eclipse.sirius.components.view.form.FormDescription;
import org.eclipse.sirius.components.view.form.PageDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.ButtonDescription;
import org.eclipse.sirius.components.view.GroupDescription;
import org.eclipse.sirius.components.view.PageDescription;
import org.eclipse.sirius.components.view.form.ButtonDescription;
import org.eclipse.sirius.components.view.form.GroupDescription;
import org.eclipse.sirius.components.view.form.PageDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.FlexboxContainerDescription;
import org.eclipse.sirius.components.view.GroupDescription;
import org.eclipse.sirius.components.view.WidgetDescription;
import org.eclipse.sirius.components.view.form.FlexboxContainerDescription;
import org.eclipse.sirius.components.view.form.GroupDescription;
import org.eclipse.sirius.components.view.form.WidgetDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.FormDescription;
import org.eclipse.sirius.components.view.PageDescription;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.components.view.form.FormDescription;
import org.eclipse.sirius.components.view.form.FormFactory;
import org.eclipse.sirius.components.view.form.PageDescription;
import org.junit.jupiter.api.Test;

import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
Expand All @@ -46,8 +46,8 @@ public class AddGroupEventHandlerTests {
@Test
public void testAddGroupAction() {

FormDescription formDescription = ViewFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = ViewFactory.eINSTANCE.createPageDescription();
FormDescription formDescription = FormFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = FormFactory.eINSTANCE.createPageDescription();
formDescription.getPages().add(pageDescription);

var objectService = new IObjectService.NoOp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.FormDescription;
import org.eclipse.sirius.components.view.PageDescription;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.components.view.form.FormDescription;
import org.eclipse.sirius.components.view.form.FormFactory;
import org.eclipse.sirius.components.view.form.PageDescription;
import org.junit.jupiter.api.Test;

import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
Expand All @@ -46,8 +46,8 @@ public class AddPageEventHandlerTests {
@Test
public void testAddGroupAction() {

FormDescription formDescription = ViewFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = ViewFactory.eINSTANCE.createPageDescription();
FormDescription formDescription = FormFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = FormFactory.eINSTANCE.createPageDescription();
formDescription.getPages().add(pageDescription);

var objectService = new IObjectService.NoOp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.FormDescription;
import org.eclipse.sirius.components.view.GroupDescription;
import org.eclipse.sirius.components.view.PageDescription;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.components.view.form.FormDescription;
import org.eclipse.sirius.components.view.form.FormFactory;
import org.eclipse.sirius.components.view.form.GroupDescription;
import org.eclipse.sirius.components.view.form.PageDescription;
import org.junit.jupiter.api.Test;

import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
Expand All @@ -48,9 +48,9 @@ public class AddToolbarActionEventHandlerTests {

@Test
public void testAddToolbarActionToGroup() {
FormDescription formDescription = ViewFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = ViewFactory.eINSTANCE.createPageDescription();
GroupDescription groupDescription = ViewFactory.eINSTANCE.createGroupDescription();
FormDescription formDescription = FormFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = FormFactory.eINSTANCE.createPageDescription();
GroupDescription groupDescription = FormFactory.eINSTANCE.createGroupDescription();
pageDescription.getGroups().add(groupDescription);
formDescription.getPages().add(pageDescription);
var objectService = new IObjectService.NoOp() {
Expand Down Expand Up @@ -81,8 +81,8 @@ public Optional<Object> getObject(IEditingContext editingContext, String objectI

@Test
public void testAddToolbarActionToPage() {
FormDescription formDescription = ViewFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = ViewFactory.eINSTANCE.createPageDescription();
FormDescription formDescription = FormFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = FormFactory.eINSTANCE.createPageDescription();
formDescription.getPages().add(pageDescription);
var objectService = new IObjectService.NoOp() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.eclipse.sirius.components.core.api.IObjectService;
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.components.view.form.FormFactory;
import org.junit.jupiter.api.Test;

import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
Expand All @@ -48,7 +48,7 @@ public void testAddWidget() {
var objectService = new IObjectService.NoOp() {
@Override
public Optional<Object> getObject(IEditingContext editingContext, String objectId) {
return Optional.of(ViewFactory.eINSTANCE.createFlexboxContainerDescription());
return Optional.of(FormFactory.eINSTANCE.createFlexboxContainerDescription());
}
};
var handler = new AddWidgetEventHandler(objectService, new ICollaborativeFormDescriptionEditorMessageService.NoOp(), List.of(), new SimpleMeterRegistry());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import org.eclipse.sirius.components.core.api.IPayload;
import org.eclipse.sirius.components.core.api.SuccessPayload;
import org.eclipse.sirius.components.formdescriptioneditors.FormDescriptionEditor;
import org.eclipse.sirius.components.view.FormDescription;
import org.eclipse.sirius.components.view.PageDescription;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.components.view.form.FormDescription;
import org.eclipse.sirius.components.view.form.FormFactory;
import org.eclipse.sirius.components.view.form.PageDescription;
import org.junit.jupiter.api.Test;

import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
Expand All @@ -51,8 +51,8 @@ public class DeletePageEventHandlerTests {
@Test
public void testDeletePage() {

FormDescription formDescription = ViewFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = ViewFactory.eINSTANCE.createPageDescription();
FormDescription formDescription = FormFactory.eINSTANCE.createFormDescription();
PageDescription pageDescription = FormFactory.eINSTANCE.createPageDescription();
formDescription.getPages().add(pageDescription);

FormDescriptionEditor formDescriptionEditor = new TestFormDescriptionEditorBuilder().getFormDescriptionEditor(UUID.randomUUID().toString());
Expand Down
Loading

0 comments on commit 58f87ad

Please sign in to comment.