Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Restriction on org.eclipse.ui.internal.* classes
Restriction on org.eclipse.ui.internal.* classes [message #1319894] Mon, 28 April 2014 13:02
Leo Rohr is currently offline Leo RohrFriend
Messages: 1
Registered: April 2014
Junior Member
Hello everybody,

we are developing a Modeling Environment as a plugin for Eclipse. Within this environment it should be possible for the user to modify one of the provided perspectives, i.e. hide/show items in the Coolbar, Menubar and views. It appeared to be difficult to modify the visible Coolbar-/MenuItems when you are not developing an entire RCP-Application but only a Plugin.
The only solution I was able to come up with was to add an access rule in the Java build path to make the org.eclipse.ui.internal.* packages available and then access the items with the CoolbarManager/MenuManager as in the following example:

WorkbenchWindow workbenchWin = (WorkbenchWindow)PlatformUI.getWorkbench().getActiveWorkbenchWindow();
ICoolBarManager coolbarManager = workbenchWin.getCoolBarManager2();
IContributionItem[] items = coolbarManager.getItems();
for(IContributionItem item : items) {
    item.setVisible(false);
}			


However, adding this access rule and then suppressing the "restriction" warnings on every call to these packages seems to a bit dirty.

Hence my question: Why are these packages restricted and is there a better way to do this?


Thanks,
Leo
Previous Topic:Disable option to open a New Editor
Next Topic:[CommonNavigator] double-click problem
Goto Forum:
  


Current Time: Tue Apr 16 14:31:27 GMT 2024

Powered by FUDForum. Page generated in 0.38577 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top