Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » How to get access to MPart toolbar elements?(I need check items state programmatically)
How to get access to MPart toolbar elements? [message #1401321] Tue, 15 July 2014 08:54 Go to next message
Eclipse UserFriend
All HandledToolItems of my part are added into Toolbar statically via an application model. Not all of them is push, some are check. During usage the program, the user can check or uncheck tool buttons, and MPart contents should be changed in view of the status of all check buttons.

Earlier in Eclipse 3.* I used this code:

for (MToolBarElement item : activePart.getToolbar().getChildren()) {
	HandledToolItemImpl hti = (HandledToolItemImpl)item;
	if (hti.isSelected())
		switch (hti.getElementId()) {
			case "harmonic": ...


In Eclipse 4 it does not work:

Access restriction: The method 'MElementContainer <MToolBarElement>. GetChildren ()' is not API (restriction on required library '/ home/nataly/soft/eclipsercp/plugins/org.eclipse.e4.ui.model.workbench_1.1.0.v20140512 -1820.jar ')

Please suggest how should I access the toolbar elements to check their status?

[Updated on: Tue, 15 July 2014 08:55] by Moderator

Re: How to get access to MPart toolbar elements? [message #1406834 is a reply to message #1401321] Mon, 11 August 2014 04:07 Go to previous message
Eclipse UserFriend
I think you should configure it in the plugin.xml 。

in the dependencies tab, you import this package in the page's right part.

then the restriction should be permitted.

===========================

if this still not work,you should configure the java build path,

in the Plug-in Dependencies libraires ,

configure the access rules

add access rules,resolution : Accessable, Rule Pattern **/* ,

then it will be ok.
Previous Topic:eclipse luna maven src attachment not working unless I specify the src location
Next Topic:Weird behaviour on standalone Luna application
Goto Forum:
  


Current Time: Tue Jul 15 12:09:18 EDT 2025

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

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

Back to the top