Example usage for org.eclipse.jface.dialogs ErrorSupportProvider validFor

List of usage examples for org.eclipse.jface.dialogs ErrorSupportProvider validFor

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs ErrorSupportProvider validFor.

Prototype

public boolean validFor(IStatus status) 

Source Link

Document

This method is called before #createSupportArea(Composite,IStatus) to check if the ErrorSupportProvider will display any significant informations.

Usage

From source file:aurora.ide.helpers.StatusDialog.java

License:Open Source License

/**
 * Create the area for extra error support information.
 * // ww  w  .j a  v a  2s.c o m
 * @param parent
 */
private void createSupportArea(Composite parent) {

    ErrorSupportProvider provider = Policy.getErrorSupportProvider();

    if (provider == null)
        return;

    if (!provider.validFor(status)) {
        return;
    }

    Composite supportArea = new Composite(parent, SWT.NONE);
    provider.createSupportArea(supportArea, status);

    GridData supportData = new GridData(SWT.FILL, SWT.FILL, true, true);
    supportData.verticalSpan = 3;
    supportArea.setLayoutData(supportData);
    if (supportArea.getLayout() == null) {
        GridLayout layout = new GridLayout();
        layout.marginWidth = 0;
        layout.marginHeight = 0;
        supportArea.setLayout(layout); // Give it a default layout if one
        // isn't set
    }

}