问题
I've an application built on eclipse e4 framework. I want to position a Handled Tool Item
to the far right end. How can I achieve it?
回答1:
You need to use two 'Toolbar' entries with a 'Tool Control' between them:
so something like:
In the Tags for the Tool Control add the word stretch
this will make the trim bar manager stretch out the control to use all available space pushing everything after it to the right:
The class for the control can something simple like:
public class SpacerControl
{
@PostConstruct
public void postConstruct(Composite parent)
{
Composite body = new Composite(parent, SWT.NONE);
body.setLayout(new GridLayout());
}
}
来源:https://stackoverflow.com/questions/28484737/how-to-position-a-handled-tool-item-to-the-right