Skip to content
This repository has been archived by the owner on Aug 5, 2019. It is now read-only.

TooltipCellDecorator for TextCells #515

Open
phnmnm opened this issue Jan 30, 2015 · 2 comments
Open

TooltipCellDecorator for TextCells #515

phnmnm opened this issue Jan 30, 2015 · 2 comments

Comments

@phnmnm
Copy link

phnmnm commented Jan 30, 2015

Hi,

I already posted this on a closed issue. Wasnt sure if you see it. Related to #238.

Im trying to add a TooltipCellDecorator to a TextCell. Is this only possible for ButtonCells?

    TextCell textCell = new TextCell();
    TooltipCellDecorator<String> cellDecorator = new TooltipCellDecorator<>(textCell);
    cellDecorator.setAnimation(true);
    cellDecorator.setHideDelay(1000);
    cellDecorator.setShowDelay(200);
    cellDecorator.setPlacement(Placement.BOTTOM);
    final ToolTipColumn<GwtSynchronizedPropertyDTO> tNameCol = new ToolTipColumn<GwtSynchronizedPropertyDTO>(textCell, cellDecorator) {
            @Override
            public String getValue(GwtSynchronizedPropertyDTO pItem) {
                return (pItem.getName() != null) ? pItem.getName() : "  -";
            }
        };
public abstract class ToolTipColumn<T> extends Column<T, String> {

    TooltipCellDecorator cellDecorator;

    public ToolTipColumn(TextCell pTextCell, TooltipCellDecorator pTooltipCellDecorator)
    {
        super(pTextCell);

        cellDecorator = pTooltipCellDecorator;
    }

    @Override
    public void onBrowserEvent(Cell.Context context, Element elem, T object, NativeEvent event) {
        super.onBrowserEvent(context, elem, object, event);
    }

    @Override
    public void render(Cell.Context context, T object, SafeHtmlBuilder sb) {
        cellDecorator.render(context, getValue(object), sb);
    }
}

I dont know if its the right spot to post this. But I would be happy if you could help me. Am I missing something?

I added the override to the onBrowserEvent. But it isnt called. It looks like it doesnt listen to the HOVER of the cell.

Best regards,

@phnmnm
Copy link
Author

phnmnm commented Feb 3, 2015

Any hints?

@bxf12315
Copy link

Hi, i met same issue, could you have any solution ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants