Mickel Lee
Mickel Lee

Reputation: 513

console view in eclipse rcp development?

I want to realize an application like the eclipse console using eclipse rcp tech. the single application that I can run my java program and show the output in the console.

the problem is I want to realize the "terminate" button like the eclipse console, where I can push it and terminate the program. I found that the eclipse console plugin seems not to provide this function.

Upvotes: 0

Views: 1029

Answers (1)

Alex K.
Alex K.

Reputation: 3304

I think, you can try to define your own command in your plugin.xml, which will contribute a button into the console view:

<menuContribution allPopups="false"     locationURI="toolbar:ConsoleViewID">
<command commandId="your.plugin.id.terminatecommand"
            icon="platform:/plugin/your.plugin.id/images/red_rectangle.png"
            label="%Terminate"
            style="push">
        </command>
    </menuContribution>

    <extension point="org.eclipse.ui.commands">
<command
            defaultHandler="your.plugin.id.TerminateCommandHanler"
            id="your.plugin.id.terminatecommand"
            name="RefreshSelectedCommand">
        </command>
</extension>

And in the command handler you can do like that:

PlatformUI.getWorkbench().close();

Or

IWorkbenchConfigurer#emergencyClose();

Hope it helps

Upvotes: 1

Related Questions