Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Grid: ToolTip and image in ColumnHeader
Grid: ToolTip and image in ColumnHeader [message #548526] Thu, 22 July 2010 05:15 Go to next message
David  is currently offline David
Messages: 23
Registered: June 2010
Junior Member
Hello everybody,
In our grid, we use images to display vertical text in the column header.
How can I also display a ToolTip when the mouse is hovering over the header?
When no image is shown, it does work, but with image the ToolTip seems to be deactivated.

Best regards,
David
Re: Grid: ToolTip and image in ColumnHeader [message #555360 is a reply to message #548526] Thu, 26 August 2010 08:13 Go to previous messageGo to next message
David  is currently offline David
Messages: 23
Registered: June 2010
Junior Member
OK, got it by myself.
I extended Grid.java and overwrote handleCellHover(int int).
protected boolean handleCellHover(int x, int y)
    {
        boolean superResult = super.handleCellHover(x, y);

        // redo some code from superMethod to display tooltips in column headers
        // when images are shown
        final GridColumn col = getColumn(new Point(x, y));
        final GridItem item = getItem(new Point(x, y));

        if ((col != null)) {
                if (item == null) {
                    if (y < headerHeight) {
                        if (y >= groupHeaderHeight) {
                            // on col header
                            if ((col.getText() != null)
                                    && ((!col.getText().equals("")) && ((col.getColumnGroup() != null) && (!col
                                            .getColumnGroup().getText().equals("General"))))) {
                                showToolTip(item, col, null, new Point(x + 15, y));
                            }

                        }
                    }

                }
        }

        return superResult;
    }
Re: Grid: ToolTip and image in ColumnHeader [message #555374 is a reply to message #548526] Thu, 26 August 2010 08:58 Go to previous message
David  is currently offline David
Messages: 23
Registered: June 2010
Junior Member
Hm, this way, the tooltip gets displayed immediatly, without the delay that i specified in my CellLabelProvider.
How can i get the delay also in the header?
Previous Topic:CDateTime editing behaviour
Next Topic:Grid: GridColumn SelectionListener
Goto Forum:
  


Current Time: Tue Sep 02 00:34:31 EDT 2014

Powered by FUDForum. Page generated in 0.01811 seconds