this.presenter = presenter;
setLayout(new FillLayout());
this.leftComposite = new Composite(this, SWT.NONE);
final Sash sash = new Sash(this, SWT.VERTICAL);
this.rightComposite = new Composite(this, SWT.BORDER);
final FormLayout form = new FormLayout();
this.setLayout(form);
FormData leftCompositeData = new FormData();
leftCompositeData.left = new FormAttachment(0, 0);
leftCompositeData.right = new FormAttachment(sash, 0);
leftCompositeData.top = new FormAttachment(0, 0);
leftCompositeData.bottom = new FormAttachment(100, 0);
this.leftComposite.setLayoutData(leftCompositeData);
final int limit = 20;
final int percent = 20;
final FormData sashData = new FormData();
sashData.left = new FormAttachment(percent, 0);
sashData.top = new FormAttachment(0, 0);
sashData.bottom = new FormAttachment(100, 0);
sash.setLayoutData(sashData);
sash.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(final Event e) {
Rectangle sashRect = sash.getBounds();
Rectangle shellRect = CharacterView.this.getClientArea();
int right = shellRect.width - sashRect.width - limit;
e.x = Math.max(Math.min(e.x, right), limit);
if (e.x != sashRect.x) {
sashData.left = new FormAttachment(0, e.x);