Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » IProject instanceof MyProject
IProject instanceof MyProject [message #491921] Fri, 16 October 2009 14:47 Go to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello,
I am currently working on an eclipse plugin to create our own projects an debug them.
The project and file creation wizard is ready ready to use.
Now the problem is the following:
If I create a file with the fileCreationWizard I want to check whether the selected project is instanceof MyProject or not.
I don't really know how to check that.
A java project for example is a IJavaProject I think.
How can I create a IMyProject to check wheter IProject is instanceof IMyProject or not?

I would appreciate any help because I really don't know how to do that.

Great thanks!
Best regards
Alex
Re: IProject instanceof MyProject [message #491932 is a reply to message #491921] Fri, 16 October 2009 14:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26278
Registered: July 2009
Senior Member
Alex,

It's not possible. Look at the Javadoc and you'll see

* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.

You should look at IProjectNature for better ways to "type" your projects.


Alexander Mack wrote:
> Hello,
> I am currently working on an eclipse plugin to create our own projects
> an debug them.
> The project and file creation wizard is ready ready to use.
> Now the problem is the following:
> If I create a file with the fileCreationWizard I want to check whether
> the selected project is instanceof MyProject or not.
> I don't really know how to check that. A java project for example is a
> IJavaProject I think.
> How can I create a IMyProject to check wheter IProject is instanceof
> IMyProject or not?
>
> I would appreciate any help because I really don't know how to do that.
>
> Great thanks!
> Best regards
> Alex
Re: IProject instanceof MyProject [message #492182 is a reply to message #491921] Mon, 19 October 2009 10:55 Go to previous messageGo to next message
Ravi  is currently offline Ravi Friend
Messages: 27
Registered: July 2009
Junior Member
Projects are distinguished by their "Types" using natures or facets (wtp) not by implementation class.

Facets are more powerful than natures in the sense that the latter can only "tag" your projects of certain type while the
former allows you to do certain actions while adding/removing the tag.

For more information on natures see
http://www.eclipse.org/articles/Article-Builders/builders.ht ml
http://wiki.eclipse.org/FAQ_When_does_my_language_need_its_o wn_nature%3F

Re: IProject instanceof MyProject [message #492184 is a reply to message #491921] Mon, 19 October 2009 10:59 Go to previous message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Thanks Ravi and Ed Merks, I read those articels and decided to add my own project nature.

Best regards,
Alex
Previous Topic:LaunchShortcut Extension
Next Topic:Debug a simple file
Goto Forum:
  


Current Time: Thu Dec 18 02:31:27 GMT 2014

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

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