Search in sources :

Example 1 with MessageType

use of eu.esdihumboldt.hale.ui.views.report.properties.details.extension.CustomReportDetailsPage.MessageType in project hale by halestudio.

the class ReportTreeLabelProvider method getImage.

@Override
public Image getImage(Object element) {
    if (element instanceof Message) {
        // get the right image
        Message message = (Message) element;
        String img = "icons/warning.gif";
        if (message.getStackTrace() != null && !message.getStackTrace().equals("")) {
            img = "icons/error_log.gif";
        } else {
            MessageType type = getMessageType(message);
            if (type != null) {
                switch(type) {
                    case Error:
                        img = "icons/error.gif";
                        break;
                    case Information:
                        img = "icons/info.gif";
                        break;
                    case // keep default
                    Warning:
                        break;
                }
            }
        }
        return getImage(img);
    } else
        return super.getImage(element);
}
Also used : Message(eu.esdihumboldt.hale.common.core.report.Message) MessageType(eu.esdihumboldt.hale.ui.views.report.properties.details.extension.CustomReportDetailsPage.MessageType)

Aggregations

Message (eu.esdihumboldt.hale.common.core.report.Message)1 MessageType (eu.esdihumboldt.hale.ui.views.report.properties.details.extension.CustomReportDetailsPage.MessageType)1