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.jdt.internal.debug.ui.classpath.RuntimeClasspathViewer.java

License:Open Source License

/**
 * Creates a runtime classpath viewer with the given parent.
 *
 * @param parent the parent control//from   www .j av a2  s .c  om
 */
public RuntimeClasspathViewer(Composite parent) {
    super(parent);

    GridData data = new GridData(GridData.FILL_BOTH);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    data.heightHint = getTree().getItemHeight();
    getTree().setLayoutData(data);

    getTree().addKeyListener(new KeyAdapter() {
        @Override
        public void keyPressed(KeyEvent event) {
            if (updateSelection(RuntimeClasspathAction.REMOVE, (IStructuredSelection) getSelection())
                    && event.character == SWT.DEL && event.stateMask == 0) {
                List<?> selection = getSelectionFromWidget();
                getClasspathContentProvider().removeAll(selection);
                notifyChanged();
            }
        }
    });
    getTree().addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
            IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(LaunchingPlugin.ID_PLUGIN);
            if (prefs != null) {
                prefs.removePreferenceChangeListener(fPrefListeners);
            }
        }
    });
    IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(LaunchingPlugin.ID_PLUGIN);
    if (prefs != null) {
        prefs.addPreferenceChangeListener(fPrefListeners);
    }
}

From source file:org.eclipse.jet.internal.ui.launch.JETTransformMainTab.java

License:Open Source License

private void createInputBlock(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    group.setText(Messages.JETTransformMainTab_TransformInputGroup);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;//from   w w  w. ja  v  a 2  s .  c  o m
    group.setLayout(layout);
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    sourceField = new Text(group, SWT.BORDER);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    sourceField.setLayoutData(gridData);
    sourceField.addModifyListener(fListener);
    final String accessibleName = group.getText().replaceFirst("(?<!&)&", ""); //$NON-NLS-1$ //$NON-NLS-2$
    sourceField.getAccessible().addAccessibleListener(new AccessibleAdapter() {

        public void getName(AccessibleEvent e) {
            e.result = accessibleName;
        }
    });

    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, Messages.JETTransformMainTab_BrowseButtonLabel,
            null);
    workspaceLocationButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {

            IResource resource = chooseResource(getShell());
            if (resource != null) {
                sourceField.setText(resource.getFullPath().makeRelative().toString());
            }
        }
    });

}

From source file:org.eclipse.jet.internal.ui.launch.JETTransformMainTab.java

License:Open Source License

private void createMapFileBlock(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    group.setText("Mapping file");
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;/*from   w  w w . jav  a2  s .  c o m*/
    group.setLayout(layout);
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    mappingFileField = new Text(group, SWT.BORDER);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    mappingFileField.setLayoutData(gridData);
    mappingFileField.addModifyListener(fListener);
    final String accessibleName = group.getText().replaceFirst("(?<!&)&", ""); //$NON-NLS-1$ //$NON-NLS-2$
    mappingFileField.getAccessible().addAccessibleListener(new AccessibleAdapter() {

        public void getName(AccessibleEvent e) {
            e.result = accessibleName;
        }
    });

    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());

    mappingFileWorkspaceLocationButton = createPushButton(buttonComposite,
            Messages.JETTransformMainTab_BrowseButtonLabel, null);
    mappingFileWorkspaceLocationButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {

            IPath mappingFile = chooseOrCreateResource(getShell());
            if (mappingFile != null) {
                mappingFileField.setText(mappingFile.makeRelative().toString());
            }
        }
    });

}

From source file:org.eclipse.jpt.common.ui.internal.widgets.Pane.java

License:Open Source License

/**
 * This layout will leave space for decorations on widgets.
 * Whether decorated or not, all of the widgets need the same indent
  * so that they align properly.//from w  w  w.j a  v  a2 s  .  co  m
 */
protected 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;
    data.grabExcessHorizontalSpace = true;
    return data;
}

From source file:org.eclipse.jpt.jpa.eclipselink.ui.internal.dialogs.EclipseLinkAddVirtualAttributeDialog.java

License:Open Source License

protected GridData getFieldGridData(int span) {
    int margin = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
    GridData data = new GridData();
    data.horizontalSpan = span;// w  w w .j  av  a2s.c om
    data.horizontalAlignment = SWT.FILL;
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH + margin;
    data.horizontalIndent = margin;
    data.grabExcessHorizontalSpace = true;
    return data;
}

From source file:org.eclipse.jpt.jpa.ui.internal.dialogs.AddPersistentClassDialog.java

License:Open Source License

protected 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 ww w .  jav  a 2 s  . com*/
    data.grabExcessHorizontalSpace = true;
    return data;
}

From source file:org.eclipse.jsch.internal.ui.authenticator.KeyboardInteractiveDialog.java

License:Open Source License

/**
 * Creates the three widgets that represent the user name entry area.
 * /*from   ww w . j a  v  a2 s . c o m*/
 * @param parent  the parent of the widgets
 */
protected void createUsernameFields(Composite parent) {
    new Label(parent, SWT.NONE).setText(Messages.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.jsch.internal.ui.authenticator.KeyboardInteractiveDialog.java

License:Open Source License

/**                                                                                           
 * Creates the widgets that represent the entry area.                          
 *                                                                                            
 * @param parent  the parent of the widgets                                                   
 *//*from  w  ww .  j a v a  2  s  . c  o  m*/
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]);
        int flag = SWT.BORDER;
        if (!echo[i]) {
            flag |= SWT.PASSWORD;
        }
        texts[i] = new Text(parent, flag);
        GridData data = new GridData(GridData.FILL_HORIZONTAL);
        data.horizontalSpan = 2;
        data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
        texts[i].setLayoutData(data);
        if (!echo[i]) {
            texts[i].setEchoChar('*');
        }
    }
}

From source file:org.eclipse.jsch.internal.ui.authenticator.UserValidationDialog.java

License:Open Source License

/**
 * Creates the three widgets that represent the password entry area.
 * //  ww  w.  j ava2 s . com
 * @param parent
 *          the parent of the widgets
 */
protected void createPasswordFields(Composite parent) {
    new Label(parent, SWT.NONE).setText(Messages.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.jsch.internal.ui.KeyboardInteractiveDialog.java

License:Open Source License

/**
 * Creates the three widgets that represent the user name entry area.
 * //from  w  ww  .  ja v a  2  s  .com
 * @param parent  the parent of the widgets
 */
protected void createUsernameFields(Composite parent) {
    new Label(parent, SWT.NONE).setText(Messages.KeyboardInteractiveDialog_6);

    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);
}