【发布时间】:2020-12-12 15:56:34
【问题描述】:
Sirius 中是否有任何方法可以让用户交互(例如双击)来调用 Ecore 定义的语义元素操作?详情如下。
我正在使用 Xcore 来定义我的元模型。我有这样的情况:
enum Status
{
Default
Foo
Bar
}
class ThingWithStatus
{
Status status
}
class ContainerForThings
{
contains ThingWithStatus[] thingList
op void resetAllThingsStatus()
{
for (ThingWithStatus thing : thingList)
{
thing.status = Status::DEFAULT
}
}
}
目前我在 Sirius 中有一个图表,其中包含 ContainerForThings 的容器节点,以及 ThingWithStatus 的子节点。我想做的是双击图中的容器节点,并在语义元素上运行 resetAllThingsStatus() 操作。
如果无法直接执行此操作,我最好的选择是将 EMF 生成的用于 resetAllThingsStatus() 的 Java 代码转换为 Sirius 然后调用的外部 Java 操作吗?
提前感谢您的帮助。 - SJ
【问题讨论】:
标签: ecore eclipse-sirius sirius