| Enable launch shortcut depending on content type [message #335328] | 
Wed, 01 April 2009 12:04  | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi, 
 
I want to enable the launch shortcut depending on the content type of 
the selected file. In my plugin.xml, I defined the following: 
 
    <!-- content type definition --> 
    <extension 
         point="org.eclipse.core.contenttype.contentTypes"> 
      <content-type 
            base-type="org.eclipse.core.runtime.xml" 
            file-extensions="mwe,oaw" 
            id="org.eclipse.emf.mwe.ui.contentType.workflow" 
            name="%contentType" 
            priority="high"> 
            <describer 
class=" org.eclipse.core.runtime.content.XMLRootElementContentDescri ber "> 
                <parameter name="element" value="%rootElement"/> 
            </describer> 
      </content-type> 
   </extension> 
    
   <!-- launch shortcut --> 
   <extension 
         point="org.eclipse.debug.ui.launchShortcuts"> 
      <shortcut 
            label="MWE Workflow" 
            icon="icons/oawlaunch.gif" 
            category="org.eclipse.ui.externaltools" 
 
class=" org.eclipse.emf.mwe.internal.ui.eclipse.launch.MWELaunchShor tcut " 
            modes="run, debug" 
            id="org.eclipse.emf.mwe.ui.debug.launching.shortcut"> 
        <contextualLaunch> 
           <enablement> 
             <with variable="selection"> 
               <count value="1"/> 
               <iterate 
                     ifEmpty="false" 
                     operator="and"> 
                  <adapt 
                        type="org.eclipse.core.resources.IFile"> 
                  </adapt> 
<!-- 
                  <test 
                        forcePluginActivation="false" 
 
property="org.eclipse.core.resources.contentTypeId" 
 
value="org.eclipse.emf.mwe.ui.contentType.workflow"> 
                  </test> 
--> 
               </iterate> 
             </with> 
           </enablement> 
           <contextLabel 
         	  mode="run" 
         	  label="MWE Workflow"/> 
          <contextLabel 
         	  mode="debug" 
         	  label="MWE Workflow"/> 
  		 </contextualLaunch> 
      </shortcut> 
   </extension> 
 
However, if I enable the commented out test, the launch shortcut is 
never available. 
 
What am I missing? 
 
--  
Regards, 
Patrick 
 
--  
Patrick Schönbach 
Software Architect 
 
PGP public key available. Key ID: 0B7DDE39 
Or email to pgp@robustsoft.de with subject 'pschoenb'. 
Fingerprint: BE80 0E7E B68E CE99 623C  902D 62A6 806A 0B7D DE39 
 
web: http://www.itemis.de 
mail: schoenbach@itemis.de 
xing: https://www.xing.com/profile/Patrick_Schoenbach 
 
itemis AG 
Schauenburgerstraße 116 
24118 Kiel 
Germany 
 
Rechtlicher Hinweis: 
Amtsgericht Dortmund, HRB 20621 
Vorstand: Wolfgang Neuhaus, Jens Wagener, Dr. Georg Pietrek 
Aufsichtsrat: Dr. Burkhard Igel(Vors.), Stephan Grollmann, Michael 
Neuhaus
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.03549 seconds