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.team.internal.ccvs.ui.KeyboardInteractiveDialog.java

License:Open Source License

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

License:Open Source License

/**
  * Creates the widgets that represent the entry area.
  * //from w  w w  .ja v a  2 s . c  om
  * @param parent
  *            the parent of the widgets
  */
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 | SWT.PASSWORD);
        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.team.internal.ccvs.ui.repo.CVSRepositoryPropertiesPage.java

License:Open Source License

/**
 * Utility method that creates a combo box
 *
 * @param parent  the parent for the new label
 * @return the new widget//from w  w w.j av a2 s  .co  m
 */
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 = 2;
    combo.setLayoutData(data);
    return combo;
}

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

License:Open Source License

/**
 * Layout a text or password field specific for this application
 *
 * @param parent  the parent of the new text field
 * @return the new text field// ww  w.j a  va2s  .c o m
 */
protected Text layoutTextField(Text text) {
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.verticalAlignment = GridData.CENTER;
    data.grabExcessVerticalSpace = false;
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    data.horizontalSpan = 2;
    text.setLayoutData(data);
    return text;
}

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

License:Open Source License

protected Combo createDropDownCombo(Composite parent) {
    Combo combo = new Combo(parent, SWT.DROP_DOWN);
    GridData comboData = new GridData(GridData.FILL_HORIZONTAL);
    comboData.verticalAlignment = GridData.CENTER;
    comboData.grabExcessVerticalSpace = false;
    comboData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    combo.setLayoutData(comboData);/*from   w ww .  ja va2s  .  c o m*/
    return combo;
}

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

License:Open Source License

/**
 * Creates the three widgets that represent the password entry area.
 * /* w  ww  . j av a  2  s.  c o  m*/
 * @param parent  the parent of the widgets
 */
protected void createPasswordFields(Composite parent) {
    new Label(parent, SWT.NONE).setText(CVSUIMessages.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.team.internal.ccvs.ui.wizards.ConfigurationWizardMainPage.java

License:Open Source License

/**
 * Utility method to create an editable combo box
 * // w  ww  . j  a  v  a  2  s.co m
 * @param parent  the parent of the combo box
 * @return the created combo
 */
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);
    return combo;
}

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

License:Open Source License

/**
 * Utility method that creates a combo box
 *
 * @param parent  the parent for the new label
 * @return the new widget//from   w  w  w  .j a  v a2  s.c om
 */
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);
    return combo;
}

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

License:Open Source License

/**
 * Layout a text or password field specific for this application
 *
 * @param parent  the parent of the new text field
 * @return the new text field//from  w  ww . j a v  a 2 s.c o m
 */
static public Text layoutTextField(Text text) {
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.verticalAlignment = GridData.CENTER;
    data.grabExcessVerticalSpace = false;
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    text.setLayoutData(data);
    return text;
}

From source file:org.eclipse.team.svn.ui.composite.BranchTagSelectionComposite.java

License:Open Source License

