Hi there,
I am trying to make the launching framework launch a custom Java main class, when having a file 'benerator.xml' selected and pressing the 'Run' button.
It works, but with an annoying popup: When clicking 'Run' for the first time, a dialog pops up asking me to 'Select a way to run 'benerator.xml'', offering 'Run on Server' and my own launcher. That's OK, I select my launcher and it runs. But when I click 'Run' a second time, I expect it to run the same configuration again. Instead, the same popup is displayed once more.
I now have spent two nights with googling, reading documentation and forums and trying, but now I'm left without a clue. Please help!
My launch preferences have default values and I need the users to be able to run the plugin with these settings. With Eclipse 3.4 there seems to be an option to override the framework's default behaviour by using LaunchConfigurationDelegate2. But on the one hand the default behaviour is supposed to exhibit the behaviour I need and on the other hand I need to support at least Eclipse 3.3.
Here's what I did:
- Used Eclipse 3.4.1 (but need to be able to run it at least with 3.3, too)
- wrote a launch shortcut implementing ILaunchShortcut
- wrote a launch delegate that extends JavaLaunchDelegate
My plugin.xml:
Code:
<extension point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
id="org.databene.benclipse.launch.DescriptorLaunchShortcut"
class="org.databene.benclipse.launch.DescriptorLaunchShortcut"
label="Run Benerator Descriptor"
icon="icons/benerator.gif"
modes="run,debug"
category="org.databene.benclipse.launch.category.descriptor" >
<contextualLaunch>
<contextLabel label="Benerator Descriptor" mode="run"/>
<contextLabel label="Benerator Descriptor" mode="debug"/>
<enablement>
<with variable="selection">
<count value="1"/>
<iterate>
<or>
<test property="org.eclipse.debug.ui.matchesPattern" value="*.ben.xml"/>
<test property="org.eclipse.debug.ui.matchesPattern" value="benerator.xml"/>
</or>
</iterate>
</with>
</enablement>
</contextualLaunch>
</shortcut>
</extension>
<!-- Benerator Launch Configuration -->
<extension point="org.eclipse.debug.core.launchConfigurationTypes">
<launchConfigurationType
id="org.databene.benclipse.launch.descriptor"
delegate="org.databene.benclipse.launch.DescriptorLaunchDelegate"
name="Benerator"
modes="run,debug" />
</extension>
Any help is appreciated. Even a hint to the related launch framework classes would help, I could try to find the solution in the source for myself.
Regards,
Volker