Package org.spiffyui.client.widgets

Examples of org.spiffyui.client.widgets.Tooltip


    {
        /*
         * Create a tooltip with a simple body.
         * Add an anchor that will show the tooltip.
         */
        final Tooltip tooltip = new Tooltip();
        tooltip.setBody(new HTML(Index.getStrings().tooltipBody()));
       
        final Anchor anchor = new Anchor(Index.getStrings().showTooltip());       
        final Timer showTooltip = new Timer() {
           
            @Override
            public void run()
            {
                tooltip.showRelativeTo(anchor);
            }
        };
        anchor.addMouseOverHandler(new MouseOverHandler() {
           
            @Override
            public void onMouseOver(MouseOverEvent event)
            {
                /*
                 * Show the tooltip after a delay
                 */
                showTooltip.schedule(tooltip.getAutoCloseTime());
            }
        });
        anchor.addMouseOutHandler(new MouseOutHandler() {

            @Override
            public void onMouseOut(MouseOutEvent event)
            {
                if (tooltip.isShowing()) {
                    /*
                     * Autoclose the tooltip after a delay
                     */
                    tooltip.startAutoCloseTimer();
                } else {
                    /*
                     * Cancel the delay to show the tooltip
                     */
                    showTooltip.cancel();
View Full Code Here

TOP

Related Classes of org.spiffyui.client.widgets.Tooltip

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.