DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page getting selected project name
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Dec 2008
Default getting selected project name - 06-29-2009, 04:31 AM

Hi,

Is there anyway to get the name of a selected project from the project explorer?

thanks
bhanu lakshmi
Reply With Quote
  (#2 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-30-2009, 03:22 AM

Hi bhanu:

I hope this section of code could help you out:

IStructuredSelection selection;
String projectName;
……
if (selection instanceof IStructuredSelection) {
Object o = selection.getFirstElement();
If(o instanceof IProject){
IProject project = (IProject) o;
projectName = project.getName();
}
}


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

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
Entering the currency format depending upon currencies selected in dropdown box srinivasrao27 Ajax & Javascript 1 09-25-2008 01:22 AM
problems occured refereshing the selected resources asha123 Eclipse 1 05-19-2008 07:08 AM


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