/*
 * @(#)UITaskTest.java		Created at 2013-6-28
 * 
 * Copyright (c) 2011-2013 azolla.org All rights reserved.
 * Azolla PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 
 */
package org.azolla.open.kwt.task;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

/**
 * The coder is very lazy, nothing to write for this UITaskTest class
 *
 * @author 	sk@azolla.org
 * @since 	ADK1.0
 */
public class UITaskTest
{

	public static void main(String[] args)
	{
		SwingUtilities.invokeLater(new Runnable()
		{
			@Override
			public void run()
			{
				//do nothing
				final JFrame jframe = new JFrame("Test");
				jframe.setSize(521, 520);
				jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

				JButton jbutton = new JButton("TestButton");
				jbutton.addActionListener(new ActionListener()
				{

					@Override
					public void actionPerformed(ActionEvent e)
					{
						UITask<Boolean> task = new UITask<Boolean>(new Callable<Boolean>()
						{

							@Override
							public Boolean call() throws Exception
							{
								TimeUnit.SECONDS.sleep(30);
								return true;
							}
						}, jframe);
						try
						{
							task.execute();
						}
						catch(Exception e1)
						{
							e1.printStackTrace();
						}
					}
				});
				jframe.add(jbutton);
				jframe.setVisible(true);
			}
		});
	}
}

@@ -213,16 +213,46 @@
 .task;%0A%0A
+import java.awt.BorderLayout;%0A
 import j
@@ -917,16 +917,58 @@
 _CLOSE);
+%0A%09%09%09%09jframe.setLayout(new BorderLayout());
 %0A%0A%09%09%09%09JB
@@ -980,16 +980,17 @@
  jbutton
+1
  = new J
@@ -1022,16 +1022,615 @@
 %09jbutton
+1.addActionListener(new ActionListener()%0A%09%09%09%09%7B%0A%0A%09%09%09%09%09@Override%0A%09%09%09%09%09public void actionPerformed(ActionEvent e)%0A%09%09%09%09%09%7B%0A%09%09%09%09%09%09UITask%3CBoolean%3E task = new UITask%3CBoolean%3E(new Callable%3CBoolean%3E()%0A%09%09%09%09%09%09%7B%0A%0A%09%09%09%09%09%09%09@Override%0A%09%09%09%09%09%09%09public Boolean call() throws Exception%0A%09%09%09%09%09%09%09%7B%0A%09%09%09%09%09%09%09%09TimeUnit.SECONDS.sleep(30);%0A%09%09%09%09%09%09%09%09return true;%0A%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%7D, jframe);%0A%09%09%09%09%09%09try%0A%09%09%09%09%09%09%7B%0A%09%09%09%09%09%09%09task.execute();%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09catch(Exception e1)%0A%09%09%09%09%09%09%7B%0A%09%09%09%09%09%09%09e1.printStackTrace();%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D);%0A%09%09%09%09jframe.add(jbutton1, BorderLayout.WEST);%0A%0A%09%09%09%09JButton jbutton2 = new JButton(%22TestButton%22);%0A%09%09%09%09jbutton2
 .addActi
@@ -2133,19 +2133,40 @@
 (jbutton
+2, BorderLayout.EAST
 );%0A
+%0A
 %09%09%09%09jfra

modify test of UITask