DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Can't get rid of popup 'Select a way to run ...'
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jun 2009
Default Can't get rid of popup 'Select a way to run ...' - 06-04-2009, 07:39 AM

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
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jun 2009
Default 06-08-2009, 01:14 PM

Does nobody have any hint for me? Possibly a forum with better chances for response?
Reply With Quote
  (#3 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-12-2009, 03:00 AM

Hi

Under usual situation, Eclipse will inquiry the user with "run ... as default" option, when you opt this option, next time when u run it again, it will execute as default.otherwise it will still inquiry the user. Based on this question, it still needs to judge if the "preference" has recorded default launch mode。


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
  (#4 (permalink)) Old
Member
 
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jun 2009
Default 06-14-2009, 02:37 PM

Hi,

first thanks for taking the time to write an answer. But I cannot relate the words of your answer to anything I know of Eclipse (having just some weeks of experience with Eclipse plugin development):

When pressing the run button with a selected 'benerator.xml' file, it displays a dialog titled 'Run As' and the message 'Select a way to run 'benerator.xml', showing a list of two ways to launch and a Description area. No 'run ... as default' option. Are we referring to different Eclipse versions (mine is Europa) or different dialogs?

What do you mean with 'the "preference" has recorded default launch mode'? Is there some location to register/record a default launch mode for a file? I suppose that's not a matter of some preference page!?

Regards,
vbergmann
Reply With Quote
  (#5 (permalink)) Old
Member
 
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jun 2009
Default 06-16-2009, 01:12 AM

OK, in the Eclipse Preferences I found 'Run/Debug' - 'Launching' - 'Default Launcher' which looks appropriate for this case. Unfortunately it does not provide you with an option to specify a default launcher for yourself, but only to resolve a list of automatically detected conflicts ...and the list is empty.

I even filtered all launch configurations except 'Benerator' in the 'Launch Configurations' preferences, but Eclipse still shows me this popup.

Still struggling with the issue...
Reply With Quote
  (#6 (permalink)) Old
Member
 
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jun 2009
Default 06-16-2009, 01:13 AM

OK, in the Eclipse Preferences I found 'Run/Debug' - 'Launching' - 'Default Launcher' which looks appropriate for this case. Unfortunately it does not provide you with an option to specify a default launcher for yourself, but only to resolve a list of automatically detected conflicts ...and the list is empty.

I even filtered all launch configurations except 'Benerator' in the 'Launch Configurations' preferences, but Eclipse still shows me the popup.

Still struggling with the issue...
Reply With Quote
  (#7 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-16-2009, 03:44 AM

Sorry for my last reply, maybe my bad gramme makes you confused.
Let's get this in a clear way. for example: the first time you run the eclipse, there will be a tip for you to select the workspace, isn't it? then when you check that, then the default value will be saved in preference.
Next time while you run eclipse again, eclipse will access to preference to check is there any default value for workspace. If it does, then follow the default instruction, otherwise, popup another dialog to ask you what workspace are you going to choose.


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
Reply

Tags
eclipse, launch, run

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
eclipse popup extension (RCP) pelafede Eclipse 0 05-14-2009 02:30 PM
VERY URGENT how to style a select tag johnkhan CSS & HTML 0 02-18-2009 06:56 AM
Eclipse RCP creating select all menu problem parvins Eclipse 0 02-15-2009 09:36 PM
select the portion of text in CCombo jayjamba Eclipse 0 08-28-2008 07:41 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com