<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FGWT%2FTooltip</id>
		<title>Java/GWT/Tooltip - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FGWT%2FTooltip"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/GWT/Tooltip&amp;action=history"/>
		<updated>2026-04-19T04:46:42Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/GWT/Tooltip&amp;diff=7045&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/GWT/Tooltip&amp;diff=7045&amp;oldid=prev"/>
				<updated>2010-06-01T06:35:33Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:35, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/GWT/Tooltip&amp;diff=7044&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/GWT/Tooltip&amp;diff=7044&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:44Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Tooltip component for GWT ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
package com.jexp.gwt.client;&lt;br /&gt;
import com.google.gwt.user.client.Timer;&lt;br /&gt;
import com.google.gwt.user.client.ui.MouseListenerAdapter;&lt;br /&gt;
import com.google.gwt.user.client.ui.PopupPanel;&lt;br /&gt;
import com.google.gwt.user.client.ui.Widget;&lt;br /&gt;
import com.google.gwt.core.client.EntryPoint;&lt;br /&gt;
import com.google.gwt.user.client.Window;&lt;br /&gt;
import com.google.gwt.user.client.ui.Button;&lt;br /&gt;
import com.google.gwt.user.client.ui.ClickListener;&lt;br /&gt;
import com.google.gwt.user.client.ui.RootPanel;&lt;br /&gt;
import com.google.gwt.user.client.ui.Widget;&lt;br /&gt;
import com.google.gwt.user.client.ui.DialogBox;&lt;br /&gt;
import com.google.gwt.user.client.ui.DockPanel;&lt;br /&gt;
import com.google.gwt.user.client.ui.HTML;&lt;br /&gt;
import com.google.gwt.user.client.ui.Image;&lt;br /&gt;
public class GWTClient implements EntryPoint {&lt;br /&gt;
  public void onModuleLoad() {&lt;br /&gt;
    Image img = new Image(&amp;quot;./yourImage.jpg&amp;quot;);&lt;br /&gt;
    img.addMouseListener(&lt;br /&gt;
        new TooltipListener(&lt;br /&gt;
          &amp;quot;your text&amp;quot;, 5000 /* timeout in milliseconds*/,&amp;quot;yourcssclass&amp;quot;));&lt;br /&gt;
    RootPanel.get().add(img);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
/*&lt;br /&gt;
Tooltip component for GWT&lt;br /&gt;
Copyright (C) 2006 Alexei Sokolov http://gwt.ruponents.googlepages.ru/&lt;br /&gt;
This library is free software; you can redistribute it and/or&lt;br /&gt;
modify it under the terms of the GNU Lesser General Public&lt;br /&gt;
License as published by the Free Software Foundation; either&lt;br /&gt;
version 2.1 of the License, or (at your option) any later version.&lt;br /&gt;
This library is distributed in the hope that it will be useful,&lt;br /&gt;
but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU&lt;br /&gt;
Lesser General Public License for more details.&lt;br /&gt;
You should have received a copy of the GNU Lesser General Public&lt;br /&gt;
License along with this library; if not, write to the Free Software&lt;br /&gt;
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
class TooltipListener extends MouseListenerAdapter {&lt;br /&gt;
  private static final String DEFAULT_TOOLTIP_STYLE = &amp;quot;TooltipPopup&amp;quot;;&lt;br /&gt;
  private static final int DEFAULT_OFFSET_X = 10;&lt;br /&gt;
  private static final int DEFAULT_OFFSET_Y = 35;&lt;br /&gt;
  private static class Tooltip extends PopupPanel {&lt;br /&gt;
    private int delay;&lt;br /&gt;
    public Tooltip(Widget sender, int offsetX, int offsetY, &lt;br /&gt;
        final String text, final int delay, final String styleName) {&lt;br /&gt;
      super(true);&lt;br /&gt;
      this.delay = delay;&lt;br /&gt;
      HTML contents = new HTML(text);&lt;br /&gt;
      add(contents);&lt;br /&gt;
      int left = sender.getAbsoluteLeft() + offsetX;&lt;br /&gt;
      int top = sender.getAbsoluteTop() + offsetY;&lt;br /&gt;
      setPopupPosition(left, top);&lt;br /&gt;
      setStyleName(styleName);&lt;br /&gt;
    }&lt;br /&gt;
    public void show() {&lt;br /&gt;
      super.show();&lt;br /&gt;
      Timer t = new Timer() {&lt;br /&gt;
        public void run() {&lt;br /&gt;
          Tooltip.this.hide();&lt;br /&gt;
        }&lt;br /&gt;
      };&lt;br /&gt;
      t.schedule(delay);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  private Tooltip tooltip;&lt;br /&gt;
  private String text;&lt;br /&gt;
  private String styleName;&lt;br /&gt;
  private int delay;&lt;br /&gt;
  private int offsetX = DEFAULT_OFFSET_X;&lt;br /&gt;
  private int offsetY = DEFAULT_OFFSET_Y;&lt;br /&gt;
  public TooltipListener(String text, int delay) {&lt;br /&gt;
    this(text, delay, DEFAULT_TOOLTIP_STYLE);&lt;br /&gt;
  }&lt;br /&gt;
  public TooltipListener(String text, int delay, String styleName) {&lt;br /&gt;
    this.text = text;&lt;br /&gt;
    this.delay = delay;&lt;br /&gt;
    this.styleName = styleName;&lt;br /&gt;
  }&lt;br /&gt;
  public void onMouseEnter(Widget sender) {&lt;br /&gt;
    if (tooltip != null) {&lt;br /&gt;
      tooltip.hide();&lt;br /&gt;
    }&lt;br /&gt;
    tooltip = new Tooltip(sender, offsetX, offsetY, text, delay, styleName);&lt;br /&gt;
    tooltip.show();&lt;br /&gt;
  }&lt;br /&gt;
  public void onMouseLeave(Widget sender) {&lt;br /&gt;
    if (tooltip != null) {&lt;br /&gt;
      tooltip.hide();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public String getStyleName() {&lt;br /&gt;
    return styleName;&lt;br /&gt;
  }&lt;br /&gt;
  public void setStyleName(String styleName) {&lt;br /&gt;
    this.styleName = styleName;&lt;br /&gt;
  }&lt;br /&gt;
  public int getOffsetX() {&lt;br /&gt;
    return offsetX;&lt;br /&gt;
  }&lt;br /&gt;
  public void setOffsetX(int offsetX) {&lt;br /&gt;
    this.offsetX = offsetX;&lt;br /&gt;
  }&lt;br /&gt;
  public int getOffsetY() {&lt;br /&gt;
    return offsetY;&lt;br /&gt;
  }&lt;br /&gt;
  public void setOffsetY(int offsetY) {&lt;br /&gt;
    this.offsetY = offsetY;&lt;br /&gt;
  }&lt;br /&gt;
} &lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>