//
// Created       : 2006 Jul 30 (Sun) 15:53:20 by Harold Carr.
// Last Modified : 2006 Sep 10 (Sun) 20:02:37 by Harold Carr.
//

package com.differentity.client;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.Widget;

public class Test
{
    private Widget widget;

    public Test()
    {

	Command cmd = new Command() {
	    public void execute() {
		Window.alert("You selected a menu item!");
	    }
	};

	MenuBar fooMenu = new MenuBar(true);
	fooMenu.addItem("*", cmd);
	fooMenu.addItem("->", cmd);
	fooMenu.addItem("<-", cmd);
	fooMenu.addItem("new", cmd);
	fooMenu.addItem("all", cmd);
	MenuBar barMenu = new MenuBar();
	barMenu.addItem("xxx", fooMenu);
	barMenu.setAutoOpen(true);
	widget = barMenu;
    }

    public Widget getWidget() { return widget; }
}

// End of file.
@@ -91,24 +91,24 @@
 ep 1
-0 (Sun) 20:02:37
+2 (Tue) 22:22:31
  by 
@@ -196,57 +196,158 @@
 ent.
-Command;%0Aimport com.google.gwt.user.client.Window
+History;%0Aimport com.google.gwt.user.client.HistoryListener;%0Aimport com.google.gwt.user.client.ui.Hyperlink;%0Aimport com.google.gwt.user.client.ui.Label
 ;%0Aim
@@ -381,23 +381,29 @@
 ient.ui.
-MenuBar
+VerticalPanel
 ;%0Aimport
@@ -460,16 +460,48 @@
 ss Test%0A
+    implements HistoryListener %0A
 %7B%0A    pr
@@ -531,442 +531,1107 @@
    p
-ublic Test()%0A    %7B%0A%0A%09Command cmd = new Command() %7B%0A%09    public void execute() %7B%0A%09%09Window.alert(%22You selected a menu item!%22);%0A%09    %7D%0A%09%7D;%0A%0A%09MenuBar fooMenu = new MenuBar(true);%0A%09fooMenu.addItem(%22*%22, cmd);%0A%09fooMenu.addItem(%22-%3E%22, cmd);%0A%09fooMenu.addItem(%22%3C-%22, cmd);%0A%09fooMenu.addItem(%22new%22, cmd);%0A%09fooMenu.addItem(%22all%22, cmd);%0A%09MenuBar barMenu = new MenuBar();%0A%09barMenu.addItem(%22xxx%22, fooMenu);%0A%09barMenu.setAutoOpen(true);%0A%09widget = barMenu
+rivate Label lbl = new Label();%0A%0A    public Test()%0A    %7B%0A%0A%09// Create three hyperlinks that change the application's history.%0A%09Hyperlink link0 = new Hyperlink(%22link to foo%22, %22foo%22);%0A%09Hyperlink link1 = new Hyperlink(%22link to bar%22, %22bar%22);%0A%09Hyperlink link2 = new Hyperlink(%22link to baz%22, %22baz%22);%0A%0A%09// If the application starts with no history token, start it off.%0A%09String initToken = History.getToken();%0A%09if (initToken.length() == 0) %7B%0A%09    initToken = %22baz%22;%0A%09%7D%0A%0A%09// onHistoryChanged() is not called when the application first runs.%0A%09// Call it now in order to reflect the initial state.%0A%09onHistoryChanged(initToken);%0A%0A%09// Add widgets to the root panel.%0A%09VerticalPanel panel = new VerticalPanel();%0A%09panel.add(lbl);%0A%09panel.add(link0);%0A%09panel.add(link1);%0A%09panel.add(link2);%0A%0A%09widget = panel;%0A%0A%09// Add history listener%0A%09History.addHistoryListener(this);%0A    %7D%0A%0A    public void onHistoryChanged(String historyToken) %7B%0A%09// This method is called whenever the application's history changes.%0A%09// Set the label to reflect the current history token.%0A%09lbl.setText(%22The current history token is: %22 + historyToken)
 ;%0A  

["history.\n", ""]