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