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

The following are Jave code examples for showing how to use selectAll() 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: ZooKeeperServerNewWizardPage1.java   Source Code and License Vote up 6 votes
@Override
protected GridComposite createGridComposite(Composite parent) {

    GridComposite gridComposite = new GridComposite(parent) {

        @Override
        protected void createContents() {

            GridTextInput hostGridTextInput = new GridTextInput(this, GridTextInput.Type.VALUE_REQUIRED,
                    CONTROL_NAME_HOST_TEXT, "&Host:", ZooKeeperServerDescriptor.DEFAULT_HOST);
            addGridTextInput(hostGridTextInput);
            Text hostText = hostGridTextInput.getText();
            hostText.selectAll();
            hostText.setTextLimit(500);

            GridTextInput portGridTextInput = new GridTextInput(this, GridTextInput.Type.INTEGER_VALUE_REQUIRED,
                    CONTROL_NAME_PORT_TEXT, "&Port:", String.valueOf(ZooKeeperServerDescriptor.DEFAULT_PORT));
            addGridTextInput(portGridTextInput);
            Text portText = portGridTextInput.getText();
            portText.selectAll();

        }
    };

    return gridComposite;
}