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

	<entry>
		<id>http://jexp.ru/index.php?title=Java/GWT/PopupPanel&amp;diff=7067&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/GWT/PopupPanel&amp;diff=7067&amp;oldid=prev"/>
				<updated>2010-06-01T06:35:39Z</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://jexp.ru/index.php?title=Java/GWT/PopupPanel&amp;diff=7066&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/GWT/PopupPanel&amp;diff=7066&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;== Change style for PopupPanel ==&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.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.PopupPanel;&lt;br /&gt;
import com.google.gwt.user.client.ui.HTML;&lt;br /&gt;
public class GWTClient implements EntryPoint {&lt;br /&gt;
  public void onModuleLoad() {&lt;br /&gt;
    Button b = new Button(&amp;quot;Click me&amp;quot;, new ClickListener() {&lt;br /&gt;
      public void onClick(Widget sender) {&lt;br /&gt;
        MyPopup p = new MyPopup();&lt;br /&gt;
        int left = sender.getAbsoluteLeft() + 10;&lt;br /&gt;
        int top = sender.getAbsoluteTop() + 10;&lt;br /&gt;
        p.setPopupPosition(left, top);&lt;br /&gt;
        p.show();&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    RootPanel.get().add(b);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
class MyPopup extends PopupPanel {&lt;br /&gt;
  public MyPopup() {&lt;br /&gt;
    super(true);&lt;br /&gt;
    HTML contents = new HTML(&amp;quot;Click anywhere outside this popup to make it disappear.&amp;quot;);&lt;br /&gt;
    contents.setWidth(&amp;quot;128px&amp;quot;);&lt;br /&gt;
    setWidget(contents);&lt;br /&gt;
    setStyleName(&amp;quot;popups-Popup&amp;quot;);&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;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== extends PopupPanel to create Tooltip ==&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.*;&lt;br /&gt;
import com.google.gwt.user.client.ui.*;&lt;br /&gt;
import com.google.gwt.core.client.*;&lt;br /&gt;
public class GWTClient implements EntryPoint{&lt;br /&gt;
  public void onModuleLoad() {&lt;br /&gt;
    Label label = new Label();&lt;br /&gt;
    label.setText(&amp;quot;label with tooltip&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    label.addMouseListener(new MouseListenerAdapter() {&lt;br /&gt;
      public void onMouseEnter(Widget sender) {&lt;br /&gt;
         ToolTip tip = new ToolTip(&amp;quot;this is a tooltip.&amp;quot;,0,0);&lt;br /&gt;
      }&lt;br /&gt;
      public void onMouseLeave(Widget sender) {&lt;br /&gt;
      }&lt;br /&gt;
      public void onMouseDown(Widget sender, int x, int y) {&lt;br /&gt;
      }&lt;br /&gt;
      public void onMouseUp(Widget sender, int x, int y) {&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    RootPanel.get().add(label);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
 class ToolTip extends PopupPanel{&lt;br /&gt;
  final int VISIBLE_DELAY = 2000;&lt;br /&gt;
  &lt;br /&gt;
  Timer removeDelay;&lt;br /&gt;
  &lt;br /&gt;
  public ToolTip(String message, int x, int y){&lt;br /&gt;
      super(true);&lt;br /&gt;
      this.setPopupPosition(x, y);&lt;br /&gt;
      this.add(new Label(message));&lt;br /&gt;
      removeDelay = new Timer(){&lt;br /&gt;
      public void run() {&lt;br /&gt;
          ToolTip.this.setVisible(false);&lt;br /&gt;
        ToolTip.this.hide();&lt;br /&gt;
      }        &lt;br /&gt;
      };&lt;br /&gt;
      removeDelay.schedule(VISIBLE_DELAY);&lt;br /&gt;
      this.addPopupListener(new PopupListener(){&lt;br /&gt;
      public void onPopupClosed(PopupPanel sender, boolean autoClosed) {&lt;br /&gt;
        removeDelay.cancel();&lt;br /&gt;
      }&lt;br /&gt;
      });&lt;br /&gt;
      this.setStyleName(&amp;quot;toolTip&amp;quot;);&lt;br /&gt;
      this.show();&lt;br /&gt;
    }&lt;br /&gt;
  &lt;br /&gt;
  public boolean onEventPreview(Event event){&lt;br /&gt;
      int type = DOM.eventGetType(event);&lt;br /&gt;
      switch(type){&lt;br /&gt;
         case Event.ONMOUSEDOWN:&lt;br /&gt;
         case Event.ONCLICK:{&lt;br /&gt;
           this.hide();&lt;br /&gt;
           return true;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
      return false;&lt;br /&gt;
  }&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;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Set position of PopupPanel ==&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;
package com.jexp.gwt.client;&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.PopupPanel;&lt;br /&gt;
import com.google.gwt.user.client.ui.HTML;&lt;br /&gt;
public class GWTClient implements EntryPoint {&lt;br /&gt;
  public void onModuleLoad() {&lt;br /&gt;
    Button b = new Button(&amp;quot;Click me&amp;quot;, new ClickListener() {&lt;br /&gt;
      public void onClick(Widget sender) {&lt;br /&gt;
        MyPopup p = new MyPopup();&lt;br /&gt;
        int left = sender.getAbsoluteLeft() + 10;&lt;br /&gt;
        int top = sender.getAbsoluteTop() + 10;&lt;br /&gt;
        p.setPopupPosition(left, top);&lt;br /&gt;
        p.show();&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    RootPanel.get().add(b);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
class MyPopup extends PopupPanel {&lt;br /&gt;
  public MyPopup() {&lt;br /&gt;
    super(true);&lt;br /&gt;
    HTML contents = new HTML(&amp;quot;Click anywhere outside this popup to make it disappear.&amp;quot;);&lt;br /&gt;
    contents.setWidth(&amp;quot;128px&amp;quot;);&lt;br /&gt;
    setWidget(contents);&lt;br /&gt;
    setStyleName(&amp;quot;popups-Popup&amp;quot;);&lt;br /&gt;
  }&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>