Java Code Examples for org.eclipse.swt.widgets.Text.pack()

The following are Jave code examples for showing how to use pack() of the org.eclipse.swt.widgets.Text class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: eZooKeeper   File: ZooKeeperServerModelFormPage.java   Source Code and License Vote up 5 votes
@Override
protected Control createContents(Composite parent) {

    this.getShell().setText(_Command);

    ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL);
    scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    scrolledComposite.setExpandHorizontal(true);
    Text text = new Text(scrolledComposite, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP);
    text.setText(_Result);
    text.pack();
    scrolledComposite.setContent(text);

    return scrolledComposite;
}