Search in sources :

Example 1 with WrappedText

use of eu.esdihumboldt.hale.ui.util.graph.WrappedText in project hale by halestudio.

the class GraphLabelProvider method getTooltip.

/**
 * @see IEntityStyleProvider#getTooltip(Object)
 */
@Override
public IFigure getTooltip(Object entity) {
    if (entity instanceof Cell) {
        Cell cell = (Cell) entity;
        FunctionDefinition<?> function = FunctionUtil.getFunction(cell.getTransformationIdentifier(), serviceProvider);
        if (function != null) {
            CellExplanation explanation = function.getExplanation();
            if (explanation != null) {
                String text = explanation.getExplanation(cell, serviceProvider);
                if (text != null) {
                    return new WrappedText(text, 400);
                }
            }
        }
    }
    // default
    return null;
}
Also used : CellExplanation(eu.esdihumboldt.hale.common.align.model.CellExplanation) WrappedText(eu.esdihumboldt.hale.ui.util.graph.WrappedText) Cell(eu.esdihumboldt.hale.common.align.model.Cell)

Aggregations

Cell (eu.esdihumboldt.hale.common.align.model.Cell)1 CellExplanation (eu.esdihumboldt.hale.common.align.model.CellExplanation)1 WrappedText (eu.esdihumboldt.hale.ui.util.graph.WrappedText)1