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.tm.terminal.connector.ssh.connector.KeyboardInteractiveDialog.java

License:Open Source License

/**
 * Creates the widgets that represent the entry area.
 *
 * @param parent  the parent of the widgets
 *//*from   w  w w  .j  a  v a  2 s  .co  m*/
@SuppressWarnings("unused")
protected void createPasswordFields(Composite parent) {
    texts = new Text[prompt.length];

    for (int i = 0; i < prompt.length; i++) {
        new Label(parent, SWT.NONE).setText(prompt[i]);
        texts[i] = new Text(parent, SWT.BORDER);
        GridData data = new GridData(GridData.FILL_HORIZONTAL);
        data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
        texts[i].setLayoutData(data);

        if (!echo[i]) {
            texts[i].setEchoChar('*');
        }
        new Label(parent, SWT.NONE);
    }

}

From source file:org.eclipse.tm.terminal.connector.ssh.connector.UserValidationDialog.java

License:Open Source License

/**
 * Creates the three widgets that represent the password entry area.
 *
 * @param parent  the parent of the widgets
 *//*from   www. ja v  a2  s.  com*/
protected void createPasswordFields(Composite parent) {
    new Label(parent, SWT.NONE).setText(SshMessages.UserValidationDialog_password);

    passwordField = new Text(parent, SWT.BORDER | SWT.PASSWORD);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
    passwordField.setLayoutData(data);
}

From source file:org.eclipse.tm.terminal.connector.ssh.connector.UserValidationDialog.java

License:Open Source License

/**
 * Creates the three widgets that represent the user name entry area.
 *
 * @param parent  the parent of the widgets
 *///from  w  ww  .  j a  v  a 2 s .c o m
protected void createUsernameFields(Composite parent) {
    new Label(parent, SWT.NONE).setText(SshMessages.UserValidationDialog_user);

    usernameField = new Text(parent, SWT.BORDER);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
    usernameField.setLayoutData(data);
}

From source file:org.eclipse.ui.dialogs.NewFolderDialog.java

License:Open Source License

/**
 * Creates the folder name specification controls.
 *
 * @param parent the parent composite//  w  w w  . ja  v  a  2  s.  c o  m
 */
private void createFolderNameGroup(Composite parent) {
    Font font = parent.getFont();
    // project specification group
    Composite folderGroup = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    folderGroup.setLayout(layout);
    folderGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // new folder label
    Label folderLabel = new Label(folderGroup, SWT.NONE);
    folderLabel.setFont(font);
    folderLabel.setText(IDEWorkbenchMessages.NewFolderDialog_nameLabel);

    // new folder name entry field
    folderNameField = new Text(folderGroup, SWT.BORDER);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    folderNameField.setLayoutData(data);
    folderNameField.setFont(font);
    folderNameField.addListener(SWT.Modify, new Listener() {
        public void handleEvent(Event event) {
            validateLinkedResource();
        }
    });
}

From source file:org.eclipse.ui.examples.fieldassist.FieldAssistTestDialog.java

License:Open Source License

GridData getFieldGridData() {
    int margin = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
    GridData data = new GridData();
    data.horizontalAlignment = SWT.FILL;
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH + margin;
    data.horizontalIndent = margin;/*from www.ja  va  2s  .c  o m*/
    data.grabExcessHorizontalSpace = true;
    return data;

}

From source file:org.eclipse.ui.examples.fieldassist.FieldAssistTestDialog.java

License:Open Source License

GridData getMultiLineTextFieldGridData() {
    int margin = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
    GridData data = new GridData();
    data.horizontalAlignment = SWT.FILL;
    data.verticalAlignment = SWT.FILL;/*from   w  ww. ja v  a2  s  .c o m*/
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH + margin;
    data.heightHint = JFaceResources.getDialogFont().getFontData()[0].getHeight() * 5;
    data.horizontalIndent = margin;
    data.grabExcessHorizontalSpace = true;
    data.grabExcessVerticalSpace = true;
    return data;

}

From source file:org.eclipse.ui.examples.statushandlers.testtool.views.JobsAndRunnablesComponent.java

License:Open Source License

/**
 * Creates global entry group.// w  w  w .j  av a  2 s .  c o  m
 * 
 * @param body
 *            parent on which all controls should be set
 */
