Bug 471326 - main toolbar control contributions is cut off
Summary: main toolbar control contributions is cut off
Status: CLOSED DUPLICATE of bug 471313
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: PC Windows 7
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-29 10:19 EDT by Flavio Donze CLA
Modified: 2017-05-02 03:04 EDT (History)
4 users (show)

See Also:


Attachments
modified example mail application (85.38 KB, application/octet-stream)
2015-06-29 10:19 EDT, Flavio Donze CLA
no flags Details
application printscreen in Luna (4.4.2) (29.26 KB, image/png)
2015-06-29 10:20 EDT, Flavio Donze CLA
no flags Details
application printscreen in Mars (4.5.0) (29.40 KB, image/png)
2015-06-29 10:20 EDT, Flavio Donze CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Flavio Donze CLA 2015-06-29 10:19:04 EDT
Created attachment 254802 [details]
modified example mail application

After updating from eclipse 4.4.2 to 4.5.0 main toolbar control contributions using the "org.eclipse.ui.menus" extension point are being cut off (see attachment printscreens).

Attached the modified example mail application:

plugin.xml
<extension
	 point="org.eclipse.ui.menus">
  <menuContribution
		locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
	 <toolbar
		   id="test">
		<control
			  class="toolbarexample.TestControl"
			  id="test.control">
		</control>
	 </toolbar>
  </menuContribution>
</extension>

/toolbar-example/src/toolbarexample/TestControl.java
public class TestControl extends WorkbenchWindowControlContribution {

	/**
	 *
	 */
	public TestControl() {
	}

	/**
	 * @param id
	 */
	public TestControl(String id) {
		super(id);
	}

	@Override
	protected Control createControl(Composite parent) {
		Label label = new Label(parent, SWT.BORDER);
		label.setText("Test Label");
		return label;
	}

}
Comment 1 Flavio Donze CLA 2015-06-29 10:20:04 EDT
Created attachment 254803 [details]
application printscreen in Luna (4.4.2)
Comment 2 Flavio Donze CLA 2015-06-29 10:20:35 EDT
Created attachment 254804 [details]
application printscreen in Mars (4.5.0)
Comment 3 Flavio Donze CLA 2015-06-30 10:37:39 EDT
I figured out this workaround.

The class should extend ControlContribution instead of WorkbenchWindowControlContribution.

In the ApplicationActionBarAdvisor.fillCoolBar() add

toolbar.add(new TestControl("testControl"));
Comment 4 Andrey Loskutov CLA 2017-05-02 03:04:59 EDT

*** This bug has been marked as a duplicate of bug 471313 ***