Example usage for org.eclipse.jface.dialogs IDialogConstants ENTRY_FIELD_WIDTH

List of usage examples for org.eclipse.jface.dialogs IDialogConstants ENTRY_FIELD_WIDTH

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants ENTRY_FIELD_WIDTH.

Prototype

int ENTRY_FIELD_WIDTH

To view the source code for org.eclipse.jface.dialogs IDialogConstants ENTRY_FIELD_WIDTH.

Click Source Link

Document

Entry field width in dialog units (value 200).

Usage

From source file:org.eclipse.rcptt.internal.launching.ext.ui.AUTLocationBlock.java

License:Open Source License

public void createControl(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    String locationLabel = "&Application Under Test (AUT)";
    group.setText(locationLabel);/* www  .  j a va2 s . co m*/
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    group.setLayout(layout);
    group.setLayoutData(gridData);

    Label l = new Label(group, SWT.WRAP);
    l.setText("Location:");
    locationField = new Text(group, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    locationField.setLayoutData(gridData);
    locationField.addModifyListener(fListener);
    ControlAccessibleListener.addListener(locationField, group.getText());

    Composite buttonComposite = new Composite(group, SWT.NONE);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 3;
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
    buttonComposite.setLayout(layout);
    buttonComposite.setLayoutData(gridData);
    buttonComposite.setFont(parent.getFont());
    fileLocationButton = SWTFactory.createPushButton(buttonComposite, "File Syste&m...", null);
    fileLocationButton.addSelectionListener(fListener);
    ControlAccessibleListener.addListener(fileLocationButton,
            group.getText() + " " + fileLocationButton.getText()); //$NON-NLS-1$

}

From source file:org.eclipse.rcptt.internal.launching.ext.ui.wizards.NewAUTPage.java

License:Open Source License

private void createControlLocation(Composite parent) {
    // Label and Field
    Label locationLabel = new Label(parent, SWT.NONE);
    locationLabel.setText("Location:");

    Text locationField = new Text(parent, SWT.BORDER);
    GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER)
            .hint(IDialogConstants.ENTRY_FIELD_WIDTH, SWT.DEFAULT).applyTo(locationField);

    // On change sets page complete = false
    ISWTObservableValue locationModifyObservable = SWTObservables.observeText(locationField, SWT.Modify);
    locationModifyObservable.addChangeListener(new IChangeListener() {
        public void handleChange(ChangeEvent event) {
            setPageComplete(false);/*from  ww  w.j  a  v a  2  s.  c  o m*/
        }
    });
    dbc.bindValue(Observables.observeDelayedValue(FIELD_TIMEOUT, locationModifyObservable), locationValue);
    // ... and runs validation after delay
    locationValue.addChangeListener(new IChangeListener() {
        public void handleChange(ChangeEvent event) {
            validate(true);
        }
    });

    // Browse button
    Button fileLocationButton = new Button(parent, SWT.PUSH);
    fileLocationButton.setText("&Browse...");
    fileLocationButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            handleSelectLocation();
        }
    });
    GridDataFactory.fillDefaults().grab(false, false).applyTo(fileLocationButton);
    SWTFactory.setButtonDimensionHint(fileLocationButton);
}

From source file:org.eclipse.rcptt.internal.launching.ext.ui.wizards.NewAUTPage.java

License:Open Source License

private void createControlName(Composite parent) {
    // Label and Field
    Label nameLabel = new Label(parent, SWT.NONE);
    nameLabel.setText("Name:");

    Text nameField = new Text(parent, SWT.BORDER);
    GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER)
            .hint(IDialogConstants.ENTRY_FIELD_WIDTH, SWT.DEFAULT).span(2, 1).applyTo(nameField);

    // On change sets page complete = false
    ISWTObservableValue nameModifyObservable = SWTObservables.observeText(nameField, SWT.Modify);
    nameModifyObservable.addChangeListener(new IChangeListener() {
        public void handleChange(ChangeEvent event) {
            setPageComplete(false);/*from   www  .ja v  a2  s.c  o  m*/
        }
    });
    dbc.bindValue(Observables.observeDelayedValue(FIELD_TIMEOUT, nameModifyObservable), nameValue);
    // ... and runs validation after delay
    nameValue.addChangeListener(new IChangeListener() {
        public void handleChange(ChangeEvent event) {
            validatePlatform();
        }
    });
}

