Example usage for org.eclipse.jface.dialogs TitleAreaDialog setMessage

List of usage examples for org.eclipse.jface.dialogs TitleAreaDialog setMessage

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs TitleAreaDialog setMessage.

Prototype

public void setMessage(String newMessage) 

Source Link

Document

Set the message text.

Usage

From source file:org.eclipse.e4.tools.ui.designer.wizards.part.NewOptionsPartWizardPage.java

License:Open Source License

protected void handleDataContextProperties() {
    TitleAreaDialog dialog = new TitleAreaDialog(getShell()) {

        public void create() {
            setShellStyle(getShellStyle() | SWT.RESIZE);
            super.create();
        }//ww w .  j  a va  2s.c  o m

        protected Control createDialogArea(Composite parent) {
            Composite control = (Composite) super.createDialogArea(parent);
            Composite newControl = new Composite(control, SWT.NONE);
            newControl.setLayoutData(new GridData(GridData.FILL_BOTH));
            newControl.setLayout(new GridLayout());
            Composite composite = PropertiesComposite.create(newControl, dataContext);
            composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
            return control;
        }

        protected void createButtonsForButtonBar(Composite parent) {
            createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
        }
    };
    dialog.create();
    dialog.setTitle("Properties");
    dialog.getShell().setText("Properties Configure Dialog");
    dialog.setMessage("Configure properties and master value.");
    dialog.open();
}

From source file:org.eclipse.wb.internal.core.utils.dialogfields.StatusUtils.java

License:Open Source License

/**
 * Applies the status to the title area of a dialog.
 *///from   ww w  .  j a  va2s  .  co m
public static void applyToTitleAreaDialog(TitleAreaDialog dialog, IStatus status, String okMessage) {
    String message = status.getMessage();
    switch (status.getSeverity()) {
    case IStatus.OK:
        dialog.setMessage(okMessage);
        dialog.setErrorMessage(null);
        break;
    case IStatus.INFO:
        dialog.setMessage(message, IMessageProvider.INFORMATION);
        dialog.setErrorMessage(null);
        break;
    case IStatus.WARNING:
        dialog.setMessage(message, IMessageProvider.WARNING);
        dialog.setErrorMessage(null);
        break;
    case IStatus.ERROR:
        if (message.length() == 0) {
            message = null;
        }
        dialog.setMessage(null);
        dialog.setErrorMessage(message);
        break;
    }
}