Search in sources :

Example 6 with InstanceValidationMessage

use of eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationMessage in project hale by halestudio.

the class DefinitionInstanceLabelProvider method getToolTipText.

/**
 * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
 */
@Override
public String getToolTipText(Object element) {
    if (element instanceof EntityDefinition) {
        InstanceValidationReport report = validator.validate(instance);
        Collection<InstanceValidationMessage> warnings = report.getWarnings();
        if (warnings.isEmpty())
            return null;
        StringBuilder toolTip = new StringBuilder();
        for (Message m : warnings) toolTip.append(m.getFormattedMessage()).append('\n');
        return toolTip.substring(0, toolTip.length() - 1);
    } else
        return null;
}
Also used : EntityDefinition(eu.esdihumboldt.hale.common.align.model.EntityDefinition) InstanceValidationReport(eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationReport) InstanceValidationMessage(eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationMessage) Message(eu.esdihumboldt.hale.common.core.report.Message) InstanceValidationMessage(eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationMessage)

Aggregations

InstanceValidationMessage (eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationMessage)6 TypeDefinition (eu.esdihumboldt.hale.common.schema.model.TypeDefinition)3 TreePath (org.eclipse.jface.viewers.TreePath)3 Message (eu.esdihumboldt.hale.common.core.report.Message)2 InstanceValidationReport (eu.esdihumboldt.hale.common.instance.extension.validation.report.InstanceValidationReport)2 ChildDefinition (eu.esdihumboldt.hale.common.schema.model.ChildDefinition)2 Definition (eu.esdihumboldt.hale.common.schema.model.Definition)2 EntityDefinition (eu.esdihumboldt.hale.common.align.model.EntityDefinition)1 DefaultInstanceValidationMessage (eu.esdihumboldt.hale.common.instance.extension.validation.report.impl.DefaultInstanceValidationMessage)1 InstanceReference (eu.esdihumboldt.hale.common.instance.model.InstanceReference)1 DefaultInstanceSelection (eu.esdihumboldt.hale.ui.selection.impl.DefaultInstanceSelection)1 InstanceService (eu.esdihumboldt.hale.ui.service.instance.InstanceService)1 SchemaService (eu.esdihumboldt.hale.ui.service.schema.SchemaService)1 Pair (eu.esdihumboldt.util.Pair)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 QName (javax.xml.namespace.QName)1 ISelection (org.eclipse.jface.viewers.ISelection)1 ITreeSelection (org.eclipse.jface.viewers.ITreeSelection)1 StyledString (org.eclipse.jface.viewers.StyledString)1