From source file:org.eclipse.rcptt.internal.launching.rap.ui.AUTLocationBlock.java

License:Open Source License

public void createControl(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    String locationLabel = "&RAP Under Test (AUT)";
    group.setText(locationLabel);// w  w w.  ja v a2s.com
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    group.setLayout(layout);
    group.setLayoutData(gridData);

    Label l = new Label(group, SWT.WRAP);
    l.setText("Location:");
    locationField = new Text(group, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    locationField.setLayoutData(gridData);
    locationField.addModifyListener(fListener);
    ControlAccessibleListener.addListener(locationField, group.getText());

    Composite buttonComposite = new Composite(group, SWT.NONE);
    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 3;
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
    buttonComposite.setLayout(layout);
    buttonComposite.setLayoutData(gridData);
    buttonComposite.setFont(parent.getFont());
    fileLocationButton = SWTFactory.createPushButton(buttonComposite, "File Syste&m...", null);
    fileLocationButton.addSelectionListener(fListener);
    ControlAccessibleListener.addListener(fileLocationButton,
            group.getText() + " " + fileLocationButton.getText()); //$NON-NLS-1$

}

From source file:org.eclipse.rcptt.internal.launching.remote.ui.AUTArgumentsBlock.java

License:Open Source License

public void createControl(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    String locationLabel = "&Remote Application Under Test (AUT)";
    group.setText(locationLabel);//from   ww  w. j a va2s  . c  o m
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    group.setLayout(layout);
    group.setLayoutData(gridData);

    Label l = new Label(group, SWT.WRAP);
    l.setText("Host:");
    hostField = new Text(group, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    hostField.setLayoutData(gridData);
    hostField.addModifyListener(listener);
    // hostField.setEnabled(false);

    l = new Label(group, SWT.WRAP);
    l.setText("ECL port:");
    eclPortField = new Text(group, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    eclPortField.setLayoutData(gridData);
    eclPortField.addModifyListener(listener);

    l = new Label(group, SWT.WRAP);
    l.setText("Tesla port:");
    teslaPortField = new Text(group, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    teslaPortField.setLayoutData(gridData);
    teslaPortField.addModifyListener(listener);

    VerifyListener verity = new VerifyListener() {
        public void verifyText(VerifyEvent e) {
            for (char c : e.text.toCharArray()) {
                if (!Character.isDigit(c)) {
                    e.doit = false;
                }
            }
        }
    };
    eclPortField.addVerifyListener(verity);
    teslaPortField.addVerifyListener(verity);
}

From source file:org.eclipse.rcptt.launching.configuration.ui.Q7LaunchConfigurationTab.java

License:Open Source License

private void createSourceConfText(Composite parent) {
    sourceConfField = new Text(parent, SWT.BORDER);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    sourceConfField.setLayoutData(gridData);
    sourceConfField.setEditable(false);/*from   w  w w  . j  a v  a  2  s. c o m*/

    sourceConfField.addModifyListener(modifyListener);
}

From source file:org.eclipse.team.examples.filesystem.ui.FileSystemMainPage.java

License:Open Source License

protected Combo createCombo(Composite parent) {
    Combo combo = new Combo(parent, SWT.READ_ONLY);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    combo.setLayoutData(data);/*from  www.j  ava  2  s .  c  o m*/
    return combo;
}

From source file:org.eclipse.team.examples.filesystem.ui.FileSystemMainPage.java

License:Open Source License

protected Text createTextField(Composite parent) {
    Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.verticalAlignment = GridData.CENTER;
    data.grabExcessVerticalSpace = false;
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    text.setLayoutData(data);//from ww w. j a v a 2  s .c om
    return text;
}

From source file:org.eclipse.team.examples.filesystem.ui.FileSystemMainPage.java

License:Open Source License

protected Combo createEditableCombo(Composite parent) {
    Combo combo = new Combo(parent, SWT.NULL);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    combo.setLayoutData(data);/*w ww. j ava  2s.  c  o m*/
    return combo;
}

From source file:org.eclipse.team.internal.ccvs.ui.ExtMethodPreferencePage.java

License:Open Source License

protected Combo createCombo(Composite parent) {
    Combo combo = new Combo(parent, SWT.READ_ONLY);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    data.horizontalSpan = 1;/*from  w  w w.java 2  s . co  m*/
    combo.setLayoutData(data);
    return combo;
}