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

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

Introduction

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

Prototype

int MINIMUM_MESSAGE_AREA_WIDTH

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

Click Source Link

Document

Minimum width of message area in dialog units (value 300).

Usage

From source file:org.eclipse.recommenders.internal.privacy.rcp.dialogs.PermissionApprovalDialog.java

License:Open Source License

private void createDescription(Composite parent, String message) {
    Label label = new Label(parent, SWT.WRAP);
    label.setText(message);/* www.  j a v a  2 s.c  o m*/
    GridDataFactory.fillDefaults().hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH, SWT.DEFAULT)
            .applyTo(label);
}

From source file:org.eclipse.recommenders.internal.privacy.rcp.preferences.AnonymousIdPreferencePage.java

License:Open Source License

private void createDescription(Composite parent, String message) {
    Link link = new Link(parent, SWT.WRAP);
    GridDataFactory.fillDefaults().hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH, SWT.DEFAULT)
            .grab(true, false).applyTo(link);
    final String linkToPreferencePage = PreferencesHelper.createLinkLabelToPreferencePage(PREF_PAGE_ID);
    link.setText(MessageFormat.format(Messages.ANONYMOUS_ID_PREFPAGE_DESCRIPTION, linkToPreferencePage));

    link.addSelectionListener(new SelectionAdapter() {
        @Override/*  w  ww  . j ava2 s  .c  o  m*/
        public void widgetSelected(SelectionEvent event) {
            PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, PREF_PAGE_ID, null, null);
            dialog.open();
        }
    });
}

From source file:org.eclipse.recommenders.internal.privacy.rcp.widgets.PrivacyTooltipSupport.java

License:Open Source License

@Override
protected Composite createToolTipContentArea(Event event, Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(1, false);
    layout.marginWidth = layout.marginHeight = 0;
    layout.verticalSpacing = layout.horizontalSpacing = 0;
    composite.setLayout(layout);/*w  ww  .  ja v a 2  s  .co m*/

    Link link = new Link(composite, SWT.NONE);
    link.setText(getText(event));
    link.setLayoutData(GridDataFactory.fillDefaults()
            .hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH, SWT.DEFAULT).create());
    link.setBackground(event.widget.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    link.setForeground(event.widget.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(event.text));
            } catch (PartInitException e) {
                e.printStackTrace();
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
        }
    });
    return composite;
}

From source file:org.eclipse.recommenders.internal.privacy.rcp.wizards.IntroPage.java

License:Open Source License

@Override
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.WRAP);
    glf = GridLayoutFactory.fillDefaults();
    glf.numColumns(2).applyTo(container);
    gdf = GridDataFactory.fillDefaults().grab(true, false).hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH,
            SWT.DEFAULT);/*  w  ww  . j  av a 2  s  .c  o  m*/

    createDescription(container);
    createPreferenceLink(container);
    createWebsiteLink(container);
    setControl(container);

    Dialog.applyDialogFont(container);
}

From source file:org.eclipse.reqcycle.predicates.ui.dialogs.AbstractCustomDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {

    Composite container = (Composite) super.createDialogArea(parent);

    if (this.message != null) {
        Label label = new Label(container, SWT.WRAP);
        label.setText(this.message);
        GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
                | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
        data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
        label.setLayoutData(data);//from   w w  w.jav  a  2  s . c o m
        label.setFont(parent.getFont());
    }

    createCustomDialogArea(container);

    errorMessageText = new Text(container, SWT.READ_ONLY | SWT.WRAP);
    errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    setErrorMessage(errorMessage);

    applyDialogFont(container);

    return container;
}

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

License:Open Source License

protected Label createWrappingLabel(Composite parent, String text) {
    Label label = new Label(parent, SWT.LEFT | SWT.WRAP);
    label.setText(text);//from   ww  w  .ja v a  2  s . c o m
    GridData data = new GridData();
    data.horizontalSpan = 1;
    data.horizontalAlignment = GridData.FILL;
    data.horizontalIndent = 0;
    data.grabExcessHorizontalSpace = true;
    data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(data);
    label.setFont(parent.getFont());
    return label;
}

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

License:Open Source License

