Disabling trim space in MArea [message #1429145] |
Mon, 22 September 2014 17:57  |
Eclipse User |
|
|
|
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 03:17  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.04084 seconds