2017-01-22 125 views
0

我真的需要一个开放RCP应用一些帮助基于GMF框架 现在我设计出基因改造食品的编辑和运行为“Eclipse的应用程序”如何打开一个RCP应用。 我想运行的代码 这个应用程序,我可以overirde这种方法来运行应用程序基于GMF编辑

@Override 
public Object start(IApplicationContext context) throws Exception { 
    Display display = PlatformUI.createDisplay(); 
    try { 
     int returnCode = PlatformUI.createAndRunWorkbench(display, 
       new CefSrcRouteFlow.diagram.application.DiagramEditorWorkbenchAdvisor()); 
     if (returnCode == PlatformUI.RETURN_RESTART) { 
      return IApplication.EXIT_RESTART; 
     } 
     return IApplication.EXIT_OK; 
    } finally { 
     display.dispose(); 
    } 
} 

但对于这个IApplicationContext接口作为参数, 我怎样才能得到这样的实例?

回答

0

要运行一个Eclipse RCP start类,你必须使用org.eclipse.core.runtime.applications扩展点定义应用程序,并在run元素指定IApplication类的名称:

<extension 
    id="application" 
    point="org.eclipse.core.runtime.applications"> 
    <application> 
    <run 
      class="testrcp.Application"> 
    </run> 
    </application> 
</extension> 

然后,您可以测试此使用“运行> Eclipse应用程序“。

会的Eclipe调用start方法提供IApplicationContext

0

感谢您的回复。它可能与代码运行它,而不是用“运行AS-> Eclipse的应用程序”。现在我有一个JAVA FX的GUI界面。该GUI有一个按钮,德恩用户点击该按钮时,RCP的编辑器应该开始了吗?