Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Disabling trim space in MArea
Disabling trim space in MArea [message #1429145] Mon, 22 September 2014 21:57 Go to next message
Ned Twigg is currently offline Ned TwiggFriend
Messages: 9
Registered: April 2013
Junior Member
When an MArea contains only a single MPartStack, the maximize/minimize buttons appear in the top right, but there's no "extra trim". Once the MArea is split to contain multiple MPartStacks, a trim area is introduced.

Is there any way to disable this "extra trim"? I've mucked with application.css and forked org.eclipse.e4.ui.workbench.addons.swt, but I can't figure it out...

Thanks!

P.S. My reason for asking is that my custom RCP application has only one "root" PartSashContainer, and it's unsettling for this extra trim to come and go.
Re: Disabling trim space in MArea [message #1429396 is a reply to message #1429145] Tue, 23 September 2014 07:17 Go to previous message
Ned Twigg is currently offline Ned TwiggFriend
Messages: 9
Registered: April 2013
Junior Member
Welp, this probably isn't the right answer, but it works for me.

You can set the `rendererFactoryUri` by adding a snippet like this to your product extension:

<property
    name="rendererFactoryUri"
    value="bundleclass://com.myplugin/package.to.MyWorkbenchRendererFactory">
</property>


If you set the renderer for MArea to be the regular MPartSashContainer's renderer, it just works.

Here's my code:

import org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.model.application.ui.advanced.MArea;
import org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer;
import org.eclipse.e4.ui.workbench.renderers.swt.WorkbenchRendererFactory;

public class MyWorkbenchRendererFactory extends WorkbenchRendererFactory {
	private SashRenderer areaRenderer;

	@Override
	public AbstractPartRenderer getRenderer(MUIElement uiElement, Object parent) {
		if (uiElement instanceof MArea) {
			if (areaRenderer == null) {
				areaRenderer = new SashRenderer();
				initRenderer(areaRenderer);
			}
			return areaRenderer;
		} else {
			return super.getRenderer(uiElement, parent);
		}
	}
}


Of course, now the "Minimize/Maximize" buttons will be rendered strangely, but I disable them anyway.
Previous Topic:change main menu after opening a file
Next Topic:IDE application based on the E4 platform
Goto Forum:
  


Current Time: Wed Jan 20 03:47:20 GMT 2021

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

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

Back to the top