Skip to content

Commit

Permalink
[3649] Restore support for Related elements view icons
Browse files Browse the repository at this point in the history
Bug: #3649
Signed-off-by: Stéphane Bégaudeau <[email protected]>
  • Loading branch information
sbegaudeau committed Jun 24, 2024
1 parent 0d89655 commit 1e4bef7
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ More existing APIs will be migrated to this new common pattern.
- https://github.com/eclipse-sirius/sirius-web/issues/3624[#3624] [diagram] Fix an issue where the header separator does not fill the entire width of the node
- https://github.com/eclipse-sirius/sirius-web/issues/3531[#3531] [diagram] Fix unnecessary edges label re render
- https://github.com/eclipse-sirius/sirius-web/issues/3650[#3650] [diagram] Fix potential NPE in DiagramNavigator and Node toString method
- https://github.com/eclipse-sirius/sirius-web/issues/3649[#3649] [sirius-web] Restore support for Related elements view icons

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.eclipse.sirius.components.trees.TreeItem;
import org.eclipse.sirius.components.trees.description.TreeDescription;
import org.eclipse.sirius.components.trees.renderer.TreeRenderer;
import org.eclipse.sirius.web.application.images.ImageConstants;
import org.eclipse.sirius.web.application.views.explorer.services.api.IDeleteTreeItemHandler;
import org.eclipse.sirius.web.application.views.explorer.services.api.IExplorerChildrenProvider;
import org.eclipse.sirius.web.application.views.explorer.services.api.IExplorerElementsProvider;
Expand Down Expand Up @@ -222,7 +221,7 @@ private List<String> getImageURL(VariableManager variableManager) {
.flatMap(Optional::stream)
.toList();
} else if (self instanceof Resource) {
imageURL = List.of(ImageConstants.RESOURCE_SVG);
imageURL = List.of("/explorer/Resource.svg");
}
return imageURL;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024 Obeo.
* Copyright (c) 2024, 2024 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
Expand All @@ -10,7 +10,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.sirius.web.application.images.services;
package org.eclipse.sirius.web.application.views.explorer.services;

import java.util.List;

Expand All @@ -26,6 +26,6 @@
public class ExplorerImagePathService implements IImagePathService {
@Override
public List<String> getPaths() {
return List.of("/icons/svg");
return List.of("/explorer");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public class CurrentTreeDescriptionProvider implements ICurrentTreeDescriptionPr

private static final String TITLE = "Current";

private static final String WIDGET_ICON_URL = "/icons/svg/arrow_downward_black_24dp.svg";
private static final String WIDGET_ICON_URL = "/related-elements/arrow_downward_black_24dp.svg";

private static final String FOLDER_ICON_URL = "/icons/svg/folder_black_24dp.svg";
private static final String FOLDER_ICON_URL = "/related-elements/folder_black_24dp.svg";

private static final String CHILDREN_CATEGORY_ICON_URL = "/icons/svg/subdirectory_arrow_right_black_24dp.svg";
private static final String CHILDREN_CATEGORY_ICON_URL = "/related-elements/subdirectory_arrow_right_black_24dp.svg";

private static final String CATEGORY_KIND = "siriusWeb://category";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public class IncomingTreeDescriptionProvider implements IIncomingTreeDescription

private static final String TITLE = "Incoming";

private static final String WIDGET_ICON_URL = "/images/west_black_24dp.svg";
private static final String WIDGET_ICON_URL = "/related-elements/west_black_24dp.svg";

private static final String INCOMING_REFERENCE_ICON_URL = "/images/west_black_24dp.svg";
private static final String INCOMING_REFERENCE_ICON_URL = "/related-elements/west_black_24dp.svg";

private static final String INCOMING_REFERENCES_KIND = "siriusWeb://category/incoming-references";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public class OutgoingTreeDescriptionProvider implements IOutgoingTreeDescription

private static final String TITLE = "Outgoing";

private static final String WIDGET_ICON_URL = "/icons/svg/east_black_24dp.svg";
private static final String WIDGET_ICON_URL = "/related-elements/east_black_24dp.svg";

private static final String OUTGOING_REFERENCE_ICON_URL = "/icons/svg/east_black_24dp.svg";
private static final String OUTGOING_REFERENCE_ICON_URL = "/related-elements/east_black_24dp.svg";

private static final String OUTGOING_REFERENCE_KIND = "siriusWeb://category/outgoing-references";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.sirius.web.application.images;
package org.eclipse.sirius.web.application.views.relatedelements.services;

import java.util.List;

import org.eclipse.sirius.components.core.api.IImagePathService;
import org.springframework.stereotype.Service;

/**
* Utility class containing constants for the images of Sirius Web.
* Used to allow access to the images of the related elements view.
*
* @author sbegaudeau
*/
public final class ImageConstants {
public static final String IMAGES_ROOT_FOLDER = "/icons/svg";

public static final String RESOURCE_SVG = IMAGES_ROOT_FOLDER + "/Resource.svg";

private ImageConstants() {
// Prevent instantiation
@Service
public class RelatedElementsImagePathService implements IImagePathService {
@Override
public List<String> getPaths() {
return List.of("/related-elements");
}
}

0 comments on commit 1e4bef7

Please sign in to comment.