Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ The parsed elements are still imported, and the loading report includes the pars
- [cleanup] Use `SemanticRunnableFactory` more widely in integration tests, replacing the `IExecuteEditingContextFunctionRunner` by the `SemanticRunnableFactory`.
- [releng] Remove redundant inherited Maven `groupId` and `version` declarations from backend modules.
- [frontend] Export six components and eight hooks from `@eclipse-syson/syson-components` for expression tools and properties, the new-object report, diagram visibility, and node rotation.
- [core] Harmonize SysML icons

=== New features

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023, 2024 Obeo.
/*******************************************************************************
* Copyright (c) 2023, 2026 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 @@ -9,7 +9,7 @@
*
* Contributors:
* Obeo - initial API and implementation
*/
*******************************************************************************/
package org.eclipse.syson.sysml.provider;

import java.util.Collection;
Expand All @@ -20,8 +20,10 @@
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.syson.sysml.Behavior;
import org.eclipse.syson.sysml.FeatureDirectionKind;
import org.eclipse.syson.sysml.ItemUsage;
import org.eclipse.syson.sysml.Step;
import org.eclipse.syson.sysml.SysmlPackage;

/**
Expand Down Expand Up @@ -82,7 +84,12 @@ protected void addItemDefinitionPropertyDescriptor(Object object) {
@Override
public Object getImage(Object object) {
StringBuilder iconPath = new StringBuilder();
iconPath.append("full/obj16/ItemUsage");
boolean isParameter = this.isParameter(object);
if (isParameter) {
iconPath.append("full/obj16/parameter");
} else {
iconPath.append("full/obj16/ItemUsage");
}
if (object instanceof ItemUsage item) {
FeatureDirectionKind direction = item.getDirection();
if (direction != null) {
Expand All @@ -93,6 +100,14 @@ public Object getImage(Object object) {
return this.overlayImage(object, this.getResourceLocator().getImage(iconPath.toString()));
}

/**
* @generated NOT
*/
private boolean isParameter(Object object) {
return object instanceof ItemUsage itemUsage && (itemUsage.getOwningType() instanceof Step || itemUsage.getOwningType() instanceof Behavior)
&& itemUsage.getDirection() != null;
}

/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2023, 2024 Obeo.
/*******************************************************************************
* Copyright (c) 2023, 2026 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 @@ -9,16 +9,20 @@
*
* Contributors:
* Obeo - initial API and implementation
*/
*******************************************************************************/
package org.eclipse.syson.sysml.provider;

import java.util.Collection;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.syson.sysml.Behavior;
import org.eclipse.syson.sysml.FeatureDirectionKind;
import org.eclipse.syson.sysml.ReferenceUsage;
import org.eclipse.syson.sysml.Step;

/**
* This is the item provider adapter for a {@link org.eclipse.syson.sysml.ReferenceUsage} object. <!-- begin-user-doc
Expand Down Expand Up @@ -57,7 +61,29 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
*/
@Override
public Object getImage(Object object) {
return this.overlayImage(object, this.getResourceLocator().getImage("full/obj16/ReferenceUsage.svg"));
StringBuilder iconPath = new StringBuilder();
boolean isParameter = this.isParameter(object);
if (isParameter) {
iconPath.append("full/obj16/parameter");
} else {
iconPath.append("full/obj16/ReferenceUsage");
}
if (object instanceof ReferenceUsage referenceUsage) {
FeatureDirectionKind direction = referenceUsage.getDirection();
if (direction != null) {
iconPath.append(StringUtils.capitalize(direction.getLiteral()));
}
}
iconPath.append(".svg");
return this.overlayImage(object, this.getResourceLocator().getImage(iconPath.toString()));
}

/**
* @generated NOT
*/
private boolean isParameter(Object object) {
return object instanceof ReferenceUsage referenceUsage && (referenceUsage.getOwningType() instanceof Step || referenceUsage.getOwningType() instanceof Behavior)
&& referenceUsage.getDirection() != null;
}

/**
Expand Down
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading