Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to remove standard icons from Properties View?(I want to use activities to hide "Restore Default Value" icon/context menu item..)
How to remove standard icons from Properties View? [message #555794] Sat, 28 August 2010 16:45
Maciej  is currently offline Maciej
Messages: 4
Registered: August 2010
Junior Member
Hello,

I have the following problem - I am looking for the solution how to remove the standard Properties View icons (and context menu item): "Show Advanced Properties" and "Restore Defaults Value". Now I am doing that in such way, overridding PropertySheetPage class and makeContributions method:

@Override
public void makeContributions(IMenuManager menuManager,
IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
for (IContributionItem item : menuManager.getItems()) {
if (item instanceof ActionContributionItem) {
if ("filter".equals(((ActionContributionItem) item).getAction().getId())
|| "defaults".equals(((ActionContributionItem) item).getAction().getId())) {
menuManager.remove(item);
}
}
}
for (IContributionItem item : toolBarManager.getItems()) {
if (item instanceof ActionContributionItem) {
if ("filter".equals(((ActionContributionItem) item).getAction().getId())
|| "defaults".equals(((ActionContributionItem) item).getAction().getId())) {
toolBarManager.remove(item);
}
}
}
}


But I couldn't remove the "Restore Default Value" context item i such way, due to too many package private eclipse classes.

On the other hand, while blocking main window menu items, I used activities in plugin.xml:

<extension
point="org.eclipse.ui.activities">
<activity
id="activity.removeUnusedIcons"
name="RemoveUnusedIcons">
</activity>
<activityPatternBinding
activityId="activity.removeUnusedIcons"
pattern="org.eclipse.ui.editors/org.eclipse.ui.edit.text.*nnotation ">
</activityPatternBinding>
<activityPatternBinding
activityId="activity.removeUnusedIcons"
pattern=" org.eclipse.ui.editors/org.eclipse.ui.edit.text.gotoLastEdit Position ">
</activityPatternBinding>
<activityPatternBinding
activityId="activity.removeUnusedIcons"
pattern="org.eclipse.search.*">
</activityPatternBinding>
</extension>


Here's my question: can I use activities to hide properties view icons/context?

Thanks for any hints! Smile

[Updated on: Mon, 30 August 2010 06:55]

Report message to a moderator

Previous Topic:No popup menu shown with empty TableViewer
Next Topic:Adding a popup menu to each page of a CTabFolder
Goto Forum:
  


Current Time: Wed Jul 30 11:23:39 EDT 2014

Powered by FUDForum. Page generated in 0.01414 seconds