Search code examples
javaxmleclipseeclipse-plugin

Target ID for XML Perspective


I am creating an eclipse PDE plugin with multiple views. I want my views to be available only when the XML perspective is chosen. I know I can specify this by changing the target ID of the view in the plugin.xml file, but I cannot find the target ID for the XML perspective. Does anyone know the target ID for the XML perspective?

   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="org.eclipse.jdt.ui.JavaPerspective">
         <view
               id="asher.views.id.SampleView"
               relative="org.eclipse.ui.views.ProblemView"
               relationship="right"
               ratio="0.5">
         </view>
      </perspectiveExtension>

Solution

  • Your view will always be available in every perspective, but the ID you're looking for is "org.eclipse.wst.xml.ui.perspective". You can find where it's declared at https://github.com/eclipse/webtools.sourceediting/blob/9a52e4d9b40b6340b0e2c72ee523bf603881cfb1/xml/bundles/org.eclipse.wst.xml.ui/plugin.xml#L1489