Example usage for org.eclipse.jface.util StatusHandler show

List of usage examples for org.eclipse.jface.util StatusHandler show

Introduction

In this page you can find the example usage for org.eclipse.jface.util StatusHandler show.

Prototype

abstract public void show(IStatus status, String title);

Source Link

Document

Show the given status.

Usage

From source file:org.eclipse.gyrex.admin.ui.internal.application.AdminApplication.java

License:Open Source License

private void setupJFacePolicy() {
    Policy.setLog(new ILogger() {

        @Override//from   w ww.  j av a 2  s . co  m
        public void log(final IStatus status) {
            if (status.matches(IStatus.CANCEL) || status.matches(IStatus.ERROR)) {
                LOG.error(status.getMessage(), status.getException());
            } else if (status.matches(IStatus.WARNING)) {
                LOG.warn(status.getMessage(), status.getException());
            } else {
                LOG.info(status.getMessage(), status.getException());
            }
        }
    });
    final StatusHandler defaultStatusHandler = Policy.getStatusHandler();
    Policy.setStatusHandler(new StatusHandler() {

        @Override
        public void show(final IStatus status, final String title) {
            Policy.getLog().log(status);
            defaultStatusHandler.show(status, title);
        }
    });
}