Question

I have added my custom menu item using my own custom plugin. But the placement of this plugin at my desired location is something which I am trying to achieve. This is what I have now enter image description here

This is what I want to implement

enter image description here

How can we place the custom menu item 'Dsiplay Properties' added in the Map 'menubar' beneath the separator. Is it a configuration change in the plugin.xml. Looking forward for your help.

The plugin.xml that i am using for my custom plugin is.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
  <extension
    id="net.refractions.udig.project.ui.menus"
    name="Project Menus"
   point="org.eclipse.ui.menus">
   <menuContribution
        allPopups="false"
        locationURI="menu:map?after=mapGroup">
     <command
         commandId="com.abc.gis.map.displayScale.command1"
         label="Display Properties"
         style="push"
         tooltip="Display Properties">
      <visibleWhen
            checkEnabled="true">
      </visibleWhen>
   </command>
  </menuContribution>
   </extension> 
   <extension
     point="org.eclipse.ui.handlers">      
   <handler
          class="com.abc.gis.map.displayscale.DisplayPropertiesCommandHandler"
          commandId="com.abc.gis.map.displayScale.command1">
       <enabledWhen>
          <iterate
                ifEmpty="false"
                operator="or">
             <adapt
                   type="net.refractions.udig.project.IMap">
             </adapt>
             <instanceof
                   value="net.refractions.udig.project.IMap">
             </instanceof>
          </iterate>
       </enabledWhen>
    </handler>

  </extension>
   <extension
     point="org.eclipse.ui.propertyPages">
    <page
        class="com.abc.gis.map.displayscale.DisplayProperties"
        id="com.abc.gis.map.displayScale.page4"
        name="Display Properties">
  </page>
  </extension>
  <extension
       point="org.eclipse.ui.commands">
       <command
        description="Display Properties"
        id="com.abc.gis.map.displayScale.command1"
        name="Display Properties">
     </command>

   </extension>
  </plugin>

Thanks A

Was it helpful?

Solution

What statement are you using to bring that menu entry to its position? Eclipse uses Contribution URLs like: menu:org.eclipse.search.menu?after=contextMenuActionsGroup . That means "in the menu Search Menu place this entry after the group contextMenuActionsGroup .

In your case this would be something like: menu:my.path.map?after=mapGroup

If you do not know the path to your menu, you can use the shortcut Alt+Shift+F2 to select the menu entry before the group and check its path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top