Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Getting the selected file
Getting the selected file [message #277926] Sun, 19 December 2004 08:18 Go to next message
Eclipse UserFriend
Originally posted by: geoff.gibbs.btopenworld.com

Hi,
I'm writing a launch configuration delegate and it's associated launch
configuration tab group and cannot seem to find a way to get hold of the
file the launch is run against.

I assume this is available from somewhere as you specify a file extension
for the launch configuration type in the plugin.xml file.

Does anyone know where I can find this information?

Thanks,
Geoff
Re: Getting the selected file [message #278042 is a reply to message #277926] Tue, 21 December 2004 04:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: geoff.gibbs.btopenworld.com

OK, does anyone know if this is even possible?

--
Geoff Gibbs
Re: Getting the selected file [message #278075 is a reply to message #277926] Tue, 21 December 2004 15:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ken_dyck.amis.com

"Geoff Gibbs" <geoff.gibbs@btopenworld.com> wrote in message
news:cq3v2l$6be$1@www.eclipse.org...
> I'm writing a launch configuration delegate and it's associated launch
> configuration tab group and cannot seem to find a way to get hold of the
> file the launch is run against.

I'm guessing you already know that you can use the
ILaunchConfigurationWorkingCopy.setAttribute() method from your launch
configuration tab to store a file name in your launch configuration for
later retrieval through ILaunchConfiguration.getAttribute() in the
ILaunchConfigurationDelegate.launch() method.

I'm also going to assume that you know how to add a button to your launch
configuration tab that displays an ElementTreeSelectionDialog (with a
WorkbenchContentProvider and WorkbenchLabelProvider) when pressed, allowing
the user to browse for the file in his project.

So it would seem that what you are asking is how to initialize the value of
the attribute when you first create the launch configuration. This can be
done through the org.eclipse.debug.ui.launchShortcuts extension point. It
requires you to implement the ILaunchShortcut interface, which can be a
little tricky since there are no helpful base classes to do the tedious work
for you. (If you have the code to the CDT, the CApplicationLaunchShortcut in
the org.eclipse.cdt.launch project might serve as a usefule example.)

When the launch shortcut is initiated, it is passed the current selection of
the UI, from which you can extract the file name. Use the file name to
search through the list of existing launch configurations for a match, and
if that fails, create a new launch configuration, setting the file name
attribute using ILaunchConfigurationWorkingCopy.setAttribute().

_______________________________________
Ken Dyck
Member of Technical Staff
Software Tools
AMI Semiconductor
Tel: +1.519.884.9696 ext 2227
Fax: +1.519.884.0228
Email address: ken_dyck@amis.com
Internet: http://www.amis.com
Re: Getting the selected file [message #278078 is a reply to message #278075] Tue, 21 December 2004 15:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ken_dyck.amis.com

"Ken Dyck" <ken_dyck@amis.com> wrote in message
news:cq9von$pk3$1@www.eclipse.org...
> [snipped]

I should also mention Joe Szurszewski's article on launch configurations at
http://www.eclipse.org/articles/Article-Launch-Framework/lau nch.html

_______________________________________
Ken Dyck
Member of Technical Staff
Software Tools
AMI Semiconductor
Tel: +1.519.884.9696 ext 2227
Fax: +1.519.884.0228
Email address: ken_dyck@amis.com
Internet: http://www.amis.com
Re: Getting the selected file [message #278197 is a reply to message #278078] Sun, 26 December 2004 14:49 Go to previous message
Eclipse UserFriend
Originally posted by: geoff.gibbs.btopenworld.com

Thanks,
I'll look into it.
--
Geoff

"Ken Dyck" <ken_dyck@amis.com> wrote in message
news:cqa1bd$upl$1@www.eclipse.org...
> "Ken Dyck" <ken_dyck@amis.com> wrote in message
> news:cq9von$pk3$1@www.eclipse.org...
>> [snipped]
>
> I should also mention Joe Szurszewski's article on launch configurations
> at
> http://www.eclipse.org/articles/Article-Launch-Framework/lau nch.html
>
> _______________________________________
> Ken Dyck
> Member of Technical Staff
> Software Tools
> AMI Semiconductor
> Tel: +1.519.884.9696 ext 2227
> Fax: +1.519.884.0228
> Email address: ken_dyck@amis.com
> Internet: http://www.amis.com
>
>
Previous Topic:RCP newbie. Can I build a j2ee rich client out of the box?
Next Topic:CVS for newbies
Goto Forum:
  


Current Time: Sun Jun 08 19:18:55 EDT 2025

Powered by FUDForum. Page generated in 0.03555 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top