<?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_Tutorial%2FSWT%2FUI_Auto</id>
		<title>Java Tutorial/SWT/UI Auto - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FSWT%2FUI_Auto"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/UI_Auto&amp;action=history"/>
		<updated>2026-04-21T11:27:12Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/UI_Auto&amp;diff=3067&amp;oldid=prev</id>
		<title> в 17:44, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/UI_Auto&amp;diff=3067&amp;oldid=prev"/>
				<updated>2010-05-31T17:44:26Z</updated>
		
		<summary type="html">&lt;p&gt;&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;Версия 17:44, 31 мая 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>
			</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/UI_Auto&amp;diff=3068&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/SWT/UI_Auto&amp;diff=3068&amp;oldid=prev"/>
				<updated>2010-05-31T15:20:16Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== 17. UI Automation for testing tools: post key events ==&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;
 * Copyright (c) 2000, 2004 IBM Corporation and others.&lt;br /&gt;
 * All rights reserved. This program and the accompanying materials&lt;br /&gt;
 * are made available under the terms of the Eclipse Public License v1.0&lt;br /&gt;
 * which accompanies this distribution, and is available at&lt;br /&gt;
 * http://www.eclipse.org/legal/epl-v10.html&lt;br /&gt;
 *&lt;br /&gt;
 * Contributors:&lt;br /&gt;
 *     IBM Corporation - initial API and implementation&lt;br /&gt;
 *******************************************************************************/&lt;br /&gt;
/*&lt;br /&gt;
 * UI Automation (for testing tools) snippet: post key events&lt;br /&gt;
 *&lt;br /&gt;
 * For a list of all SWT example snippets see&lt;br /&gt;
 * http://www.eclipse.org/swt/snippets/&lt;br /&gt;
 * &lt;br /&gt;
 * @since 3.0&lt;br /&gt;
 */&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Event;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
import org.eclipse.swt.widgets.Text;&lt;br /&gt;
public class KeyEventPost {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    final Display display = new Display();&lt;br /&gt;
    final Shell shell = new Shell(display);&lt;br /&gt;
    final Text text = new Text(shell, SWT.BORDER);&lt;br /&gt;
    text.setSize(text.ruputeSize(150, SWT.DEFAULT));&lt;br /&gt;
    shell.pack();&lt;br /&gt;
    shell.open();&lt;br /&gt;
    new Thread() {&lt;br /&gt;
      public void run() {&lt;br /&gt;
        String string = &amp;quot;Love the method.&amp;quot;;&lt;br /&gt;
        for (int i = 0; i &amp;lt; string.length(); i++) {&lt;br /&gt;
          char ch = string.charAt(i);&lt;br /&gt;
          boolean shift = Character.isUpperCase(ch);&lt;br /&gt;
          ch = Character.toLowerCase(ch);&lt;br /&gt;
          if (shift) {&lt;br /&gt;
            Event event = new Event();&lt;br /&gt;
            event.type = SWT.KeyDown;&lt;br /&gt;
            event.keyCode = SWT.SHIFT;&lt;br /&gt;
            display.post(event);&lt;br /&gt;
          }&lt;br /&gt;
          Event event = new Event();&lt;br /&gt;
          event.type = SWT.KeyDown;&lt;br /&gt;
          event.character = ch;&lt;br /&gt;
          display.post(event);&lt;br /&gt;
          try {&lt;br /&gt;
            Thread.sleep(10);&lt;br /&gt;
          } catch (InterruptedException e) {&lt;br /&gt;
          }&lt;br /&gt;
          event.type = SWT.KeyUp;&lt;br /&gt;
          display.post(event);&lt;br /&gt;
          try {&lt;br /&gt;
            Thread.sleep(100);&lt;br /&gt;
          } catch (InterruptedException e) {&lt;br /&gt;
          }&lt;br /&gt;
          if (shift) {&lt;br /&gt;
            event = new Event();&lt;br /&gt;
            event.type = SWT.KeyUp;&lt;br /&gt;
            event.keyCode = SWT.SHIFT;&lt;br /&gt;
            display.post(event);&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }.start();&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch())&lt;br /&gt;
        display.sleep();&lt;br /&gt;
    }&lt;br /&gt;
    display.dispose();&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;
== 17. UI Automation for testing tools: post mouse events ==&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;
 * Copyright (c) 2000, 2004 IBM Corporation and others.&lt;br /&gt;
 * All rights reserved. This program and the accompanying materials&lt;br /&gt;
 * are made available under the terms of the Eclipse Public License v1.0&lt;br /&gt;
 * which accompanies this distribution, and is available at&lt;br /&gt;
 * http://www.eclipse.org/legal/epl-v10.html&lt;br /&gt;
 *&lt;br /&gt;
 * Contributors:&lt;br /&gt;
 *     IBM Corporation - initial API and implementation&lt;br /&gt;
 *******************************************************************************/&lt;br /&gt;
/*&lt;br /&gt;
 * UI Automation (for testing tools) snippet: post mouse events&lt;br /&gt;
 *&lt;br /&gt;
 * For a list of all SWT example snippets see&lt;br /&gt;
 * http://www.eclipse.org/swt/snippets/&lt;br /&gt;
 * &lt;br /&gt;
 * @since 3.0&lt;br /&gt;
 */&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.graphics.Point;&lt;br /&gt;
import org.eclipse.swt.widgets.Button;&lt;br /&gt;
import org.eclipse.swt.widgets.Display;&lt;br /&gt;
import org.eclipse.swt.widgets.Event;&lt;br /&gt;
import org.eclipse.swt.widgets.Listener;&lt;br /&gt;
import org.eclipse.swt.widgets.Shell;&lt;br /&gt;
public class MouseEventPost {&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    final Display display = new Display();&lt;br /&gt;
    final Shell shell = new Shell(display);&lt;br /&gt;
    final Button button = new Button(shell, SWT.NONE);&lt;br /&gt;
    button.setSize(100, 100);&lt;br /&gt;
    button.setText(&amp;quot;Click&amp;quot;);&lt;br /&gt;
    shell.pack();&lt;br /&gt;
    shell.open();&lt;br /&gt;
    button.addListener(SWT.MouseDown, new Listener() {&lt;br /&gt;
      public void handleEvent(Event e) {&lt;br /&gt;
        System.out.println(&amp;quot;Mouse Down (button: &amp;quot; + e.button + &amp;quot; x: &amp;quot; + e.x + &amp;quot; y: &amp;quot; + e.y + &amp;quot;)&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    final Point pt = display.map(shell, null, 50, 50);&lt;br /&gt;
    new Thread() {&lt;br /&gt;
      Event event;&lt;br /&gt;
      public void run() {&lt;br /&gt;
        try {&lt;br /&gt;
          Thread.sleep(300);&lt;br /&gt;
        } catch (InterruptedException e) {&lt;br /&gt;
        }&lt;br /&gt;
        event = new Event();&lt;br /&gt;
        event.type = SWT.MouseMove;&lt;br /&gt;
        event.x = pt.x;&lt;br /&gt;
        event.y = pt.y;&lt;br /&gt;
        display.post(event);&lt;br /&gt;
        try {&lt;br /&gt;
          Thread.sleep(300);&lt;br /&gt;
        } catch (InterruptedException e) {&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }.start();&lt;br /&gt;
    while (!shell.isDisposed()) {&lt;br /&gt;
      if (!display.readAndDispatch())&lt;br /&gt;
        display.sleep();&lt;br /&gt;
    }&lt;br /&gt;
    display.dispose();&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>
		<author><name>Admin</name></author>	</entry>

	</feed>