private void createEntryFieldGroup(Composite body) {
    // duration
    Label label = new Label(body, SWT.NONE);
    label.setText("Duration:"); //$NON-NLS-1$
    durationField = new Combo(body, SWT.DROP_DOWN | SWT.READ_ONLY);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    durationField.setLayoutData(data);
    durationField.setToolTipText(Messages.JobsAndRunnablesComponent_DurationTooltip);
    durationField.add("0"); //$NON-NLS-1$
    durationField.add(Messages.JobsAndRunnablesComponent_1ms);
    durationField.add(Messages.JobsAndRunnablesComponent_1s);
    durationField.add(Messages.JobsAndRunnablesComponent_10s);
    durationField.add(Messages.JobsAndRunnablesComponent_1minute);
    durationField.add(Messages.JobsAndRunnablesComponent_10minutes);
    durationField.select(3); // default 10 seconds

    label = new Label(body, SWT.NONE);
    label.setText(Messages.JobsAndRunnablesComponent_ThrowAfter);
    percentField = new Scale(body, SWT.NONE);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    percentField.setLayoutData(data);
    percentField.setToolTipText(Messages.JobsAndRunnablesComponent_DefaultThrowAfterTooltip);
    percentField.setMinimum(1);
    percentField.setMaximum(100);
    percentField.setSelection(50);
    percentField.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            percentField.setToolTipText(NLS.bind(Messages.JobsAndRunnablesComponent_ExceptionThrownAfter,
                    new Integer(percentField.getSelection())));

        }

    });

    label = new Label(body, SWT.NONE);
    label.setText(Messages.JobsAndRunnablesComponent_Exception);
    exceptionField = new Combo(body, SWT.DROP_DOWN | SWT.READ_ONLY);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    exceptionField.setLayoutData(data);
    exceptionField.setToolTipText(Messages.JobsAndRunnablesComponent_ExceptionFromTheJob);
    exceptionField.add("NullPointerException"); //$NON-NLS-1$
    exceptionField.add("OutOfMemoryError"); //$NON-NLS-1$
    exceptionField.add("IndexOutOfBoundsException");//$NON-NLS-1$
    exceptionField.select(0);

}

From source file:org.eclipse.ui.examples.statushandlers.testtool.views.JobsAndRunnablesComponent.java

License:Open Source License

private Composite createRunJob(Composite parent) {
    Composite group = new Composite(parent, SWT.BORDER);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;/*from   ww  w.  j  a  v  a2s  .c om*/
    group.setLayout(layout);
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label label = new Label(group, SWT.NONE);
    label.setText(Messages.JobsAndRunnablesComponent_DelayLabel);
    delayField = new Text(group, SWT.BORDER);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    delayField.setLayoutData(data);
    delayField.setToolTipText(Messages.JobsAndRunnablesComponent_DelayTooltip);
    delayField.setText(Messages.JobsAndRunnablesComponent_23);

    label = new Label(group, SWT.NONE);
    label.setText(Messages.JobsAndRunnablesComponent_Quantity);
    quantityField = new Text(group, SWT.BORDER);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    quantityField.setLayoutData(data);
    quantityField.setToolTipText(Messages.JobsAndRunnablesComponent_QunatityTooltip);
    quantityField.setText("1"); //$NON-NLS-1$

    // reschedule delay
    label = new Label(group, SWT.NONE);
    label.setText(Messages.JobsAndRunnablesComponent_ResheduleDelayLabel);
    rescheduleDelayField = new Text(group, SWT.BORDER);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    rescheduleDelayField.setLayoutData(data);
    rescheduleDelayField.setToolTipText(Messages.JobsAndRunnablesComponent_ResheduleValueTooltip);
    rescheduleDelayField.setText(Messages.JobsAndRunnablesComponent_DefaultResheduleValue);

    // thread
    threadField = new Button(group, SWT.CHECK);
    threadField.setText(Messages.JobsAndRunnablesComponent_UIThreadLabel);
    data = new GridData(GridData.FILL_HORIZONTAL);
    threadField.setLayoutData(data);
    threadField.setToolTipText(Messages.JobsAndRunnablesComponent_UIJobTooltip);

    // lock
    jobLockField = new Button(group, SWT.CHECK);
    jobLockField.setText(Messages.JobsAndRunnablesComponent_LockedWorkspace);
    data = new GridData(GridData.FILL_HORIZONTAL);
    jobLockField.setLayoutData(data);
    jobLockField.setToolTipText(Messages.JobsAndRunnablesComponent_LockedWorkspaceTooltip);

    // system
    systemField = new Button(group, SWT.CHECK);
    systemField.setText(Messages.JobsAndRunnablesComponent_SystemJobLabel);
    data = new GridData(GridData.FILL_HORIZONTAL);
    systemField.setLayoutData(data);
    systemField.setToolTipText(Messages.JobsAndRunnablesComponent_SystemJobTooltip);

    // whether the job is a user job
    userField = new Button(group, SWT.CHECK);
    userField.setText(Messages.JobsAndRunnablesComponent_UserJob);
    data = new GridData(GridData.FILL_HORIZONTAL);
    userField.setLayoutData(data);
    userField.setToolTipText(Messages.JobsAndRunnablesComponent_UserJobTooltip);

    // groups
    groupField = new Button(group, SWT.CHECK);
    groupField.setText(Messages.JobsAndRunnablesComponent_SingleGroupLabel);
    data = new GridData(GridData.FILL_HORIZONTAL);
    groupField.setLayoutData(data);
    groupField.setToolTipText(Messages.JobsAndRunnablesComponent_SingleGroupTooltip);

    // reschedule
    rescheduleField = new Button(group, SWT.CHECK);
    rescheduleField.setText(Messages.JobsAndRunnablesComponent_resheduleLabel);
    data = new GridData(GridData.FILL_HORIZONTAL);
    rescheduleField.setLayoutData(data);
    rescheduleField.setToolTipText(Messages.JobsAndRunnablesComponent_resheduleTooltip);

    returnErrorStatusField = new Button(group, SWT.CHECK);
    returnErrorStatusField.setText("Wrapped"); //$NON-NLS-1$
    data = new GridData(GridData.FILL_HORIZONTAL);
    returnErrorStatusField.setLayoutData(data);
    returnErrorStatusField.setToolTipText(Messages.JobsAndRunnablesComponent_wrapTooltip);

    deferredStatusField = new Button(group, SWT.CHECK);
    deferredStatusField.setText("Deffered"); //$NON-NLS-1$
    deferredStatusField.setToolTipText("Does not report error immediately"); //$NON-NLS-1$
    return group;
}

