|
|
|
|
Re: Configure PartStack to be displayed minimized [message #1722049 is a reply to message #1066285] |
Tue, 02 February 2016 13:41 |
|
Thanks a zillion for these instructions!
Beware that whenever you use the MinMax Addon, it assumes that the ID of the tool control where a stack should be minimized is "<stack.id>(<perspective.id>)".
@see org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon#createTrim(MUIElement element)
[...]
// Is there already a TrimControl there ?
String trimId = element.getElementId() + getMinimizedElementSuffix(element);
MToolControl trimStack = (MToolControl) modelService.find(trimId, window);
@see org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon#getMinimizedElementSuffix(MUIElement element)
private String getMinimizedElementSuffix(MUIElement element) {
String id = ID_SUFFIX;
MPerspective persp = modelService.getPerspectiveFor(element);
if (persp != null) {
id = '(' + persp.getElementId() + ')'
}
return id;
}
Additionally, one can also programmatically maximize and minimize a stack by programmatically adding the tag:
myPartStack.getTags().add(<TAG>);
where TAG = { IPresentationEngine.MINIMIZED, IPresentationEngine.MAXIMIZED }.
[Updated on: Wed, 03 February 2016 10:51] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03768 seconds