问题描述:

i really need some help for open a Rcp application based on GMF Framework

Now i design a editor with GMF and run as "Eclipse Application".

i want to run this application with code

i can overirde this method to run the application

@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();

}

}

but for this IApplicationContext as argument,

how can i get a instance for this?

网友答案:

To run an Eclipse RCP start class you must define the application using the org.eclipse.core.runtime.applications extension point and specify the name of your IApplication class in the run element:

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

You can then test this using 'Run > Eclipse Application'.

Eclipe will call the start method providing the IApplicationContext

网友答案:

thank you for your reply. its possible to run it with code, not with "Run AS->Eclipse Application". now i have a GUI Interface with JAVA FX. This Gui has a Button, Wenn the user click the Button, the Rcp Editor should be started?

相关阅读:
Top