Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:54 Go to next message
Natalie Mogilka is currently offline Natalie MogilkaFriend
Messages: 27
Registered: August 2010
Location: Kazakhstan, Almaty
Junior Member
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 12:55]

Report message to a moderator

Re: How to get access to MPart toolbar elements? [message #1406834 is a reply to message #1401321] Mon, 11 August 2014 08:07 Go to previous message
Frank Chan is currently offline Frank ChanFriend
Messages: 4
Registered: January 2014
Junior Member
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 Mar 19 07:35:38 GMT 2024

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

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

Back to the top