protected Control createDialogArea(Composite parent) {
    // create composite
    Composite composite = (Composite) super.createDialogArea(parent);
    // create message
    if (message != null) {
        Label label = new Label(composite, SWT.WRAP);
        label.setText(message);/*from  ww  w  .j  a v a 2  s  .  c  o  m*/
        GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL
                | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
        data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
        label.setLayoutData(data);
        label.setFont(parent.getFont());
    }
    text = new Text(composite, SWT.MULTI | SWT.BORDER);
    GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
    gd.heightHint = convertHeightInCharsToPixels(5);
    text.setLayoutData(gd);
    text.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            validateInput();
        }
    });
    errorMessageText = new Text(composite, SWT.READ_ONLY);
    errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));

    applyDialogFont(composite);
    return composite;
}

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

License:Open Source License

/**
 * @see DetailsDialog#createMainDialogArea(Composite)
 *///  w ww .j av a 2 s  . c  o m
protected void createMainDialogArea(Composite composite) {

    applyDialogFont(composite);
    initializeDialogUnits(composite);

    final int areaWidth = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);

    final Label description = SWTUtils.createLabel(composite,
            allStickyResources ? CVSUIMessages.BranchWizardPage_pageDescriptionVersion
                    : CVSUIMessages.BranchWizardPage_pageDescription);
    description.setLayoutData(SWTUtils.createGridData(areaWidth, SWT.DEFAULT, true, false));

    final Label name = SWTUtils.createLabel(composite, CVSUIMessages.BranchWizardPage_branchName);
    name.setLayoutData(SWTUtils.createGridData(areaWidth, SWT.DEFAULT, true, false));

    branchText = CVSWizardPage.createTextField(composite);
    branchText.addListener(SWT.Modify, new Listener() {
        public void handleEvent(Event event) {
            branchTag = branchText.getText();
            updateEnablements();
            updateVersionName(branchTag);
        }
    });
    addBranchContentAssist();

    final Button check = SWTUtils.createCheckBox(composite, CVSUIMessages.BranchWizardPage_startWorking);
    check.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
            update = check.getSelection();
        }
    });
    check.setSelection(true);
    update = true;

    final Label versionLabel1 = SWTUtils.createLabel(composite, CVSUIMessages.BranchWizardPage_specifyVersion);
    versionLabel1.setLayoutData(SWTUtils.createGridData(areaWidth, SWT.DEFAULT, true, false));

    final Label versionLabel2 = SWTUtils.createLabel(composite, CVSUIMessages.BranchWizardPage_versionName);
    versionLabel2.setLayoutData(SWTUtils.createGridData(areaWidth, SWT.DEFAULT, true, false));

    versionText = CVSWizardPage.createTextField(composite);
    versionText.addListener(SWT.Modify, new Listener() {
        public void handleEvent(Event event) {
            versionTag = versionText.getText();
            updateEnablements();
        }
    });

    if (allStickyResources) {
        versionText.setEditable(false);
        versionText.setText(versionName);
    }

    applyDialogFont(composite);
    branchText.setFocus();
}

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

License:Open Source License

/**
 * @see DetailsDialog#createMainDialogArea(Composite)
 *///from  w w  w .  j a  v a  2 s.com
protected void createMainDialogArea(Composite parent) {

    final int width = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH + 50);

    final Label label = SWTUtils.createLabel(parent, CVSUIMessages.TagAction_enterTag);
    label.setLayoutData(SWTUtils.createGridData(width, SWT.DEFAULT, true, false));

    tagCombo = createDropDownCombo(parent);
    tagName = ""; //$NON-NLS-1$
    tagCombo.setItems(getTagNameHistory());
    tagCombo.setText(tagName);
    tagCombo.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            tagName = tagCombo.getText();
            updateEnablements();
        }
    });

    moveTagButton = SWTUtils.createCheckBox(parent, CVSUIMessages.TagAction_moveTag);
    moveTagButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            moveTag = moveTagButton.getSelection();
        }
    });

}

From source file:org.eclipse.team.internal.ui.dialogs.DetailsDialogWithProjects.java

License:Open Source License

/**
 * @see DetailsDialog#createMainDialogArea(Composite)
 *///ww w  . j  av  a2s  .c om
protected void createMainDialogArea(Composite composite) {
    Label label = new Label(composite, SWT.WRAP);
    label.setText(message);
    GridData data = new GridData(SWT.FILL, SWT.FILL | SWT.CENTER, true, false);
    data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(data);
    updateEnablements();
}