java - 将 gmf 与 xpand oaw 集成

标签 java eclipse-plugin eclipse-gmf oaw

尝试将 gmf 与 xpand 集成。

我使用 gmf list 文件中的扩展名创建了一个菜单和命令。并尝试调用 xpand 生成器。

该命令的代码如下所示

public class customCommand extends AbstractHandler implements IHandler {

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
// TODO Auto-generated method stub


Shell s=HandlerUtil.getActiveShell(event);
MessageBox mb=new MessageBox(s,SWT.None);


WorkflowRunner runner = new WorkflowRunner();
Bundle bundle=Platform.getBundle("MistScriptGenerator"); 
URL wfUrl = bundle.getEntry("src/workflow/generator.oaw");
String wfFile = "";



try {

wfFile = FileLocator.toFileURL(wfUrl).getFile();
mb.setMessage(wfFile);
mb.open();

Map<String, String> properties = new HashMap<String, String>();
//properties.put("model", $diagramFile$.getLocation().toOSString());
properties=null;
boolean isSuccess = runner.run(wfFile,new org.openarchitectureware.workflow.monitor.NullProgressMonito r(), properties, null);


}
catch (Exception e) 
{


}

return null;
}

}

我已经能够成功获取工作流程的路径。 现在,在调用工作流程时,我必须将 gmf 图表文件输入到工作流程中。但我怎样才能给出文件的路径呢?

我通过打开另一个工作台来执行我的 gmf 图: 但是,现在,我如何获取 gmf 图文件的路径?

我已在我的工作流程中注册了 epackage。

你能指导一下吗,项目截止日期很快了。

最佳答案

IAML project使用openArchitectureWare XPand实现代码生成。作为如何将两者连接在一起的示例,您可以查看 GenerateCodeAction 的源代码-- 相关方法是doExecute()。希望这有帮助:)

关于java - 将 gmf 与 xpand oaw 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4817115/

相关文章:

java - Microsoft Azure 翻译 API 身份验证方法

java - 如何创建 OpenFire 插件

java - 有没有人有任何使用 Eclipse GMF 的经验?

java - 使用 BeanDefinitionRegistryPostProcessor 从 org.springframework.core.env.PropertySource 加载配置 POJO

java - java中调用Jasper子报表

java - 监控、调试和跟踪 CompletableFuture 任务

css - Eclipse 主题 - 如何更改主编辑器文本的颜色

java - 运行 Eclipse SWT 应用程序后,它显示许多异常

java - 图形建模框架不适用于 Eclipse Indigo

Eclipse:Xtext 以及与 Epsilon/GMF/Graphiti 的集成