From source file:org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsMainTab.java

License:Open Source License

/**
 * Creates the controls needed to edit the location
 * attribute of an external tool// w w w  . ja  v  a  2s .  com
 * 
 * @param parent the composite to create the controls in
 */
protected void createLocationComponent(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    String locationLabel = getLocationLabel();
    group.setText(locationLabel);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    group.setLayout(layout);
    group.setLayoutData(gridData);

    locationField = new Text(group, SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    locationField.setLayoutData(gridData);
    locationField.addModifyListener(fListener);
    addControlAccessibleListener(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());

    workspaceLocationButton = createPushButton(buttonComposite,
            ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Browse_Workspace____3, null);
    workspaceLocationButton.addSelectionListener(fListener);
    addControlAccessibleListener(workspaceLocationButton,
            group.getText() + " " + workspaceLocationButton.getText()); //$NON-NLS-1$

    fileLocationButton = createPushButton(buttonComposite,
            ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Brows_e_File_System____4, null);
    fileLocationButton.addSelectionListener(fListener);
    addControlAccessibleListener(fileLocationButton, group.getText() + " " + fileLocationButton.getText()); //$NON-NLS-1$

    variablesLocationButton = createPushButton(buttonComposite,
            ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_31, null);
    variablesLocationButton.addSelectionListener(fListener);
    addControlAccessibleListener(variablesLocationButton,
            group.getText() + " " + variablesLocationButton.getText()); //$NON-NLS-1$
}

From source file:org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsMainTab.java

License:Open Source License

/**
 * Creates the controls needed to edit the working directory
 * attribute of an external tool/*from ww  w . j av  a2  s  .  c o m*/
 * 
 * @param parent the composite to create the controls in
 */
protected void createWorkDirectoryComponent(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    String groupName = getWorkingDirectoryLabel();
    group.setText(groupName);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    group.setLayout(layout);
    group.setLayoutData(gridData);

    workDirectoryField = new Text(group, SWT.BORDER);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    workDirectoryField.setLayoutData(data);
    workDirectoryField.addModifyListener(fListener);
    addControlAccessibleListener(workDirectoryField, group.getText());

    Composite buttonComposite = new Composite(group, SWT.NONE);
    layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.numColumns = 3;
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
    buttonComposite.setLayout(layout);
    buttonComposite.setLayoutData(gridData);
    buttonComposite.setFont(parent.getFont());

    workspaceWorkingDirectoryButton = createPushButton(buttonComposite,
            ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Browse_Wor_kspace____6, null);
    workspaceWorkingDirectoryButton.addSelectionListener(fListener);
    addControlAccessibleListener(workspaceWorkingDirectoryButton,
            group.getText() + " " + workspaceWorkingDirectoryButton.getText()); //$NON-NLS-1$

    fileWorkingDirectoryButton = createPushButton(buttonComposite,
            ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Browse_F_ile_System____7, null);
    fileWorkingDirectoryButton.addSelectionListener(fListener);
    addControlAccessibleListener(fileWorkingDirectoryButton,
            group.getText() + " " + fileLocationButton.getText()); //$NON-NLS-1$

    variablesWorkingDirectoryButton = createPushButton(buttonComposite,
            ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_32, null);
    variablesWorkingDirectoryButton.addSelectionListener(fListener);
    addControlAccessibleListener(variablesWorkingDirectoryButton,
            group.getText() + " " + variablesWorkingDirectoryButton.getText()); //$NON-NLS-1$
}