Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Propertypage enable when specific persistentProperty is set in file
Propertypage enable when specific persistentProperty is set in file [message #1696216] Sat, 23 May 2015 08:58
Hans Maulwurf is currently offline Hans MaulwurfFriend
Messages: 2
Registered: May 2015
Junior Member
I try to implement a property page for an eclipse plugin which is only visible when the selected file has a specific persistentProperty e.g. TYPE.

I create a file prorammatically in the project and add a persistentProperty with the following code:

file.setPersistentProperty(
         new QualifiedName("", "TYPE"),
         "Example");


In next step i configure the PropPage-Setting in the plugin.xml:

<page
            adaptable="true"
            class="propPage.FilePropertyPage"
            id="propPage.FilePropertyPage"
            name="FilePropertyPage">
         <enabledWhen>
            <adapt
                  type="org.eclipse.core.resources.IResource">
               <test
                     property="org.eclipse.core.resources.persistentProperty"
                     value="TYPE">
               </test>
            </adapt>
         </enabledWhen>
</page> 


But i cant see my PropertyPage for the specific file.

The following code works fine for the PropertyPages for files with the extension .jsp :

<page
            adaptable="true"
            class="propPage.FilePropertyPage"
            id="propPage.FilePropertyPage"
            name="FilePropertyPage">
         <enabledWhen>
            <adapt
                  type="org.eclipse.core.resources.IResource">
               <test
                     property="org.eclipse.core.resources.name"
                     value="*.jsp">
               </test>
            </adapt>
         </enabledWhen>
</page> 


When i read the PersistentProperty with the following code is works also fine:

...file.getPersistentProperty ...


Can anybody help me ?!

Thanks Smile
Previous Topic:PropertyPage enableWhen persistentProperty problem
Next Topic:Beginner in developing a plugin
Goto Forum:
  


Current Time: Thu Apr 25 14:25:17 GMT 2024

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

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

Back to the top