I have a new context menu entry "Compare..." and the sub-menus are some tools configured in the preferences (for example "Beyond Compare") that is used to compare some custom files in my Project Explorer view and the context menu entry will only be visible on certain file selections in the tree structure in Project Explorer view and here's the plugin.xml file content of this context menu entry -
extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="true"
locationURI="popup:org.eclipse.ui.popup.any?after=additions">
<menu
id="compareMenu"
label="Compare..."
tooltip="Compare the selected with other file">
<separator
name="compareGroup"
visible="false">
</separator>
</menu>
</menuContribution>
</extension>
And in the "Properties" view we have various tabs configured the following way -
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
<propertyTabs
contributorId="org.eclipse.ui.navigator.ProjectExplorer">
<propertyTab
afterTab="CommonNavigator.tab.Resource"
category="resource"
id="com.ui.revisionInfoTab"
label="Revision Info">
</propertyTab>
<propertyTab
afterTab="com.ui.revisionInfoTab"
category="resource"
id="com.ui.revisionChangesTab"
label="Revision Changes">
</propertyTab>
<propertyTab
afterTab="com.ui.revisionChangesTab"
category="resource"
id="com.ui.allByParameterTab"
label="All by Parameter">
</propertyTab>
<propertyTab
afterTab="com.ui.allByParameterTab"
category="resource"
id="com.ui.allByRevisionTab"
label="All by Revision">
</propertyTab>
</propertyTabs>
</extension>
And I want to add the same context menu entry "Compare..." and its dynamic sub-menu entries to all the tabs in the Properties view and they should become visible only upon certain selections in the Properties view
So far, I tried adding the same context menu entry to the Properties view the following way -
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="true"
locationURI="popup:org.eclipse.ui.popup.any?after=additions">
<menu
id="compareMenu"
label="Compare..."
tooltip="Compare the selected with other file">
<separator
name="compareGroup"
visible="false">
</separator>
</menu>
</menuContribution>
<menuContribution
locationURI="menu:org.eclipse.ui.views.PropertySheet">
<menu
id="compareMenu"
label="Compare..."
tooltip="Compare the selected file with another file">
<separator
name="compareGroup"
visible="false">
</separator>
</menu>
</menuContribution>
where I have used the value "menu:org.eclipse.ui.views.PropertySheet" as locationURI for the Properties View but this does not seem to work since I don't see the context menu entry, is this the correct way? Should the <menuContribution locationURI be duplicated in the plugin.xml file for various views and is the locationURI I have used correct? Also, how do I make sure the context menu entry will only be visible upon certain selections in the Properties view?
I could not find much information for my scenario after a fair bit of research trying to find Eclipse articles, could you please guide me in the right direction since I'm very new to Eclipse plugin development?
menu:org.eclipse.ui.views.PropertySheetmenu usingmenuContributionwith acommandchild. Possibly you wantcommandrather thanmenu