angrybobcat
angrybobcat

Reputation: 300

Add custom properties to eclipse's project class

I have a custom project nature and created a new project that has this new custom nature. What I am trying to do now, is extend the properties of that project, so when it is selected e.g. in package explorer view, not only the standard project properties are shown in the (standard) property-view but also customized ones (like the nature of the selected project - but only for a project that has my custom nature)

Is this possible with standard eclipse extension points? I have doubts since I don't have my own class where I could register a property-descriptor, just a new nature.

Upvotes: 0

Views: 717

Answers (1)

JP Moresmau
JP Moresmau

Reputation: 7403

You should be able to define a project properties page without a project class, as I've done in the Haskell plugin:

 <page
        name="%projectFlagsPP_name"
        class="net.sf.eclipsefp.haskell.ui.properties.UserFlagsPP"
        id="net.sf.eclipsefp.haskell.ui.properties.UserFlagsPP">
     <filter
           name="nature"
           value="net.sf.eclipsefp.haskell.core.project.HaskellNature">
     </filter>
     <filter
           name="open"
           value="true">
     </filter>
     <enabledWhen>
        <adapt type="org.eclipse.core.resources.IProject" />
     </enabledWhen>
  </page>

And then the java code starts like:

public class UserFlagsPP extends PropertyPage implements
IWorkbenchPreferencePage {

This says that the property page will appear for a IProject that has the Haskell Nature...

Upvotes: 1

Related Questions