protected void createControls(Composite parent) {
    GridLayout layout = null;/*from   w  ww . java 2s  .  c om*/
    GridData data = null;

    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = layout.marginWidth = 0;
    this.setLayout(layout);

    Label resourceLabel = new Label(this, SWT.NONE);
    resourceLabel.setLayoutData(new GridData());
    if (this.type == BranchTagSelectionComposite.BRANCH_OPERATED) {
        resourceLabel.setText(SVNUIMessages.Select_Branch_Label);
    } else {
        resourceLabel.setText(SVNUIMessages.Select_Tag_Label);
    }

    Composite select = new Composite(this, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = this.considerStructure ? 1 : 2;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    select.setLayout(layout);
    data = new GridData(GridData.FILL_HORIZONTAL);
    select.setLayoutData(data);

    final IRepositoryLocation location = this.baseResource.getRepositoryLocation();

    this.urlText = new Combo(select, this.considerStructure ? SWT.READ_ONLY : SWT.NULL);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    this.urlText.setLayoutData(data);

    if (!this.considerStructure) {
        this.urlText.setVisibleItemCount(this.inputHistory.getDepth() * 2);
        this.urlText.setItems(this.inputHistory.getHistory());
        this.validationManager.attachTo(this.urlText, new NonEmptyFieldVerifier(resourceLabel.getText()));
        this.validationManager.attachTo(this.urlText, new URLVerifier(resourceLabel.getText()));
    } else {
        for (IRepositoryResource branchTagResource : this.branchTagResources) {
            this.urlText.add(branchTagResource.getName());
        }

        if (this.branchTagResources.length > 0) {
            this.urlText.select(0);
            this.url = this.urlText.getText();
        }
    }

    Listener urlTextListener = new Listener() {
        public void handleEvent(Event e) {
            BranchTagSelectionComposite.this.url = ((Combo) e.widget).getText();
            BranchTagSelectionComposite.this.revisionComposite
                    .setSelectedResource(BranchTagSelectionComposite.this.getSelectedResource());
        }
    };
    this.urlText.addListener(SWT.Selection, urlTextListener);
    if (!this.considerStructure) {
        this.urlText.addListener(SWT.Modify, urlTextListener);
    } else {
        this.validationManager.attachTo(this.urlText, new AbstractVerifier() {
            @Override
            protected String getErrorMessage(Control input) {
                if (BranchTagSelectionComposite.this.branchTagResources.length == 0) {
                    return BranchTagSelectionComposite.this.type == BranchTagSelectionComposite.BRANCH_OPERATED
                            ? SVNUIMessages.BranchTagSelectionComposite_NoBranches
                            : SVNUIMessages.BranchTagSelectionComposite_NoTags;
                }
                return null;
            }

            @Override
            protected String getWarningMessage(Control input) {
                return null;
            }
        });
    }

    if (!this.considerStructure) {
        this.browse = new Button(select, SWT.PUSH);
        this.browse.setText(SVNUIMessages.Button_Browse);
        data = new GridData();
        data.widthHint = DefaultDialog.computeButtonWidth(this.browse);
        this.browse.setLayoutData(data);
        this.browse.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                RepositoryTreePanel panel;
                String part = BranchTagSelectionComposite.this.type == BranchTagSelectionComposite.BRANCH_OPERATED
                        ? SVNUIMessages.Select_Branch_Title
                        : SVNUIMessages.Select_Tag_Title;
                panel = new RepositoryTreePanel(part, SVNUIMessages.RepositoryBrowsingPanel_Description,
                        SVNUIMessages.RepositoryBrowsingPanel_Message, null, true, location, false);
                DefaultDialog browser = new DefaultDialog(BranchTagSelectionComposite.this.getShell(), panel);
                if (browser.open() == 0) {
                    IRepositoryResource selectedResource = panel.getSelectedResource();
                    boolean samePeg = selectedResource.getPegRevision()
                            .equals(BranchTagSelectionComposite.this.baseResource.getPegRevision());
                    BranchTagSelectionComposite.this.urlText.setText(samePeg ? selectedResource.getUrl()
                            : SVNUtility.getEntryReference(selectedResource).toString());
                    BranchTagSelectionComposite.this.revisionComposite.setSelectedResource(selectedResource);
                    BranchTagSelectionComposite.this.validationManager.validateContent();
                }
            }
        });
    }

    Composite revisions = new Composite(this, SWT.NONE);
    layout = new GridLayout();
    layout.marginHeight = layout.marginWidth = 0;
    layout.numColumns = 2;
    revisions.setLayout(layout);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    revisions.setLayoutData(data);
    this.revisionComposite = new RevisionComposite(revisions, this.validationManager, true,
            new String[] { SVNUIMessages.RevisionComposite_Revision,
                    SVNUIMessages.RepositoryResourceSelectionComposite_HeadRevision },
            SVNRevision.HEAD, false) {
        public void additionalValidation() {
            BranchTagSelectionComposite.this.validationManager.validateContent();
        }
    };
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    this.revisionComposite.setLayoutData(data);
    this.revisionComposite.setSelectedResource(this.baseResource);
}