Remove code museum.
DELTA_BY_EXTENSION=css=0,java=0,xml=0
Change-Id: I0eb015d0c5a27c9fd831eef6888decd5e8b4e610
diff --git a/reference/code-museum/src/com/google/gwt/museum/DefaultMuseum.gwt.xml b/reference/code-museum/src/com/google/gwt/museum/DefaultMuseum.gwt.xml
deleted file mode 100644
index 0a10e5c..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/DefaultMuseum.gwt.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<module rename-to="defaultmuseum">
-
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name='com.google.gwt.museum.Museum'/>
- <source path="client/defaultmuseum"/>
- <!-- Specify the app entry point class. -->
- <entry-point class='com.google.gwt.museum.client.defaultmuseum.DefaultMuseum'/>
- </module>
diff --git a/reference/code-museum/src/com/google/gwt/museum/Issue3892Module1.gwt.xml b/reference/code-museum/src/com/google/gwt/museum/Issue3892Module1.gwt.xml
deleted file mode 100644
index d83fadc..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/Issue3892Module1.gwt.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!-- -->
-<!-- Copyright 2009 Google Inc. -->
-<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
-<!-- may not use this file except in compliance with the License. You may -->
-<!-- may obtain a copy of the License at -->
-<!-- -->
-<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
-<!-- -->
-<!-- Unless required by applicable law or agreed to in writing, software -->
-<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
-<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
-<!-- implied. License for the specific language governing permissions and -->
-<!-- limitations under the License. -->
-<module rename-to="issue3892Module1">
-
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name='com.google.gwt.user.User' />
- <inherits name='com.google.gwt.museum.Museum' />
- <inherits name="com.google.gwt.user.theme.standard.StandardResources" />
- <inherits name="com.google.gwt.user.theme.chrome.ChromeResources" />
- <inherits name="com.google.gwt.user.theme.dark.DarkResources" />
-
- <!-- Specify the app entry point class. -->
- <entry-point class='com.google.gwt.museum.client.defaultmuseum.Issue3892EntryPoint1' />
- <source path="client/common" />
- <source path="client/defaultmuseum" />
- <source path="client/viewer" />
-</module>
diff --git a/reference/code-museum/src/com/google/gwt/museum/Issue3892Module2.gwt.xml b/reference/code-museum/src/com/google/gwt/museum/Issue3892Module2.gwt.xml
deleted file mode 100644
index 47fb0eb..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/Issue3892Module2.gwt.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!-- -->
-<!-- Copyright 2009 Google Inc. -->
-<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
-<!-- may not use this file except in compliance with the License. You may -->
-<!-- may obtain a copy of the License at -->
-<!-- -->
-<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
-<!-- -->
-<!-- Unless required by applicable law or agreed to in writing, software -->
-<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
-<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
-<!-- implied. License for the specific language governing permissions and -->
-<!-- limitations under the License. -->
-<module rename-to="issue3892Module2">
-
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name='com.google.gwt.user.User' />
- <inherits name='com.google.gwt.museum.Museum' />
- <inherits name="com.google.gwt.user.theme.standard.StandardResources" />
- <inherits name="com.google.gwt.user.theme.chrome.ChromeResources" />
- <inherits name="com.google.gwt.user.theme.dark.DarkResources" />
-
- <!-- Specify the app entry point class. -->
- <entry-point class="com.google.gwt.museum.client.defaultmuseum.Issue3892EntryPoint2" />
- <source path="client/common" />
- <source path="client/defaultmuseum" />
- <source path="client/viewer" />
-</module>
diff --git a/reference/code-museum/src/com/google/gwt/museum/Issue3892Module3.gwt.xml b/reference/code-museum/src/com/google/gwt/museum/Issue3892Module3.gwt.xml
deleted file mode 100644
index 0b42303..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/Issue3892Module3.gwt.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!-- -->
-<!-- Copyright 2009 Google Inc. -->
-<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
-<!-- may not use this file except in compliance with the License. You may -->
-<!-- may obtain a copy of the License at -->
-<!-- -->
-<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
-<!-- -->
-<!-- Unless required by applicable law or agreed to in writing, software -->
-<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
-<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -->
-<!-- implied. License for the specific language governing permissions and -->
-<!-- limitations under the License. -->
-<module rename-to="issue3892Module3">
-
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name='com.google.gwt.user.User' />
- <inherits name='com.google.gwt.museum.Museum' />
- <inherits name="com.google.gwt.user.theme.standard.StandardResources" />
- <inherits name="com.google.gwt.user.theme.chrome.ChromeResources" />
- <inherits name="com.google.gwt.user.theme.dark.DarkResources" />
-
- <!-- Specify the app entry point class. -->
- <entry-point class="com.google.gwt.museum.client.defaultmuseum.Issue3892EntryPoint3" />
- <source path="client/common" />
- <source path="client/defaultmuseum" />
- <source path="client/viewer" />
-</module>
diff --git a/reference/code-museum/src/com/google/gwt/museum/Museum.gwt.xml b/reference/code-museum/src/com/google/gwt/museum/Museum.gwt.xml
deleted file mode 100644
index cf72db5..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/Museum.gwt.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<module rename-to="museum">
-
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name='com.google.gwt.user.User'/>
- <inherits name="com.google.gwt.user.theme.standard.StandardResources"/>
-
- <source path="client/common"/>
- <source path="client/viewer"/>
- <stylesheet src="Museum.css"/>
-</module>
diff --git a/reference/code-museum/src/com/google/gwt/museum/SingleIssue.gwt.xml b/reference/code-museum/src/com/google/gwt/museum/SingleIssue.gwt.xml
deleted file mode 100644
index 84ab025..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/SingleIssue.gwt.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<module rename-to="singleissue">
-
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name='com.google.gwt.user.User'/>
- <inherits name='com.google.gwt.museum.Museum'/>
- <inherits name="com.google.gwt.user.theme.standard.StandardResources"/>
- <inherits name="com.google.gwt.user.theme.chrome.ChromeResources"/>
- <inherits name="com.google.gwt.user.theme.dark.DarkResources"/>
-
- <!-- Specify the app entry point class. -->
- <entry-point class='com.google.gwt.museum.client.defaultmuseum.VisualsForDateBox'/>
- <source path="client/common"/>
- <source path="client/defaultmuseum"/>
- <source path="client/viewer"/>
-
- <extend-property name="locale" values="ar"/>
-</module>
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/common/AbstractIssue.java b/reference/code-museum/src/com/google/gwt/museum/client/common/AbstractIssue.java
deleted file mode 100644
index 580ca31..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/common/AbstractIssue.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.common;
-
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.Document;
-import com.google.gwt.dom.client.LinkElement;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * An abstract issue that can be used in the code museum. Each
- * {@link AbstractIssue} should address a single issue. If at all possible, that
- * issue should be obvious from the initial ui state.
- */
-public abstract class AbstractIssue implements EntryPoint {
- /**
- * Headline for this issue.
- */
- private String headline;
-
- /**
- * Creates the css associated with this issue.
- *
- * @return link with css
- */
- public LinkElement createCSS() {
- String cssName;
- if (hasCSS()) {
- // Fetch the associated style sheet using an HTTP request
- cssName = getClass().getName();
- cssName = cssName.substring(cssName.lastIndexOf(".") + 1);
- } else {
- cssName = "Default";
- }
-
- String baseUrl = GWT.getModuleBaseURL();
- LinkElement issueLinkElement = Document.get().createLinkElement();
- issueLinkElement.setRel("stylesheet");
- issueLinkElement.setType("text/css");
- issueLinkElement.setHref(baseUrl + "issues/" + cssName + ".css");
- return issueLinkElement;
- }
-
- /**
- * <p>
- * Create a widget that illustrates the issue. Each issue should include a
- * detailed description of the expected results and the observed results
- * before the issue was fixed.
- * </p>
- * <p>
- * Note that createIssue will may be called multiple times if the user
- * refreshes the issue. If you save state within the instance, you must clear
- * it out and reset the issue when createIssue is called again.
- * </p>
- *
- * @return a widget that can reproduce the issue
- */
- public abstract Widget createIssue();
-
- /**
- * Returns the "<i>classname</i>: summary".
- *
- * @return a short summary of the issue, including the class name
- */
- public final String getHeadline() {
- if (headline == null) {
- String className = getClass().getName();
- headline = className.substring(className.lastIndexOf(".") + 1) + ": "
- + getSummary();
- }
- return headline;
- }
-
- /**
- * Return a detailed description of what the user should expect to see. The
- * description will be added above the example. You can also include
- * instructions to reproduce the issue.
- *
- * @return instructions explaining what the user should see
- */
- public abstract String getInstructions();
-
- /**
- * Gets the summary for this test. All tests should include a summary so users
- * can scan through them quickly.
- */
- public abstract String getSummary();
-
- /**
- * Does the test have css?
- *
- * @return true to load a CSS file of the same name, placed in the issues
- * directory
- */
- public abstract boolean hasCSS();
-
- /**
- * Called immediately after the widget is attached.
- */
- public void onAttached() {
- // By default do nothing.
- }
-
- public void onModuleLoad() {
- Utility.getHeadElement().appendChild(createCSS());
- Window.setTitle(getHeadline());
- RootPanel.get().add(new HTML(getInstructions()));
- RootPanel.get().add(createIssue());
- onAttached();
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/common/ControlInputPanel.java b/reference/code-museum/src/com/google/gwt/museum/client/common/ControlInputPanel.java
deleted file mode 100644
index 371da89..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/common/ControlInputPanel.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.common;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.HasText;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Helper class to get/set default values for visual tests.
- */
-public class ControlInputPanel extends Composite {
- /**
- * Input
- *
- * @param <V>
- * @param <W>
- */
- public abstract static class Input<V, W extends Widget> {
- protected String name;
- protected V value;
- protected W widget;
-
- protected Input(String name) {
- this.name = name;
- this.widget = createInputWidget();
- }
-
- /**
- * Gets the name of the input
- *
- * @return the name of the input
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the value of this input.
- */
- public abstract V getValue();
-
- @SuppressWarnings("unchecked")
- protected W createInputWidget() {
- return (W) new TextBox();
- }
-
- protected void setValue(V value) {
- ((HasText) widget).setText(value.toString());
- }
- }
-
- /**
- * Set/get integer value.
- */
-
- public static class IntegerInput extends Input<Integer, TextBox> {
- public IntegerInput(String name, int defaultValue, ControlInputPanel p) {
- this(name, defaultValue, defaultValue, p);
- }
-
- public IntegerInput(String name, int defaultHostedValue,
- int defaultWebValue, ControlInputPanel p) {
- super(name);
-
- this.value = GWT.isScript() ? defaultWebValue : defaultHostedValue;
- p.add(this);
- widget.setText(value.toString());
- }
-
- @Override
- public Integer getValue() {
- return Integer.valueOf(widget.getText());
- }
- }
-
- final FlexTable layout = new FlexTable();
-
- private int numInputs;
-
- public ControlInputPanel() {
- layout.setWidth("100%");
- initWidget(layout);
- }
-
- private void add(Input<?, ?> input) {
- layout.setText(0, numInputs, input.getName());
- layout.setWidget(1, numInputs, input.widget);
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/common/EventReporter.java b/reference/code-museum/src/com/google/gwt/museum/client/common/EventReporter.java
deleted file mode 100644
index df9121f..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/common/EventReporter.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.common;
-
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.FocusEvent;
-import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.event.dom.client.KeyDownEvent;
-import com.google.gwt.event.dom.client.KeyDownHandler;
-import com.google.gwt.event.dom.client.KeyPressEvent;
-import com.google.gwt.event.dom.client.KeyPressHandler;
-import com.google.gwt.event.dom.client.KeyUpEvent;
-import com.google.gwt.event.dom.client.KeyUpHandler;
-import com.google.gwt.event.logical.shared.CloseEvent;
-import com.google.gwt.event.logical.shared.CloseHandler;
-import com.google.gwt.event.logical.shared.SelectionEvent;
-import com.google.gwt.event.logical.shared.SelectionHandler;
-import com.google.gwt.event.logical.shared.ValueChangeEvent;
-import com.google.gwt.event.logical.shared.ValueChangeHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.ui.ChangeListener;
-import com.google.gwt.user.client.ui.CheckBox;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.FocusListener;
-import com.google.gwt.user.client.ui.HasHTML;
-import com.google.gwt.user.client.ui.HasText;
-import com.google.gwt.user.client.ui.HasWidgets;
-import com.google.gwt.user.client.ui.KeyboardListener;
-import com.google.gwt.user.client.ui.MouseListener;
-import com.google.gwt.user.client.ui.SuggestionEvent;
-import com.google.gwt.user.client.ui.SuggestionHandler;
-import com.google.gwt.user.client.ui.UIObject;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.SuggestOracle.Suggestion;
-
-/**
- * Helper class to create visual tests.
- *
- * @param <V> value type
- * @param <T> target type
- */
-@SuppressWarnings("deprecation")
-public class EventReporter<V, T> extends SimpleLogger implements
- ChangeListener, FocusListener, ValueChangeHandler<V>,
- SelectionHandler<Suggestion>, SuggestionHandler, KeyboardListener,
- ChangeHandler, BlurHandler, FocusHandler, ClickHandler, ClickListener,
- CloseHandler<T>, MouseListener, KeyDownHandler, KeyUpHandler,
- KeyPressHandler {
-
- /**
- * Add/remove handlers via check box.
- *
- */
- public abstract class CheckBoxEvent extends CheckBox implements
- ValueChangeHandler<Boolean> {
- String name;
-
- private HandlerRegistration registration;
-
- public CheckBoxEvent(String name, HasWidgets p) {
- this.name = name;
- this.setText(name);
- p.add(this);
- this.addValueChangeHandler(this);
- this.setValue(true, true);
- }
-
- public abstract HandlerRegistration addHandler();
-
- public void onValueChange(ValueChangeEvent<Boolean> event) {
- if (event.getValue().booleanValue()) {
- report("add " + name);
- registration = addHandler();
- } else {
- report("remove " + name);
- removeHandler();
- }
- }
-
- public void removeHandler() {
- registration.removeHandler();
- registration = null;
- }
- }
-
- /**
- * Add/remove handlers via check box.
- *
- */
- public abstract class CheckBoxListener extends CheckBox implements
- ValueChangeHandler<Boolean> {
- String name;
-
- public CheckBoxListener(String name, HasWidgets p) {
- this.name = name;
- this.setText(name);
- p.add(this);
- this.addValueChangeHandler(this);
- this.setValue(true, true);
- }
-
- public abstract void addListener();
-
- public void onValueChange(ValueChangeEvent<Boolean> event) {
- if (event.getValue().booleanValue()) {
- report("add " + name);
- addListener();
- } else {
- report("remove " + name);
- removeListener();
- }
- }
-
- public abstract void removeListener();
- }
-
- public EventReporter() {
- }
-
- public EventReporter(HasWidgets parent) {
- parent.add(this);
- }
-
- public void addClickHandler(final HasClickHandlers h, HasWidgets p) {
- addClickHandler(h, p, getInfo(h) + " click handler");
- }
-
- public void addClickHandler(final HasClickHandlers h, HasWidgets p,
- String title) {
-
- new CheckBoxEvent(title, p) {
- @Override
- public HandlerRegistration addHandler() {
- return h.addClickHandler(EventReporter.this);
- }
- };
- }
-
- @Override
- public String getInfo(Object sender) {
- if (sender instanceof HasText) {
- return ((HasText) sender).getText();
- } else if (sender instanceof UIObject
- && ((UIObject) sender).getTitle() != null) {
- return ((UIObject) sender).getTitle();
- } else if (sender instanceof HasHTML) {
- return ((HasHTML) sender).getHTML();
- } else {
- return sender.toString();
- }
- }
-
- public void onBlur(BlurEvent event) {
- report(event);
- }
-
- public void onChange(ChangeEvent event) {
- report(event);
- }
-
- public void onChange(Widget sender) {
- report("change on " + getInfo(sender));
- }
-
- public void onClick(ClickEvent event) {
- report(event);
- }
-
- public void onClick(Widget sender) {
- report("click: " + getInfo(sender));
- }
-
- public void onClose(CloseEvent<T> event) {
- report("close " + getInfo(event.getTarget()));
- }
-
- public void onFocus(FocusEvent event) {
- report(event);
- }
-
- public void onFocus(Widget sender) {
- report("focus: " + getInfo(sender));
- }
-
- public void onKeyDown(KeyDownEvent event) {
- report(event);
- }
-
- public void onKeyDown(Widget sender, char keyCode, int modifiers) {
- report(getInfo(sender) + "key down code: " + keyCode + " modifiers: "
- + modifiers);
- }
-
- public void onKeyPress(KeyPressEvent event) {
- report(event);
- }
-
- public void onKeyPress(Widget sender, char keyCode, int modifiers) {
- report(getInfo(sender) + "key press code: " + keyCode + " modifiers: "
- + modifiers);
- }
-
- public void onKeyUp(KeyUpEvent event) {
- report(event);
- }
-
- public void onKeyUp(Widget sender, char keyCode, int modifiers) {
- report(getInfo(sender) + "key up code: " + keyCode + " modifiers: "
- + modifiers);
- }
-
- public void onLostFocus(Widget sender) {
- report("blur: " + sender.getClass());
- }
-
- public void onMouseDown(Widget sender, int x, int y) {
- report(getInfo(sender) + "mouse down");
- }
-
- public void onMouseEnter(Widget sender) {
- report(getInfo(sender) + "mouse enter");
- }
-
- public void onMouseLeave(Widget sender) {
- report(getInfo(sender) + "mouse leave");
- }
-
- public void onMouseMove(Widget sender, int x, int y) {
- report(getInfo(sender) + "mouse move");
- }
-
- public void onMouseUp(Widget sender, int x, int y) {
- report(getInfo(sender) + "mouse up");
- }
-
- public void onSelection(SelectionEvent<Suggestion> event) {
- report(event);
- }
-
- public void onSuggestionSelected(SuggestionEvent event) {
- report("suggestion: " + event.getSelectedSuggestion());
- }
-
- public void onValueChange(ValueChangeEvent<V> event) {
- report(event);
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/common/SimpleLayout.java b/reference/code-museum/src/com/google/gwt/museum/client/common/SimpleLayout.java
deleted file mode 100644
index 1e713e7..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/common/SimpleLayout.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.common;
-
-import com.google.gwt.user.client.ui.CaptionPanel;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HasWidgets;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.Iterator;
-
-/**
- * Helper class to avoid manually assembling vertical and horizontal panels for
- * these tests. It acts like a "typewriter" layout.
- *
- * So, for instance
- * <pre>
- * // assume the existence of widgets a-z
- * SimpleLayout layout = new SimpleLayout();
- * layout.add(a);
- * layout.add(b);
- * layout.nextRow();
- * layout.add(c);
- * layout.nextRow();
- * layout.add(d);
- * layout.add(e);
- *</pre>
- *
- * would be rendered as:
- * <pre>
- * a b
- * c
- * d e
- * </pre>
- * */
-public class SimpleLayout extends Composite implements HasWidgets {
-
- private final VerticalPanel master = new VerticalPanel();
- private VerticalPanel allRows = new VerticalPanel();
- private HorizontalPanel currentRow;
-
- public SimpleLayout() {
- initWidget(master);
- master.add(allRows);
- nextRow();
- }
-
- /**
- * Adds a widget to the current row with the given caption.
- */
- public void add(String caption, Widget w) {
- CaptionPanel c = new CaptionPanel(caption);
- c.add(w);
- add(c);
- }
-
- /**
- * Adds a widget to the current row.
- */
- public void add(Widget w) {
- currentRow.add(w);
- }
-
- /**
- * Adds a footer to this layout table, the footer is guaranteed to be beneath
- * all the rows.
- */
- public void addFooter(Widget w) {
- master.add(w);
- }
-
- public void clear() {
- master.clear();
- }
-
- public Iterator<Widget> iterator() {
- return master.iterator();
- }
-
- /**
- * Creates another row. After creating this row, all widgets added using
- * {@link #add(Widget)} and {@link #add(String, Widget)} will be added to the
- * new row.
- */
- public void nextRow() {
- currentRow = new HorizontalPanel();
- allRows.add(currentRow);
- }
-
- public boolean remove(Widget w) {
- return master.remove(w);
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/common/SimpleLogger.java b/reference/code-museum/src/com/google/gwt/museum/client/common/SimpleLogger.java
deleted file mode 100644
index 4642cdd..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/common/SimpleLogger.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.common;
-
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HasHTML;
-import com.google.gwt.user.client.ui.HasText;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.UIObject;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-/**
- * Simple logging class.
- */
-@SuppressWarnings("deprecation")
-public class SimpleLogger extends Composite {
-
- private VerticalPanel panel = new VerticalPanel();
-
- public SimpleLogger() {
- initWidget(panel);
- }
-
- public String getInfo(Object sender) {
- if (sender instanceof HasText) {
- return ((HasText) sender).getText();
- } else if (sender instanceof UIObject
- && ((UIObject) sender).getTitle() != null) {
- return ((UIObject) sender).getTitle();
- } else if (sender instanceof HasHTML) {
- return ((HasHTML) sender).getHTML();
- } else {
- return sender.toString();
- }
- }
-
- public void report(String s) {
- panel.insert(new Label(s), 0);
- if (panel.getWidgetCount() == 10) {
- panel.remove(9);
- }
- }
-
- public void report(GwtEvent<?> event) {
- report(getInfo(event.getSource()) + " fired " + event.toDebugString());
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/common/Utility.java b/reference/code-museum/src/com/google/gwt/museum/client/common/Utility.java
deleted file mode 100644
index 66a2860..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/common/Utility.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.common;
-
-import com.google.gwt.dom.client.HeadElement;
-
-/**
- * Utility helper methods.
- */
-public class Utility {
- /**
- * Convenience method for getting the document's head element.
- *
- * @return the document's head element
- */
- public static native HeadElement getHeadElement() /*-{
- return $doc.getElementsByTagName("head")[0];
- }-*/;
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java
deleted file mode 100644
index 7527e09..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/DefaultMuseum.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.museum.client.viewer.Museum;
-
-/**
- * Default bug museum. By default, shows all visual tests defined in GWT ui to
- * date. Modify the code to add all bugs in as well.
- */
-public class DefaultMuseum extends Museum implements EntryPoint {
-
- public DefaultMuseum() {
- addVisuals();
- addBugs();
- }
-
- public void addBugs() {
- addIssue(new Issue1245());
- addIssue(new Issue1772());
- addIssue(new Issue1897());
- addIssue(new Issue1932());
- addIssue(new Issue2261());
- addIssue(new Issue2290());
- addIssue(new Issue2307());
- addIssue(new Issue2318());
- addIssue(new Issue2321());
- addIssue(new Issue2331());
- addIssue(new Issue2338());
- addIssue(new Issue2339());
- addIssue(new Issue2390());
- addIssue(new Issue1169());
- addIssue(new Issue2392());
- addIssue(new Issue2443());
- addIssue(new Issue2553());
- addIssue(new Issue2855());
- addIssue(new Issue3172());
- addIssue(new Issue3962());
- addIssue(new Issue3973());
- }
-
- public void addVisuals() {
- addIssue(new VisualsForDateBox());
- addIssue(new VisualsForDatePicker());
- addIssue(new VisualsForDisclosurePanelEvents());
- addIssue(new VisualsForEventsFiring());
- addIssue(new VisualsForPopupEvents());
- addIssue(new VisualsForTextEvents());
- addIssue(new VisualsForSuggestBoxEvents());
- addIssue(new VisualsForTableEvents());
- addIssue(new VisualsForTree());
- addIssue(new VisualsForTreeEvents());
- addIssue(new VisualsForWindowEvents());
- addIssue(new VisualsForDialogBox());
- addIssue(new VisualsForSuggestBox());
- addIssue(new VisualsForCheckBoxAndRadioButtonEvents());
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1169.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1169.java
deleted file mode 100644
index 45bcf4b..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1169.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.ui.MenuBar;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * The {@link com.google.gwt.user.client.ui.PopupPanel} used to display sub
- * menus in a {@link MenuBar} is not accessible, nor is it under the
- * {@link MenuBar MenuBar's} DOM structure, so it cannot be uniquely styled.
- */
-public class Issue1169 extends AbstractIssue {
- /**
- * A command that does not do anything.
- */
- private static Command emptyCommand = new Command() {
- public void execute() {
- }
- };
-
- @Override
- public Widget createIssue() {
- // Create the main menu bar
- MenuBar menuBar = new MenuBar();
- menuBar.setAutoOpen(true);
-
- // Change the primary style name
- menuBar.setStylePrimaryName("myMenuBar");
-
- // Add the original style names so the default styles apply
- menuBar.addStyleName("gwt-MenuBar gwt-MenuBar-horizontal");
-
- // Add some sub menus, each with a unique style name
- for (int i = 0; i < 3; i++) {
- MenuBar subMenu = new MenuBar(true);
- subMenu.addItem("Item 1", emptyCommand);
- subMenu.addItem("Item 2", emptyCommand);
- subMenu.addItem("Item 3", emptyCommand);
- menuBar.addItem("Option " + i, subMenu);
- }
-
- return menuBar;
- }
-
- @Override
- public String getInstructions() {
- return "Verify that each submenu has a red border, but no shadow.";
- }
-
- @Override
- public String getSummary() {
- return "Cannot apply unique styles to MenuBar popups";
- }
-
- @Override
- public boolean hasCSS() {
- return true;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1245.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1245.java
deleted file mode 100644
index 86837a9..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1245.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Ugly focus ring on Tree.
- */
-public class Issue1245 extends AbstractIssue {
- Tree t = null;
-
- @Override
- public Widget createIssue() {
- t = new Tree();
- t.addItem("a").addItem("a.a");
- t.addItem("b");
- t.addItem("c").addItem("c.a");
- return t;
- }
-
- @Override
- public String getInstructions() {
- return "No focus triangle should be visible";
- }
-
- @Override
- public String getSummary() {
- return "Ugly focus ring on Tree";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- public void onAttatched() {
- t.setFocus(true);
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1488.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1488.java
deleted file mode 100644
index e8150f4..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1488.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.RichTextArea;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * RichTextArea - setEnabled does not work.
- *
- */
-public class Issue1488 extends AbstractIssue {
- RichTextArea t = new RichTextArea();
-
- @Override
- public Widget createIssue() {
- t.setFocus(true);
- return t;
- }
-
- @Override
- public String getInstructions() {
- return "Should not be able to type in the text area";
- }
-
- @Override
- public String getSummary() {
- return "RichTextArea - setEnabled does not work";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1772.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1772.java
deleted file mode 100644
index ae1cc1c..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1772.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Frame;
-import com.google.gwt.user.client.ui.Grid;
-import com.google.gwt.user.client.ui.VerticalSplitPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * If a {@link VerticalSplitPanel} contains a {@link Frame}, then the splitter
- * will stop responding when the user drags it over the {@link Frame}. If the
- * user releases the mouse over the frame, the splitter will continue to move
- * when it emerges froo the {@link Frame}.
- */
-public class Issue1772 extends AbstractIssue {
- @Override
- public Widget createIssue() {
- // Create a heavy grid for top of the split panel
- Grid topWidget = new Grid(10, 10);
- for (int i = 0; i < 10; i++) {
- for (int j = 0; j < 10; j++) {
- topWidget.setHTML(i, j, i + ":" + j);
- }
- }
-
- // Create a frame for the bottom of the split panel
- Frame bottomWidget = new Frame("http://www.google.com");
- bottomWidget.setSize("100%", "100%");
-
- // Create the split panel
- VerticalSplitPanel splitPanel = new VerticalSplitPanel();
- splitPanel.getElement().getStyle().setProperty("marginTop", "100px");
- splitPanel.getElement().getStyle().setProperty("marginLeft", "200px");
- splitPanel.getElement().getStyle().setProperty("border", "3px solid black");
- splitPanel.setPixelSize(500, 500);
- splitPanel.setTopWidget(topWidget);
- splitPanel.setBottomWidget(bottomWidget);
- return splitPanel;
- }
-
- @Override
- public String getInstructions() {
- return "Drag the splitter into the bottom half of the split panel very "
- + "quickly and release the mouse when it is no longer over the "
- + "splitter. The splitter should not continue to move after the mouse "
- + "button is released.";
- }
-
- @Override
- public String getSummary() {
- return "SplitPanel continues to drag after mouse is released";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1897.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1897.java
deleted file mode 100644
index 8f21036..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1897.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.RichTextArea;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * <h1>Attaching and detaching a RichTextArea too fast crashes GWT</h1>
- *
- * <p>
- * The RichTextArea uses a Timer or iframe.onload event (depending on the
- * browser) to trigger the event system initialization. Basically, that
- * introduces a small delay between the time the RichTextArea is attached to the
- * page and the time that the event handlers are added.
- * </p>
- * <p>
- * However, if you programmatically (or just very quickly) remove the
- * RichTextArea from the page, you will immediately trigger the teardown methods
- * that remove the event listeners. In some browsers, removing the event
- * listeners before they are added throws a JavaScript exception do to an
- * undefined variable, which messes up the rest of the onDetach mechanism, which
- * gets your attach state out of sync, which means your app stops working
- * properly.
- * </p>
- * <p>
- * I am able to reliably reproduce these errors by attaching and removing a
- * RichTextArea very quickly, even in user time. The errors affect all browsers,
- * but Firefox is by far the most affected because it catches the iframe.onload
- * event, whereas the others just use a 1ms timer. Also, Safari and IE seem to
- * handle the javascript exceptions a little cleaner.
- * </p>
- */
-public class Issue1897 extends AbstractIssue {
- /**
- * A set of options used to set the caption and content in the caption panel.
- */
- private class ControlPanel extends Composite {
- private final HorizontalPanel hPanel = new HorizontalPanel();
-
- public ControlPanel() {
- initWidget(hPanel);
- hPanel.setSpacing(10);
-
- // Add option to attach RichTextArea
- Button attachButton = new Button("Attach RichText", new ClickHandler() {
- public void onClick(ClickEvent event) {
- if (rta.isAttached()) {
- Window.alert("RichTextArea is already attached.");
- }
- wrapper.add(rta);
- }
- });
- hPanel.add(attachButton);
-
- // Add option to detach RichTextArea
- Button detachButton = new Button("Detach RichText", new ClickHandler() {
- public void onClick(ClickEvent event) {
- if (!rta.isAttached()) {
- Window.alert("RichTextArea is already detached.");
- return;
- }
- wrapper.remove(rta);
- }
- });
- hPanel.add(detachButton);
-
- // Add option to attach and detach RichTextArea
- Button quickDetachButton = new Button("Attach/Detach RichText",
- new ClickHandler() {
- public void onClick(ClickEvent event) {
- if (rta.isAttached()) {
- Window.alert("RichTextArea is already attached.");
- return;
- }
- wrapper.add(rta);
- wrapper.remove(rta);
- }
- });
- hPanel.add(quickDetachButton);
- }
- }
-
- private RichTextArea rta;
-
- private VerticalPanel wrapper;
-
- @Override
- public Widget createIssue() {
- rta = new RichTextArea();
- rta.setPixelSize(200, 100);
-
- // Combine the control panel and RichTextArea in a wrapper
- wrapper = new VerticalPanel();
- wrapper.setSpacing(10);
- wrapper.add(new ControlPanel());
- wrapper.add(rta);
-
- // Remove the RichTextArea after the wrapper is attached to the DOM
- DeferredCommand.addCommand(new Command() {
- public void execute() {
- wrapper.remove(rta);
- }
- });
-
- return wrapper;
- }
-
- @Override
- public String getInstructions() {
- return "You should <b>not</b> see a RichTextArea, and no errors should "
- + "occur. If you click the Attach/Detach button, the RichTextArea will"
- + " be programmatically attached and detached from the DOM structure, "
- + "and you should not see any errors.";
- }
-
- @Override
- public String getSummary() {
- return "Attaching and detaching a RichTextArea too fast crashes GWT";
- }
-
- @Override
- public boolean hasCSS() {
- return true;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1932.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1932.java
deleted file mode 100644
index 394bbc4..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue1932.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.dom.client.NativeEvent;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Event.NativePreviewEvent;
-import com.google.gwt.user.client.Event.NativePreviewHandler;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Grid;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * DOM.eventGetClientX/Y incorrect with HTML margin/borders Firefox 2/Safari 3.
- */
-public class Issue1932 extends AbstractIssue {
- /**
- * A set of options used to set the page margins and borders.
- */
- private class ControlPanel extends Composite {
- private final Grid grid = new Grid(2, 3);
-
- private final TextBox borderBox = new TextBox();
-
- private final TextBox marginBox = new TextBox();
-
- public ControlPanel() {
- initWidget(grid);
-
- // Add an option to set the margin
- marginBox.setText("10px");
- grid.setHTML(0, 0, "<b>Margin:</b>");
- grid.setWidget(0, 1, marginBox);
- grid.setWidget(0, 2, new Button("Set", new ClickHandler() {
- public void onClick(ClickEvent event) {
- updateMargin();
- }
- }));
-
- // Add an option to set the border
- borderBox.setText("5px solid #DDDDDD");
- grid.setHTML(1, 0, "<b>Border:</b>");
- grid.setWidget(1, 1, borderBox);
- grid.setWidget(1, 2, new Button("Set", new ClickHandler() {
- public void onClick(ClickEvent event) {
- updateBorder();
- }
- }));
- }
-
- /**
- * Update the border on the HTML element.
- */
- public void updateBorder() {
- htmlElement.getStyle().setProperty("border", borderBox.getText());
- }
-
- /**
- * Update the margin on the HTML element.
- */
- public void updateMargin() {
- htmlElement.getStyle().setProperty("margin", marginBox.getText());
- }
- }
-
- /**
- * The HTML element of the page.
- */
- private Element htmlElement = null;
-
- @Override
- public Widget createIssue() {
- // Setup the page size and cursor
- htmlElement = DOM.getParent(RootPanel.getBodyElement());
-
- // Create a crosshair to show the current position
- final SimplePanel positioner = new SimplePanel();
- positioner.setPixelSize(30, 30);
- positioner.getElement().getStyle().setProperty("borderLeft",
- "1px solid red");
- positioner.getElement().getStyle().setProperty("borderTop", "1px solid red");
- positioner.getElement().getStyle().setProperty("cursor", "crosshair");
-
- // Create an area to echo position information.
- final HTML echo = new HTML();
-
- // Create a target box to test inside
- final Label sandbox = new Label();
- sandbox.sinkEvents(Event.ONMOUSEMOVE);
- sandbox.setPixelSize(300, 300);
- sandbox.getElement().getStyle().setProperty("border", "3px solid blue");
- sandbox.getElement().getStyle().setProperty("cursor", "crosshair");
-
- // Keep the crosshair under the cursor
- Event.addNativePreviewHandler(new NativePreviewHandler() {
- public void onPreviewNativeEvent(NativePreviewEvent event) {
- // Ignore events outside of the sandbox
- NativeEvent nativeEvent = event.getNativeEvent();
- Element target = Element.as(nativeEvent.getEventTarget());
- if (!sandbox.getElement().isOrHasChild(target)
- && !positioner.getElement().isOrHasChild(target)) {
- positioner.removeFromParent();
- return;
- }
-
- switch (Event.as(nativeEvent).getTypeInt()) {
- case Event.ONMOUSEMOVE:
- int absX = nativeEvent.getClientX() + Window.getScrollLeft();
- int absY = nativeEvent.getClientY() + Window.getScrollTop();
- RootPanel.get().add(positioner, absX, absY);
-
- echo.setHTML("event.clientX: " + nativeEvent.getClientX() + "<br>"
- + "event.clientY: " + nativeEvent.getClientY() + "<br>"
- + "absolute left: " + positioner.getAbsoluteLeft() + "<br>"
- + "absolute top: " + positioner.getAbsoluteTop());
- break;
- }
- }
- });
-
- // Combine the control panel and return
- VerticalPanel vPanel = new VerticalPanel();
- vPanel.add(new ControlPanel());
- vPanel.add(echo);
- vPanel.add(sandbox);
- return vPanel;
- }
-
- @Override
- public String getInstructions() {
- return "Move the cursor inside the blue box below and verify that the "
- + "point of the red positioner lines up directly beneath the center of "
- + "the cursor (crosshair). Also confirm that event.clientX/Y == absolute "
- + "left/top. The buttons may not work on Safari 2 because Safari 2 has "
- + "issues when you attempt to modify the HTML element programatically.";
- }
-
- @Override
- public String getSummary() {
- return "DOM.eventGetClientX/Y incorrect with HTML margin/border in Firefox "
- + "2 and Safari 2";
- }
-
- @Override
- public boolean hasCSS() {
- return true;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2261.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2261.java
deleted file mode 100644
index 7c1904e..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2261.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.DisclosurePanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Open disclosure panel causes flicker.
- */
-public class Issue2261 extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- DisclosurePanel disclosurePanel = new DisclosurePanel("Disclosure Panel 1");
- disclosurePanel.setAnimationEnabled(true);
- Label content = new Label("Some content<br/><br/><br/>");
- content.setHeight("200px");
- content.getElement().getStyle().setProperty("background", "blue");
- disclosurePanel.setContent(content);
- return disclosurePanel;
- }
-
- @Override
- public String getInstructions() {
- return "Open disclosure panel and you should not see a flicker";
- }
-
- @Override
- public String getSummary() {
- return "DisclosurePanel flicker";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2290.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2290.java
deleted file mode 100644
index 8543e9e..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2290.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.TreeItem;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * <h1>gwt-TreeItem refers to the wrong element in TreeItem</h1>
- *
- * <p>
- * gwt-TreeItem used to refer to the span that directly wrapped the text in a
- * TreeItem. Now it refers to the table element that holds the expand/collapse
- * image and the text. gwt-TreeItem-selected is still added to the span, so
- * there is an inconsistency here.
- * </p>
- */
-public class Issue2290 extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- Tree tree = new Tree();
- TreeItem root = tree.addItem("Root Item");
- root.addItem("Item1");
- root.addItem("Item2");
- root.addItem("Item3");
- root.addItem("Item4");
-
- root.setState(true);
- tree.setSelectedItem(root);
-
- return tree;
- }
-
- @Override
- public String getInstructions() {
- return "The background of the Root Item, when selected, should be "
- + "completely red, with no visible green.";
- }
-
- @Override
- public String getSummary() {
- return "Tree background test";
- }
-
- @Override
- public boolean hasCSS() {
- return true;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2307.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2307.java
deleted file mode 100644
index ca9ed69..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2307.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.CaptionPanel;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Grid;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * <h1>Normalize design of CaptionPanel</h1>
- *
- * <p>
- * Methods should be set/getCaptionHTML, set/getCaptionText,
- * set/getContentWidget. Write lots of unit tests.
- * </p>
- */
-public class Issue2307 extends AbstractIssue {
-
- private CaptionPanel captionPanel;
-
- /**
- * A set of options used to set the caption and content in the caption panel.
- */
- private class ControlPanel extends Composite {
- private final Grid grid = new Grid(3, 2);
-
- public ControlPanel() {
- initWidget(grid);
-
- // Add option to set the text
- final TextBox textBox = new TextBox();
- textBox.setText("<b>CaptionPanel</b>");
- grid.setWidget(0, 1, textBox);
- grid.setWidget(0, 0, new Button("setCaptionText", new ClickHandler() {
- public void onClick(ClickEvent event) {
- captionPanel.setCaptionText(textBox.getText());
- }
- }));
-
- // Add option to set the html
- final TextBox htmlBox = new TextBox();
- htmlBox.setText("<b>CaptionPanel</b>");
- grid.setWidget(1, 1, htmlBox);
- grid.setWidget(1, 0, new Button("setCaptionHTML", new ClickHandler() {
- public void onClick(ClickEvent event) {
- captionPanel.setCaptionHTML(htmlBox.getText());
- }
- }));
-
- // Add option to set the content
- final TextBox contentBox = new TextBox();
- contentBox.setText("<b><i>I am a Button</i></b>");
- grid.setWidget(2, 1, contentBox);
- grid.setWidget(2, 0, new Button("setContentWidget", new ClickHandler() {
- public void onClick(ClickEvent event) {
- captionPanel.setContentWidget(new Button(contentBox.getText()));
- }
- }));
- }
- }
-
- @Override
- public Widget createIssue() {
- captionPanel = new CaptionPanel("CaptionPanel");
- VerticalPanel p = new VerticalPanel();
- p.setSpacing(6);
- p.add(captionPanel);
- p.add(new ControlPanel());
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "Verify the usage of various CaptionPanel methods.";
- }
-
- @Override
- public String getSummary() {
- return "CaptionPanel tests";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2318.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2318.java
deleted file mode 100644
index 9b6a3ff..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2318.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.NamedFrame;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Warning message in IE6 when using NamedFrame on SSL-secured web-site.
- */
-public class Issue2318 extends AbstractIssue {
- @Override
- public Widget createIssue() {
- return new NamedFrame("myFrame");
- }
-
- @Override
- public String getInstructions() {
- return "Open this page in IE6 on an SSL-secured server (https). Verify "
- + "that you do not see a mixed-content warning.";
- }
-
- @Override
- public String getSummary() {
- return "Warning message in IE6 when using NamedFrame on SSL-secured site";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2321.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2321.java
deleted file mode 100644
index 44ba2d8..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2321.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DeckPanel;
-import com.google.gwt.user.client.ui.Grid;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * <h1>DeckPanel children getOffsetWidth/Height() return 0 after r2060</h1>
- *
- * <p>
- * Child widgets of DeckPanel used to be able to call getOffsetWidth/Height() in
- * onLoad() to obtain the widget's offset dimensions. These methods now return 0
- * (zero) in onLoad(), and are only correct later, e.g. in a deferred command.
- * </p>
- */
-public class Issue2321 extends AbstractIssue {
- /**
- * A set of options used to set the caption and content in the caption panel.
- */
- private class ControlPanel extends Composite {
- private final Grid grid = new Grid(3, 2);
-
- public ControlPanel() {
- initWidget(grid);
-
- // Add option to detach the deck panel
- Button addWidgetButton = new Button("Add widget", new ClickHandler() {
- public void onClick(ClickEvent event) {
- addWidgetToDeckPanel();
- }
- });
- grid.setWidget(0, 0, addWidgetButton);
-
- // Add option to retrieve the dimensions of the content
- Button updateDimButton = new Button("Get Current Dimensions",
- new ClickHandler() {
- public void onClick(ClickEvent event) {
- updateContentDimensions();
- }
- });
- grid.setWidget(0, 1, updateDimButton);
-
- // Add labels for the content height and width
- grid.setHTML(1, 0, "Content Height:");
- grid.setHTML(2, 0, "Content Width:");
- }
-
- /**
- * Add another widget to the deck panel.
- */
- public void addWidgetToDeckPanel() {
- int numWidgets = deck.getWidgetCount();
- HTML content = new HTML("Content " + numWidgets) {
- @Override
- protected void onLoad() {
- updateContentDimensions();
- }
- };
-
- content.setStylePrimaryName("deckPanel-content");
- deck.add(content);
- deck.showWidget(numWidgets);
- }
-
- /**
- * Retrieve the size of the content widgets.
- */
- public void updateContentDimensions() {
- Widget content = deck.getWidget(deck.getWidgetCount() - 1);
- grid.setHTML(1, 1, content.getOffsetHeight() + "");
- grid.setHTML(2, 1, content.getOffsetWidth() + "");
- }
- }
-
- /**
- * The options panel to control this test.
- */
- private ControlPanel controlPanel = new ControlPanel();
-
- /**
- * The {@link DeckPanel} to be tested.
- */
- private DeckPanel deck;
-
- /**
- * The main container that holds the control panel and deck panel.
- */
- private VerticalPanel vPanel;
-
- @Override
- public Widget createIssue() {
- // Create the deck panel and grab the size of the contents on load
- deck = new DeckPanel() {
- @Override
- protected void onLoad() {
- controlPanel.addWidgetToDeckPanel();
- }
- };
- deck.setStylePrimaryName("deckPanel");
-
- // Combine the control panel and DeckPanel
- vPanel = new VerticalPanel();
- vPanel.add(controlPanel);
- vPanel.add(deck);
- return vPanel;
- }
-
- @Override
- public String getInstructions() {
- return "The height and width of the content should be greater than 0.";
- }
-
- @Override
- public String getSummary() {
- return "DeckPanel should return content dimensions onLoad";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2331.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2331.java
deleted file mode 100644
index 26ae0d0..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2331.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.StackPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Clicking on StackPanel fails to open stack.
- */
-public class Issue2331 extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- StackPanel p = new StackPanel();
- p.add(new Label("Content A"), "Header A");
- p.add(new Label("Content B"), "Header B");
- p.add(new Label("Content C"), "Header C");
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "Click on B";
- }
-
- @Override
- public String getSummary() {
- return "Stack Panel does not response to switching stacks";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2338.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2338.java
deleted file mode 100644
index 1f619c0..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2338.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.TreeItem;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Opening a tree item flickers in IE7 because all of the children are shown for
- * an instant, and then the animation continues normally.
- */
-public class Issue2338 extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- Tree tree = new Tree();
- tree.setAnimationEnabled(true);
- TreeItem root = tree.addItem("Root");
- for (int i = 0; i < 5; i++) {
- root.addItem("Item " + i);
- }
- return tree;
- }
-
- @Override
- public String getInstructions() {
- return "Open the root node and you should not see a flicker";
- }
-
- @Override
- public String getSummary() {
- return "Tree animation flickers when expanding a TreeItem";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2339.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2339.java
deleted file mode 100644
index 3cdcd09..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2339.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.TabPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * When you change to a different widget in the DeckPanel, there is a flicker in
- * IE7 where the new widget is completely visible for an instant, and then the
- * animation continues normally.
- */
-public class Issue2339 extends AbstractIssue {
- private static final String[] TAB_BACKGROUNDS = {
- "#f88", "#88f", "#8f8", "#8ff", "#f8f"};
-
- @Override
- public Widget createIssue() {
- final TabPanel tabPanel = new TabPanel();
- String contentText = "";
- for (int i = 0; i < TAB_BACKGROUNDS.length; i++) {
- contentText += "Each tab has more text.<br>";
- HTML content = new HTML(contentText);
- content.getElement().getStyle().setProperty("background",
- TAB_BACKGROUNDS[i]);
- tabPanel.add(content, "Tab " + i);
- }
-
- tabPanel.selectTab(0);
- tabPanel.getDeckPanel().setAnimationEnabled(true);
- return tabPanel;
- }
-
- @Override
- public String getInstructions() {
- return "Switch to a different tab and you should not see a flicker";
- }
-
- @Override
- public String getSummary() {
- return "DeckPanel flickers when switching between widgets";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2390.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2390.java
deleted file mode 100644
index b478ec9..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2390.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.CheckBox;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.ListBox;
-import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.RadioButton;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Focusing on the document body while a modal {@link PopupPanel} is visible
- * causes Internet Explorer to disappear to the back of the UI stack. Also,
- * modal PopupPanels do not prevent the user from focusing on input elements.
- */
-public class Issue2390 extends AbstractIssue {
- @Override
- public Widget createIssue() {
- // A label indicating where to click to focus the body
- Label label = new Label("Click to the right of this box while the popup "
- + "is visible >>>");
- label.getElement().getStyle().setProperty("border", "1px solid red");
-
- // Create a modal PopupPanel
- final PopupPanel popup = new PopupPanel(false, true);
- popup.setWidget(new Button("Hide Popup", new ClickHandler() {
- public void onClick(ClickEvent event) {
- popup.hide();
- }
- }));
-
- // Create a button to show the PopupPanel
- Button showPopupButton = new Button("Show Popup", new ClickHandler() {
- public void onClick(ClickEvent event) {
- popup.center();
- }
- });
-
- // Create a bunch of input elements to test
- // TODO(jlabanca): divide this out into a separate issue 2707
- CheckBox checkBox = new CheckBox("CheckBox");
- RadioButton radio1 = new RadioButton("grouping", "RadioButton1");
- RadioButton radio2 = new RadioButton("grouping", "RadioButton2");
- ListBox list = new ListBox();
- list.addItem("test1");
- list.addItem("test2");
- list.addItem("test3");
- list.addItem("test4");
- TextBox textBox = new TextBox();
-
- // Combine all of the elements into a panel
- VerticalPanel layout = new VerticalPanel();
- layout.add(label);
- layout.add(showPopupButton);
- layout.add(textBox);
- layout.add(checkBox);
- layout.add(radio1);
- layout.add(radio2);
- layout.add(list);
- return layout;
- }
-
- @Override
- public String getInstructions() {
- return "First, make sure you have another program (such as another "
- + "instance of the IE) running on the system. Click the button below "
- + "to show the PopupPanel, then click to right of the red box. The "
- + "browser should not be sent to the back of the OS UI stack because the "
- + "document body is blurred. Also, make sure that the user cannot "
- + "interact with the input elements while the popup is visible.";
- }
-
- @Override
- public String getSummary() {
- return "IE dissappears when clicking outside a modal PopupPanel";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2392.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2392.java
deleted file mode 100644
index 644dc33..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2392.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
-import com.google.gwt.user.client.ui.SuggestBox;
-import com.google.gwt.user.client.ui.SuggestOracle;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * SuggestBox does not shrink to fit its contents when the number of suggestions
- * is reduced. This issue was reported against IE in standards mode.
- */
-public class Issue2392 extends AbstractIssue {
- private MultiWordSuggestOracle oracle = null;
-
- @Override
- public Widget createIssue() {
- SuggestBox box = new SuggestBox(getSuggestOracle());
-
- // Enable animations to ensure that the suggestions are only animated when
- // they are opened the first time.
- box.setAnimationEnabled(true);
-
- return box;
- }
-
- @Override
- public String getInstructions() {
- return "Type in the word 'add' one letter at a time. As the number of "
- + "suggestions is reduced, the red box around the SuggestPopup should "
- + "shrink to just fit the contents.";
- }
-
- @Override
- public String getSummary() {
- return "SuggestBox does not shrink when the number of suggestions is "
- + "reduced";
- }
-
- @Override
- public boolean hasCSS() {
- return true;
- }
-
- /**
- * Create a {@link SuggestOracle} that returns random words. Only one suggest
- * oracle is created.
- *
- * @return a {@link SuggestOracle}
- */
- private SuggestOracle getSuggestOracle() {
- if (oracle == null) {
- oracle = new MultiWordSuggestOracle();
- for (char a = 'a'; a <= 'z'; a++) {
- for (char b = 'a'; b <= 'm'; b++) {
- for (char c = 'a'; c <= 'd'; c++) {
- oracle.add("" + a + b + c);
- }
- }
- }
- }
- return oracle;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2443.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2443.java
deleted file mode 100644
index 9c8db32..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2443.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.DialogBox;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Dragging a {@link DialogBox} to the right edge of the screen creates a
- * horizontal scroll bar. The {@link DialogBox} should wrap the text in
- * order to avoid creating the scroll bar.
- */
-public class Issue2443 extends AbstractIssue {
- /**
- * The DialogBox to test.
- */
- private DialogBox dialogBox = null;
-
- @Override
- public Widget createIssue() {
- // Create the DialogBox
- dialogBox = new DialogBox(false, false);
- dialogBox.setText("Dialog Box");
-
- String message = "This text should wrap when the "
- + "DialogBox is dragged to the right edge of the screen. ";
- VerticalPanel vPanel = new VerticalPanel();
- vPanel.add(new Label(message));
- vPanel.add(new Button("Close", new ClickHandler() {
- public void onClick(ClickEvent event) {
- dialogBox.hide();
- }
- }));
- dialogBox.setWidget(vPanel);
-
- // Create a button to display the dialog box
- Button showButton = new Button("Show DialogBox", new ClickHandler() {
- public void onClick(ClickEvent event) {
- dialogBox.center();
- }
- });
- return showButton;
- }
-
- @Override
- public String getInstructions() {
- return "Move the DialogBox to the right edge of the screen. The DialogBox "
- + "should wrap its text as best it can to avoid creating a horizontal "
- + "scroll bar.";
- }
-
- @Override
- public String getSummary() {
- return "DialogBox does not resize naturally";
- }
-
- @Override
- public boolean hasCSS() {
- return true;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2553.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2553.java
deleted file mode 100644
index cd70ae6..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2553.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Test for http://code.google.com/p/google-web-toolkit/issues/detail?id=2553
- */
-public class Issue2553 extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- Tree tree = new Tree();
- tree.addItem("This is a long text displayed in a tree item");
- tree.addItem("This is a long text displayed in a tree item and it's longer than the others");
- tree.addItem("This is a long text displayed in a tree item");
- return tree;
- }
-
- @Override
- public String getInstructions() {
- return "resize the browser to a smaller width than the tree's width";
- }
-
- @Override
- public String getSummary() {
- return "Word wrap of treeitem's text when browser width is too small";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2855.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2855.java
deleted file mode 100644
index 6d77f74..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue2855.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * <h1>PopupPanel.setAutoHideEnabled() and setModel()</h1>
- *
- * <p>
- * Verify that all states of the {@link PopupPanel} (combinations of modal and
- * autoHide) work and can be change seemlessly.
- * </p>
- */
-public class Issue2855 extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- // Create the popup panel
- final PopupPanel popup = new PopupPanel();
-
- // Add buttons to call getters and setters
- Button toggleAutoHide = new Button("4. Toggle AutoHide",
- new ClickHandler() {
- public void onClick(ClickEvent event) {
- popup.setAutoHideEnabled(!popup.isAutoHideEnabled());
- }
- });
- Button toggleModal = new Button("3. Toggle Modal", new ClickHandler() {
- public void onClick(ClickEvent event) {
- popup.setModal(!popup.isModal());
- }
- });
- Button isAutoHide = new Button("isAutoHide?", new ClickHandler() {
- public void onClick(ClickEvent event) {
- Window.alert("AutoHide: " + popup.isAutoHideEnabled());
- }
- });
- Button isModal = new Button("isModal?", new ClickHandler() {
- public void onClick(ClickEvent event) {
- Window.alert("Modal: " + popup.isModal());
- }
- });
- Button closeButton = new Button("Close", new ClickHandler() {
- public void onClick(ClickEvent event) {
- popup.hide();
- }
- });
- VerticalPanel vPanel = new VerticalPanel();
- vPanel.add(toggleModal);
- vPanel.add(toggleAutoHide);
- vPanel.add(isModal);
- vPanel.add(isAutoHide);
- vPanel.add(closeButton);
- popup.setWidget(vPanel);
-
- // Add control buttons
- Button showPopup = new Button("1. Show Popup", new ClickHandler() {
- public void onClick(ClickEvent event) {
- popup.center();
- }
- });
- Button clickable = new Button("2/4. Click Me", new ClickHandler() {
- public void onClick(ClickEvent event) {
- Window.alert("You got me!");
- }
- });
- VerticalPanel layout = new VerticalPanel();
- layout.add(showPopup);
- layout.add(clickable);
- return layout;
- }
-
- @Override
- public String getInstructions() {
- String text = "Perform the following steps:<br>"
- + "1. Show the popup<br>"
- + "2. Click the 'Click Me' button and verify an alert box appears<br>"
- + "3. Click the 'Toggle Modal' button<br>"
- + "4. Click the 'Click Me' button and verify an alert box doesn't appear<br>"
- + "5. Click the 'Toggle AutoHide' button<br>"
- + "6. Click on the screen and verify that the popup closes";
- return text;
- }
-
- @Override
- public String getSummary() {
- return "PopupPanel.setAutoHideEnabled() and setModel() tests";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3172.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3172.java
deleted file mode 100644
index 7d9a974..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3172.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.ui.MenuBar;
-import com.google.gwt.user.client.ui.MenuItem;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Verify that IE returns the correct value for getAbsoluteLeft() when zoomed
- * in. The absolute left coordinate should NOT depend on the zoom. That is, an
- * elements absoluteLeft position should be the same regardless of zoom (IE
- * automatically multiplies it by the zoom).
- */
-public class Issue3172 extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- // Create a command that will execute on menu item selection
- Command emptyCommand = new Command() {
- public void execute() {
- }
- };
-
- // Create a menu bar
- MenuBar menu = new MenuBar();
- menu.setWidth("500px");
- menu.setAutoOpen(true);
-
- // Create a sub menu of recent documents
- MenuBar recentDocsMenu = new MenuBar(true);
- recentDocsMenu.addItem("Document 0", emptyCommand);
- recentDocsMenu.addItem("Document 1", emptyCommand);
- recentDocsMenu.addItem("Document 2", emptyCommand);
-
- // Create the file menu
- MenuBar fileMenu = new MenuBar(true);
- menu.addItem(new MenuItem("File", fileMenu));
- fileMenu.addItem("New", emptyCommand);
- fileMenu.addItem("Print", emptyCommand);
- fileMenu.addItem("Recent Docs", recentDocsMenu);
-
- // Create the edit menu
- MenuBar editMenu = new MenuBar(true);
- menu.addItem(new MenuItem("Edit", editMenu));
- editMenu.addItem("Cut", emptyCommand);
- editMenu.addItem("Copy", emptyCommand);
- editMenu.addItem("Paste", emptyCommand);
-
- // Create the help menu
- MenuBar helpMenu = new MenuBar(true);
- menu.addItem(new MenuItem("Help", helpMenu));
- helpMenu.addItem("Settings", emptyCommand);
- helpMenu.addItem("About", emptyCommand);
-
- return menu;
- }
-
- @Override
- public String getInstructions() {
- return "In IE, press Ctrl++ to zoom in, then verify that the sub menus open"
- + " in the correct locations.";
- }
-
- @Override
- public String getSummary() {
- return "getAbsoluteLeft() with zoom in IE";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3186.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3186.java
deleted file mode 100644
index 666450b..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3186.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.ui.AbsolutePanel;
-import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.FocusPanel;
-import com.google.gwt.user.client.ui.MouseListener;
-import com.google.gwt.user.client.ui.MouseListenerCollection;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Ensure the ListenerWrapper for mouse still works like the old listeners did.
- */
-@SuppressWarnings("deprecation")
-public class Issue3186 extends AbstractIssue {
-
- enum VisibleEvents {
- mouseDown, mouseEnter, mouseLeave, mouseMove, mouseUp
- }
-
- private final class TestWidget extends FocusPanel {
- private class Control implements MouseListener {
- int controlX;
- int controlY;
- int controlMouseEnter;
- int controlMouseLeave;
-
- public void onMouseDown(Widget sender, int x, int y) {
- this.controlX = x;
- this.controlY = y;
- }
-
- public void onMouseEnter(Widget sender) {
- ++controlMouseEnter;
- }
-
- public void onMouseLeave(Widget sender) {
- ++controlMouseLeave;
- }
-
- public void onMouseMove(Widget sender, int x, int y) {
- this.controlX = x;
- this.controlY = y;
- }
-
- public void onMouseUp(Widget sender, int x, int y) {
- this.controlX = x;
- this.controlY = y;
- }
- }
-
- private class Current implements MouseListener {
- private int mouseEnterCount;
- private int mouseLeaveCount;
-
- public void onMouseDown(Widget sender, int x, int y) {
- check(x, y, VisibleEvents.mouseDown);
- }
-
- public void onMouseEnter(Widget sender) {
- ++mouseEnterCount;
- if (mouseEnterCount != control.controlMouseEnter) {
- fail("recieved:" + mouseEnterCount + " events, expected:"
- + control.controlMouseEnter, VisibleEvents.mouseEnter);
- } else {
- pass(VisibleEvents.mouseEnter);
- }
- sender.getElement().getStyle().setProperty("background", "yellow");
- }
-
- public void onMouseLeave(Widget sender) {
- ++mouseLeaveCount;
- if (mouseLeaveCount != control.controlMouseLeave) {
- fail("recieved:" + mouseLeaveCount + " events, expected:"
- + control.controlMouseLeave, VisibleEvents.mouseLeave);
- } else {
- pass(VisibleEvents.mouseLeave);
- }
-
- sender.getElement().getStyle().setProperty("background", "");
- }
-
- public void onMouseMove(Widget sender, int x, int y) {
- check(x, y, VisibleEvents.mouseMove);
- }
-
- public void onMouseUp(Widget sender, int x, int y) {
- check(x, y, VisibleEvents.mouseUp);
- }
-
- private void check(int x, int y, VisibleEvents event) {
- String errorReport = getErrorReport(x, y);
- if (errorReport == null) {
- eventToElement.get(event).setInnerHTML(
- "<span style='color:green'>pass</span>");
- } else {
- fail(errorReport, event);
- }
- }
-
- private String getErrorReport(int x, int y) {
- String errorReport = null;
- if (x != control.controlX) {
- errorReport = "wanted x: " + control.controlX + " actual x" + x;
- } else if (y != control.controlY) {
- errorReport += "wanted y: " + control.controlY + " actual y" + y;
- }
- return errorReport;
- }
- }
-
- private FlexTable layout = null;
- private MouseListenerCollection collection = new MouseListenerCollection();
-
- private Control control = new Control();
- private Current current = new Current();
- private final Map<VisibleEvents, Element> eventToElement = new HashMap<VisibleEvents, Element>();
-
- public TestWidget() {
- layout = new FlexTable();
- layout.setCellPadding(3);
- layout.setBorderWidth(2);
-
- layout.setHTML(0, 0, "<b>MouseEvents</b>");
- layout.setHTML(0, 1, "<b>Status</b>");
-
- for (VisibleEvents e : VisibleEvents.values()) {
- eventToElement.put(e, addResultRow(e.name()));
- }
- add(layout);
- this.addMouseListener(current);
- collection.add(control);
- }
-
- public void fail(String errorReport, VisibleEvents event) {
- eventToElement.get(event).setInnerHTML(
- "<span style='color:red'>" + errorReport + "</span>");
- }
-
- @Override
- public void onBrowserEvent(Event event) {
- collection.fireMouseEvent(this, event);
- super.onBrowserEvent(event);
- }
-
- public void pass(VisibleEvents event) {
- eventToElement.get(event).setInnerHTML(
- "<span style='color:green'>pass</span>");
- }
-
- private Element addResultRow(String eventName) {
- int row = layout.getRowCount();
- layout.setHTML(row, 0, eventName);
- layout.setHTML(row, 1, "<span style='color:red'>?</span>");
- Element cell = layout.getCellFormatter().getElement(row, 1);
- return cell;
- }
- }
-
- @Override
- public Widget createIssue() {
- AbsolutePanel p = new AbsolutePanel();
- p.setHeight("500px");
- p.setWidth("500px");
- final TestWidget dialog = showTestWidget();
- p.add(dialog, 100, 100);
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "move your mouse around ";
- }
-
- @Override
- public String getSummary() {
- return "mouse listeners work the same";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- private TestWidget showTestWidget() {
- final TestWidget dialog = new TestWidget();
- return dialog;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3187.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3187.java
deleted file mode 100644
index 162a816..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3187.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.FileUpload;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * {@link FileUpload} onChange event fires correctly in all browsers.
- */
-public class Issue3187 extends AbstractIssue {
- @Override
- public Widget createIssue() {
- FileUpload fileUpload = new FileUpload();
- fileUpload.addChangeHandler(new ChangeHandler() {
- public void onChange(ChangeEvent event) {
- Window.alert("Value Changed");
- }
- });
- return fileUpload;
- }
-
- @Override
- public String getInstructions() {
- return "Change the file path and verify an alert dialog appears. In "
- + "Opera, the onChange event should only be fired when the box is "
- + "blurred.";
- }
-
- @Override
- public String getSummary() {
- return "FileUpload supports change events";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3892EntryPoint1.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3892EntryPoint1.java
deleted file mode 100644
index dd3b799..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3892EntryPoint1.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Event.NativePreviewEvent;
-import com.google.gwt.user.client.Event.NativePreviewHandler;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.Grid;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Only a single GWT application can preview native events.
- */
-public class Issue3892EntryPoint1 extends AbstractIssue {
-
- public static final String BUTTON_1_ID = "Issue3892Button1";
- public static final String BUTTON_2_ID = "Issue3892Button2";
- public static final String BUTTON_3_ID = "Issue3892Button3";
-
- /**
- * The main grid used for layout.
- */
- private Grid grid = new Grid(1, 3);
-
- @Override
- public Widget createIssue() {
- Window.alert("Module 1 loaded");
-
- // Setup the grid.
- grid.setHTML(0, 0, "<b>Test<b>");
- grid.setHTML(0, 1, "<b>Description<b>");
- grid.setHTML(0, 2, "<b>Expected Results<b>");
- addTest(BUTTON_1_ID, "Event is not cancelled by any module.",
- "The event will fire in the button.", false);
- addTest(BUTTON_2_ID, "Module 1 cancels event.",
- "The event will not fire in the button.", true);
- addTest(BUTTON_3_ID, "Module 2 cancels event.",
- "The event will not fire in the button.", true);
-
- // Add the event preview.
- Event.addNativePreviewHandler(new NativePreviewHandler() {
- public void onPreviewNativeEvent(NativePreviewEvent event) {
- if (event.getTypeInt() == Event.ONCLICK) {
- Element target = event.getNativeEvent().getEventTarget().cast();
- if (BUTTON_2_ID.equals(target.getId())) {
- event.cancel();
- Window.alert("Click handled by module 1 and cancelled");
- } else {
- Window.alert("Click handled by module 1");
- }
- }
- }
- });
-
- return grid;
- }
-
- @Override
- public String getInstructions() {
- return "After all three modules have loaded (indicated by alert boxes), "
- + "click the buttons and verify that you see the expected results. "
- + "For each test, all three modules should preview the event (even if "
- + "one of the modules cancels the event).";
- }
-
- @Override
- public String getSummary() {
- return "Only a single GWT application can preview native events";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- /**
- * Add a test button to the grid.
- *
- * @param buttonId the ID of the button
- * @param description the test description
- * @param results the expected result of the test
- * @param isCancelled true if one of the modules will cancel the event
- */
- private void addTest(String buttonId, String description, String results,
- final boolean isCancelled) {
- int row = grid.getRowCount();
- grid.resizeRows(row + 1);
-
- // Add the test button.
- Button button = new Button("Run Test", new ClickHandler() {
- public void onClick(ClickEvent event) {
- if (isCancelled) {
- Window.alert("[Error] Event should have been cancelled");
- } else {
- Window.alert("[Success] Event successfully fired");
- }
- }
- });
- button.getElement().setId(buttonId);
- grid.setWidget(row, 0, button);
-
- // Add the description and expected results.
- grid.setText(row, 1, description);
- grid.setText(row, 2, results);
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3892EntryPoint2.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3892EntryPoint2.java
deleted file mode 100644
index 1231698..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3892EntryPoint2.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Event.NativePreviewEvent;
-import com.google.gwt.user.client.Event.NativePreviewHandler;
-
-/**
- * Only a single GWT application can preview native events.
- */
-public class Issue3892EntryPoint2 implements EntryPoint {
- public void onModuleLoad() {
- Window.alert("Module 2 loaded");
- Event.addNativePreviewHandler(new NativePreviewHandler() {
- public void onPreviewNativeEvent(NativePreviewEvent event) {
- if (event.getTypeInt() == Event.ONCLICK) {
- Element target = event.getNativeEvent().getEventTarget().cast();
- if (Issue3892EntryPoint1.BUTTON_3_ID.equals(target.getId())) {
- event.cancel();
- Window.alert("Click handled by module 2 and cancelled");
- } else {
- Window.alert("Click handled by module 2");
- }
- }
- }
- });
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3892EntryPoint3.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3892EntryPoint3.java
deleted file mode 100644
index 4f52d40..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3892EntryPoint3.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Event.NativePreviewEvent;
-import com.google.gwt.user.client.Event.NativePreviewHandler;
-
-/**
- * Only a single GWT application can preview native events.
- */
-public class Issue3892EntryPoint3 implements EntryPoint {
- public void onModuleLoad() {
- Window.alert("Module 3 loaded");
- Event.addNativePreviewHandler(new NativePreviewHandler() {
- public void onPreviewNativeEvent(NativePreviewEvent event) {
- if (event.getTypeInt() == Event.ONCLICK) {
- Window.alert("Click handled by module 3");
- }
- }
- });
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3962.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3962.java
deleted file mode 100644
index b0e6587..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3962.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.FormPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
-import com.google.gwt.user.client.ui.FormPanel.SubmitHandler;
-
-/**
- * Buttons default to type=submit in WebKit (Safari and Chrome) and IE8 (in IE8
- * mode).
- */
-public class Issue3962 extends AbstractIssue {
- private FormPanel form;
-
- @Override
- public Widget createIssue() {
- form = new FormPanel();
- form.addSubmitHandler(new SubmitHandler() {
- public void onSubmit(SubmitEvent event) {
- Window.alert("Form is being submitted.");
- event.cancel();
- }
- });
- form.setWidget(new Button("Submit"));
- return form;
- }
-
- @Override
- public String getInstructions() {
- return "Click the button, it should have no effect.";
- }
-
- @Override
- public String getSummary() {
- return "In IE8 (in IE8 mode) and WebKit (Safari and Chrome), buttons default"
- + " to type submit.";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3973.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3973.java
deleted file mode 100644
index a5eef5e..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3973.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.FormPanel;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
-import com.google.gwt.user.client.ui.FormPanel.SubmitHandler;
-
-/**
- * When a {@link FormPanel} does not use a synthesized hidden iframe and is
- * being submit by means other than {@link FormPanel#submit()}, it doesn't fire
- * submit events.
- */
-public class Issue3973 extends AbstractIssue {
- private FormPanel form;
-
- @Override
- public Widget createIssue() {
- form = new FormPanel("_blank");
- form.setAction("http://www.google.com/search");
- form.addSubmitHandler(new SubmitHandler() {
- public void onSubmit(SubmitEvent event) {
- Window.alert("Did you see me?");
- event.cancel();
- }
- });
- TextBox box = new TextBox();
- box.setName("q");
- form.setWidget(box);
- return form;
- }
-
- @Override
- public String getInstructions() {
- return "Enter some text and press the ENTER key, it should show an alert. It shouldn't open Google within a new window/tab!";
- }
-
- @Override
- public String getSummary() {
- return "FormPanel doesn't hook events when not using a synthesized hidden iframe.";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/SpeedForClear.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/SpeedForClear.java
deleted file mode 100644
index 5e1f4cf..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/SpeedForClear.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.core.client.Duration;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.ControlInputPanel;
-import com.google.gwt.museum.client.common.SimpleLogger;
-import com.google.gwt.museum.client.common.ControlInputPanel.IntegerInput;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Panel;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/*
- * Originally, on IE, about three seconds to distroy
- */
-/**
- * Tests bad behavior for clear.
- *
- * <pre>
- * ff -- 1000 flow panels, aprox 500 millis
- * ie -- 1000 flow panels, aprox 3000 millis
- *
- * in new version
- * ie -- 1000 flow panels, aprox 30-80 millis
- * ff -- 1000 flow panels, aprox 13-50 millis
- * </pre>
- * <p>
- * <img class='gallery' src='FlowPanel.png'/>
- * </p>
- */
-public class SpeedForClear extends AbstractIssue {
- private Panel target;
- private List<Widget> children = new ArrayList<Widget>();
- private SimpleLogger log = new SimpleLogger();
-
- @Override
- public Widget createIssue() {
- VerticalPanel v = new VerticalPanel();
- ControlInputPanel p = new ControlInputPanel();
- v.add(p);
- v.add(log);
- final IntegerInput size = new IntegerInput("flowpanel", 10, p);
- Button create = new Button("create widget", new ClickHandler() {
-
- public void onClick(ClickEvent event) {
- createLargeFlowPanel(size.getValue());
- }
- });
-
- Button distroy = new Button("time the removal", new ClickHandler() {
- public void onClick(ClickEvent event) {
- Duration d = new Duration();
- target.clear();
-
- log.report("Took " + d.elapsedMillis() + " milliseconds to clear "
- + size.getValue() + " widgets from a flow panel");
- for (Widget child : children) {
- if (child.getElement().getPropertyString("__listener") != null) {
- throw new IllegalStateException(
- "each child should no longer have a listener");
- }
- }
- }
- });
- v.add(create);
- v.add(distroy);
- return v;
- }
-
- @Override
- public String getInstructions() {
- return "check the speed of clear methods";
- }
-
- @Override
- public String getSummary() {
- return "clear() speed check";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- private void createLargeFlowPanel(int size) {
-
- if (target != null) {
- target.removeFromParent();
- }
- target = new FlowPanel();
-
- for (int i = 0; i < size; i++) {
- Widget w = new Label("widget-" + i);
- target.add(w);
- children.add(w);
- }
-
- RootPanel.get().add(target);
- for (Widget child : target) {
- if (child.getElement().getPropertyString("__listener") == null) {
- throw new IllegalStateException("each child should now have a listener");
- }
- }
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/SpeedForClippedImageLoading.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/SpeedForClippedImageLoading.java
deleted file mode 100644
index 04d216e..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/SpeedForClippedImageLoading.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.core.client.Duration;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.LoadEvent;
-import com.google.gwt.event.dom.client.LoadHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.ControlInputPanel;
-import com.google.gwt.museum.client.common.SimpleLogger;
-import com.google.gwt.museum.client.common.ControlInputPanel.IntegerInput;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.TreeImages;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Tests the speed of clipped images.
- *
- */
-public class SpeedForClippedImageLoading extends AbstractIssue {
- private SimpleLogger log = new SimpleLogger();
- List<Image> images = new ArrayList<Image>();
-
- @Override
- public Widget createIssue() {
- VerticalPanel v = new VerticalPanel();
- ControlInputPanel p = new ControlInputPanel();
- v.add(p);
- v.add(log);
- final IntegerInput size = new IntegerInput("how many clipped images", 10,
- 30, p);
-
- Button createClippedImages = new Button("time the creation",
- new ClickHandler() {
- boolean firstTime = true;
-
- public void onClick(ClickEvent event) {
- final Duration d = new Duration();
-
- final int numImages = size.getValue();
- final TreeImages test = GWT.<TreeImages> create(TreeImages.class);
-
- for (int i = 0; i < numImages; i++) {
- Image current = test.treeClosed().createImage();
-
- if (i == numImages - 1) {
- current.addLoadHandler(new LoadHandler() {
- public void onLoad(LoadEvent event) {
- if (firstTime) {
- log.report("Took " + d.elapsedMillis()
- + " milliseconds to create the images");
- }
- firstTime = false;
- }
- });
- }
- images.add(current);
- RootPanel.get().add(current);
- }
- }
- });
-
- v.add(createClippedImages);
- return v;
- }
-
- @Override
- public String getInstructions() {
- return "IE has traditionally been very slow compared to the other browsers, this speed test in intended to allow us to capture and document improvements in the speed of clipped images";
- }
-
- @Override
- public String getSummary() {
- return "clear() speed check";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForCheckBoxAndRadioButtonEvents.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForCheckBoxAndRadioButtonEvents.java
deleted file mode 100644
index 1afbee1..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForCheckBoxAndRadioButtonEvents.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.HandlesAllKeyEvents;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.EventReporter;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.CheckBox;
-import com.google.gwt.user.client.ui.RadioButton;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Visual testing of rich text box events.
- */
-public class VisualsForCheckBoxAndRadioButtonEvents extends AbstractIssue {
- private VerticalPanel p = new VerticalPanel();
-
- @SuppressWarnings("deprecation")
- @Override
- public Widget createIssue() {
- p.setWidth("500px");
- p.setBorderWidth(1);
- // TextBox
- final CheckBox b = new CheckBox("My Checkbox");
- b.setTitle("text box");
- p.add(b);
- EventReporter<Boolean, Object> handler = new EventReporter<Boolean, Object>(
- p);
- p.add(new Button("change value with event", new ClickHandler() {
- public void onClick(ClickEvent event) {
- b.setValue(false, true);
- }
- }));
- b.addKeyboardListener(handler);
- HandlesAllKeyEvents.addHandlers(b, handler);
- b.addFocusHandler(handler);
- b.addBlurHandler(handler);
- b.addFocusListener(handler);
- b.addValueChangeHandler(handler);
-
- // Rich text box:
- final RadioButton radio = new RadioButton("A", "With events");
- p.add(radio);
- final RadioButton radioPrime = new RadioButton("A", "No events");
- p.add(radioPrime);
- b.setTitle("Radio Button");
- p.add(radio);
- handler = new EventReporter<Boolean, Object>(p);
- radio.addKeyboardListener(handler);
-
- HandlesAllKeyEvents.addHandlers(radio, handler);
- radio.addBlurHandler(handler);
- radio.addFocusHandler(handler);
- radio.addClickHandler(handler);
- radio.addClickListener(handler);
- radio.addValueChangeHandler(handler);
- p.add(new Button("change value with event", new ClickHandler() {
- public void onClick(ClickEvent event) {
- radio.setValue(true, true);
- }
- }));
-
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "Click on CheckBox and Radio Button, use change value events,see that correct events are firing";
- }
-
- @Override
- public String getSummary() {
- return "CheckBox and RadioButton test";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForCustomButtons.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForCustomButtons.java
deleted file mode 100644
index 26d58c3..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForCustomButtons.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.EventReporter;
-import com.google.gwt.museum.client.common.SimpleLayout;
-import com.google.gwt.user.client.ui.PushButton;
-import com.google.gwt.user.client.ui.ToggleButton;
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Visual test for custom buttons.
- */
-public class VisualsForCustomButtons extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- SimpleLayout l = new SimpleLayout();
- Tree t = new Tree();
- PushButton a = new PushButton("Simple-dum");
- t.add(a);
- PushButton a2 = new PushButton("Simple-dee");
- t.add(a2);
- PushButton aUp = new PushButton("A-up");
- aUp.getDownFace().setHTML("A-down");
- t.add(aUp);
-
- ToggleButton b = new ToggleButton("B");
- t.add(b);
- l.add(t);
- l.nextRow();
- EventReporter<Object, Object> handler = new EventReporter<Object, Object>();
- l.addFooter(handler);
- handler.addClickHandler(a, l);
- handler.addClickHandler(a2, l);
- handler.addClickHandler(aUp, l);
- handler.addClickHandler(b, l);
-
- return l;
- }
-
- @Override
- public String getInstructions() {
- return "Check for custom buttons";
- }
-
- @Override
- public String getSummary() {
- return "CustomButton visual test";
- }
-
- @Override
- public boolean hasCSS() {
-
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java
deleted file mode 100644
index 273c8e8..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDateBox.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.KeyDownEvent;
-import com.google.gwt.event.dom.client.KeyDownHandler;
-import com.google.gwt.event.logical.shared.ValueChangeEvent;
-import com.google.gwt.event.logical.shared.ValueChangeHandler;
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.EventReporter;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.datepicker.client.DateBox;
-import com.google.gwt.user.datepicker.client.DatePicker;
-import com.google.gwt.user.datepicker.client.DateBox.DefaultFormat;
-
-import java.util.Date;
-
-/**
- * Visuals for date box.
- */
-public class VisualsForDateBox extends AbstractIssue {
- class FormatWithNewYearsEve extends DefaultFormat {
- public FormatWithNewYearsEve() {
- }
-
- public FormatWithNewYearsEve(DateTimeFormat format) {
- super(format);
- }
-
- @Override
- public String format(DateBox box, Date d) {
- if (d == null) {
- return "Please Change me";
- } else {
- return super.format(box, d);
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public Date parse(DateBox box, String input, boolean reportError) {
- if (input.equalsIgnoreCase("new year's eve")) {
- Date d = new Date();
- d.setDate(31);
- d.setMonth(12);
- return d;
- } else {
- return super.parse(box, input, reportError);
- }
- }
- }
-
- @Override
- public Widget createIssue() {
- VerticalPanel v = new VerticalPanel();
- v.add(new HTML("<div style='height:25px'></div>"));
- v.add(dateRange());
- v.add(new HTML("<div style='height:25px'></div>"));
- return v;
- }
-
- @Override
- public String getInstructions() {
- return "Instructions <ul><li>Click on first date box, see that date picker is displayed</li> "
- + "<li>use arrow keys to navigate to second date box, select a date.</li> "
- + "<li>type in a bad date then click back to the first date box. Your bad date should now be in red</li>"
- + "<li>get back to the second box, now type in a valid date and tab away, its text should now be black again. </li>"
- + "<li>Try typing 'New Year's Eve' in on the start datebox)</li>"
- + "<li> Hit 'Show values' and confirm that you see the correct values</li></ul>";
- }
-
- @Override
- public String getSummary() {
- return "date box visual test";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- private Widget dateRange() {
- VerticalPanel v = new VerticalPanel();
- HorizontalPanel p = new HorizontalPanel();
- v.add(p);
- final DateBox start = new DateBox(new DatePicker(), null,
- new FormatWithNewYearsEve());
-
- start.setWidth("13em");
- final DateBox end = new DateBox();
- end.setWidth("13em");
-
- end.getDatePicker().addValueChangeHandler(new ValueChangeHandler<Date>() {
- public void onValueChange(ValueChangeEvent<Date> event) {
- start.removeStyleName("user-modified");
- }
- });
-
- final TextBox startText = start.getTextBox();
- startText.addKeyDownHandler(new KeyDownHandler() {
- public void onKeyDown(KeyDownEvent e) {
- if (e.isRightArrow()
- && start.getCursorPos() == startText.getText().length()) {
- start.hideDatePicker();
- end.setFocus(true);
- }
- }
- });
-
- end.getTextBox().addKeyDownHandler(new KeyDownHandler() {
- public void onKeyDown(KeyDownEvent e) {
- if ((e.isLeftArrow()) && end.getCursorPos() == 0) {
- end.hideDatePicker();
- start.setFocus(true);
- }
- }
- });
-
- end.setValue(new Date());
- p.add(start);
- Label l = new Label(" - ");
- l.setStyleName("filler");
- p.add(l);
- p.add(end);
- final Label value = new Label();
- p.add(value);
- HorizontalPanel h2 = new HorizontalPanel();
- v.add(h2);
- h2.add(new Button("Short format", new ClickHandler() {
- public void onClick(ClickEvent event) {
- updateFormat(start, end, DateTimeFormat.getShortDateFormat());
- }
- }));
- h2.add(new Button("Long format", new ClickHandler() {
-
- public void onClick(ClickEvent event) {
- updateFormat(start, end, DateTimeFormat.getMediumDateFormat());
- }
- }));
-
- h2.add(new Button("Clear", new ClickHandler() {
- public void onClick(ClickEvent sender) {
- start.setValue(null);
- end.setValue(null);
- }
- }));
-
- h2.add(new Button("Show Values", new ClickHandler() {
- public void onClick(ClickEvent event) {
- DateTimeFormat f = DateTimeFormat.getShortDateFormat();
- Date d1 = start.getValue();
- Date d2 = end.getValue();
- value.setText("Start: \"" + (d1 == null ? "null" : f.format(d1))
- + "\" End: \"" + (d2 == null ? "null" : f.format(d2)) + "\"");
- }
- }));
-
- EventReporter<Date, DateBox> reporter = new EventReporter<Date, DateBox>();
- start.addValueChangeHandler(reporter);
- end.addValueChangeHandler(reporter);
- reporter.report("Events are logged here");
- v.add(reporter);
- return v;
- }
-
- private void updateFormat(DateBox start, DateBox end, DateTimeFormat format) {
- // You can replace the format itself.
- start.setFormat(new FormatWithNewYearsEve(format));
- end.setFormat(new DefaultFormat(format));
- }
-}
\ No newline at end of file
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDatePicker.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDatePicker.java
deleted file mode 100644
index 14386b3..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDatePicker.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.logical.shared.HighlightEvent;
-import com.google.gwt.event.logical.shared.HighlightHandler;
-import com.google.gwt.event.logical.shared.ShowRangeEvent;
-import com.google.gwt.event.logical.shared.ShowRangeHandler;
-import com.google.gwt.event.logical.shared.ValueChangeEvent;
-import com.google.gwt.event.logical.shared.ValueChangeHandler;
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.datepicker.client.DatePicker;
-
-import java.util.Date;
-
-/**
- * Date picker demo.
- */
-public class VisualsForDatePicker extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- VerticalPanel p = new VerticalPanel();
- final DatePicker picker = new DatePicker();
- p.add(picker);
- final Label value = new Label("value: ");
- p.add(value);
- final Label highlight = new Label("highlight: ");
- p.add(highlight);
- final Label range = new Label("range: ");
- p.add(range);
- picker.addValueChangeHandler(new ValueChangeHandler<Date>() {
- public void onValueChange(ValueChangeEvent<Date> event) {
- value.setText("value: "
- + DateTimeFormat.getShortDateFormat().format(event.getValue()));
- }
- });
- picker.addHighlightHandler(new HighlightHandler<Date>() {
-
- @SuppressWarnings("deprecation")
- // Should never be seen, as highlight should be cloned.
- public void onHighlight(HighlightEvent<Date> event) {
- event.getHighlighted().setYear(1);
- picker.getHighlightedDate().setYear(1);
- }
-
- });
- picker.addHighlightHandler(new HighlightHandler<Date>() {
- public void onHighlight(HighlightEvent<Date> event) {
- highlight.setText("highlight: "
- + DateTimeFormat.getShortDateFormat().format(event.getHighlighted()));
- }
- });
- picker.addShowRangeHandler(new ShowRangeHandler<Date>() {
- public void onShowRange(ShowRangeEvent<Date> event) {
- Date start = event.getStart();
- Date end = event.getEnd();
- DateTimeFormat format = DateTimeFormat.getShortDateFormat();
- range.setText("range: " + format.format(start) + " - "
- + format.format(end));
- }
- });
- return p;
- };
-
- @Override
- public String getInstructions() {
- return "Go back one month, go forward one month, check that highlighting is working, and try selecting a date.";
- }
-
- @Override
- public String getSummary() {
- return "Visual test for date picker";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDialogBox.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDialogBox.java
deleted file mode 100644
index 40df95a..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDialogBox.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.dom.client.Document;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.MouseDownEvent;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.DialogBox;
-import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Verify that events fire in all browsers.
- */
-public class VisualsForDialogBox extends AbstractIssue {
-
- enum VisibleEvents {
- mouseDown, mouseEnter, mouseLeave, mouseMove, mouseUp, captionMouseDown
- }
-
- private final class VisibleDialogBox extends DialogBox {
- private FlexTable layout = null;
-
- private final Map<VisibleEvents, Element> eventToElement = new HashMap<VisibleEvents, Element>();
-
- private boolean maybeClose;
-
- public VisibleDialogBox() {
- this(false);
- }
-
- public VisibleDialogBox(boolean autoHide) {
- this(autoHide, true);
- }
-
- public VisibleDialogBox(boolean autoHide, boolean modal) {
- super(autoHide, modal);
- layout = new FlexTable();
- layout.setCellPadding(3);
- layout.setBorderWidth(2);
- layout.setHTML(0, 0, "<b>VisibleEvents</b>");
- layout.setHTML(0, 1, "<b>Status</b>");
-
- final String style = "float:right; border: 1px solid blue; color:blue;"
- + "font-weight:bold; font-size:85%";
- setHTML("I Gots a Close Box<div id='vis-closebox' style='" + style
- + "'> X </div>");
-
- for (VisibleEvents e : VisibleEvents.values()) {
- eventToElement.put(e, addResultRow(e.name()));
- }
- add(layout);
- }
-
- @Override
- public void onBrowserEvent(Event event) {
- switch (event.getTypeInt()) {
- case Event.ONMOUSEDOWN:
- if (isCloseBoxEvent(event)) {
- maybeClose = true;
- return;
- }
- break;
- case Event.ONMOUSEUP:
- if (maybeClose && isCloseBoxEvent(event)) {
- maybeClose = false;
- hide();
- return;
- }
- break;
- }
- maybeClose = false;
- super.onBrowserEvent(event);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void onMouseDown(Widget sender, int x, int y) {
- pass(VisibleEvents.mouseDown);
- super.onMouseDown(sender, x, y);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void onMouseEnter(Widget sender) {
- pass(VisibleEvents.mouseEnter);
- sender.getElement().getStyle().setProperty("background", "yellow");
- super.onMouseEnter(sender);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void onMouseLeave(Widget sender) {
- pass(VisibleEvents.mouseLeave);
- sender.getElement().getStyle().setProperty("background", "");
- super.onMouseLeave(sender);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void onMouseMove(Widget sender, int x, int y) {
- pass(VisibleEvents.mouseMove);
- super.onMouseMove(sender, x, y);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void onMouseUp(Widget sender, int x, int y) {
- pass(VisibleEvents.mouseUp);
- super.onMouseUp(sender, x, y);
- }
-
- public void pass(VisibleEvents event) {
- eventToElement.get(event).setInnerHTML(
- "<span style='color:green'>pass</span>");
- }
-
- private Element addResultRow(String eventName) {
- int row = layout.getRowCount();
- layout.setHTML(row, 0, eventName);
- layout.setHTML(row, 1, "<span style='color:red'>?</span>");
- Element cell = layout.getCellFormatter().getElement(row, 1);
- return cell;
- }
-
- private boolean isCloseBoxEvent(Event event) {
- return Document.get().getElementById("vis-closebox").isOrHasChild(
- event.getTarget());
- }
- }
-
- @Override
- public Widget createIssue() {
- // Create a few extra dialog boxes
- final DialogBox dialog0 = showCustomDialog(true, true, false, "Dialog 0",
- "I cannot be dragged or closed until Dialog 2 is closed", 0, 100);
- final DialogBox dialog1 = showCustomDialog(true, false, false, "Dialog 1",
- "I cannot be dragged or closed until Dialog 2 is closed", 0, 200);
- final DialogBox dialog2 = showCustomDialog(false, false, true, "Dialog 2",
- "I can be dragged", 0, 300);
- final DialogBox dialog3 = showCustomDialog(
- true,
- false,
- false,
- "Dialog 3",
- "I should auto close as soon as you click outside of me and Dialog 4 or greater",
- 0, 400);
- final DialogBox dialog4 = showCustomDialog(false, false, false, "Dialog 4",
- "I can be dragged", 0, 500);
-
- final VisibleDialogBox dialog = showVisibleDialog();
-
- SimplePanel panel = new SimplePanel() {
- @Override
- protected void onUnload() {
- if (dialog.isAttached()) {
- dialog.hide();
- dialog0.hide();
- dialog1.hide();
- dialog2.hide();
- dialog3.hide();
- dialog4.hide();
- }
- }
- };
- return panel;
- }
-
- @Override
- public String getInstructions() {
- return "Confirm color change on mouse over caption, that the "
- + "custom close box works, and that each mouse event fires. "
- + "Verify that the text in each DialogBox is true.";
- }
-
- @Override
- public String getSummary() {
- return "Legacy mouse event callbacks fire";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- private DialogBox showCustomDialog(boolean autoHide,
- boolean previewAllEvents, boolean modal, String caption, String message,
- int left, int top) {
- final DialogBox dialog = new DialogBox(autoHide, modal);
- dialog.setPreviewingAllNativeEvents(previewAllEvents);
-
- // Set the caption
- caption += " (autoHide=" + dialog.isAutoHideEnabled();
- caption += ", previewAllEvents=" + dialog.isPreviewingAllNativeEvents();
- caption += ", modal=" + dialog.isModal() + ")";
- dialog.setText(caption);
-
- // Set the content
- Label content = new Label(message);
- if (autoHide || previewAllEvents) {
- dialog.setWidget(content);
- } else {
- VerticalPanel vPanel = new VerticalPanel();
- vPanel.add(content);
- vPanel.add(new Button("Close", new ClickHandler() {
- public void onClick(ClickEvent event) {
- dialog.hide();
- }
- }));
- dialog.setWidget(vPanel);
- }
- dialog.setPopupPosition(left, top);
- dialog.show();
- return dialog;
- }
-
- private VisibleDialogBox showVisibleDialog() {
- final VisibleDialogBox dialog = new VisibleDialogBox();
- dialog.setModal(false);
- dialog.center();
- dialog.getCaption().addMouseDownHandler(new MouseDownHandler() {
- public void onMouseDown(MouseDownEvent event) {
- dialog.pass(VisibleEvents.captionMouseDown);
- }
- });
-
- return dialog;
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDisclosurePanelEvents.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDisclosurePanelEvents.java
deleted file mode 100644
index 772e923..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDisclosurePanelEvents.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.logical.shared.CloseEvent;
-import com.google.gwt.event.logical.shared.CloseHandler;
-import com.google.gwt.event.logical.shared.OpenEvent;
-import com.google.gwt.event.logical.shared.OpenHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.CheckBox;
-import com.google.gwt.user.client.ui.DisclosureEvent;
-import com.google.gwt.user.client.ui.DisclosureHandler;
-import com.google.gwt.user.client.ui.DisclosurePanel;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.UIObject;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Testing disclosure events.
- */
-@SuppressWarnings("deprecation")
-public class VisualsForDisclosurePanelEvents extends AbstractIssue {
-
- VerticalPanel report = new VerticalPanel();
-
- @Override
- public Widget createIssue() {
- VerticalPanel p = new VerticalPanel();
-
- p.add(createDisclosurePanel("disclose 1"));
- p.add(createDisclosurePanel("disclose 2"));
- p.add(report);
- report("reporting");
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "Click on disclosure panel, see the expected Open and Close events firing";
- }
-
- @Override
- public String getSummary() {
- return "DisclosurePanel event tests";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- DisclosurePanel createDisclosurePanel(final String name) {
- DisclosurePanel widget = new DisclosurePanel();
- widget.setContent(new HTML("content for " + name));
- widget.setTitle(name);
- widget.setHeader(new CheckBox(name));
- class MyHandler implements DisclosureHandler, OpenHandler<DisclosurePanel>,
- CloseHandler<DisclosurePanel> {
-
- public void onClose(CloseEvent<DisclosurePanel> event) {
- report(event);
- }
-
- public void onClose(DisclosureEvent event) {
- report(name + "close");
- }
-
- public void onOpen(DisclosureEvent event) {
- report(name + "open");
- }
-
- public void onOpen(OpenEvent<DisclosurePanel> event) {
- report(event);
- }
- }
- MyHandler handler = new MyHandler();
- widget.addCloseHandler(handler);
- widget.addOpenHandler(handler);
- widget.addEventHandler(handler);
- return widget;
- }
-
- private void report(GwtEvent<?> event) {
- String title = ((UIObject) event.getSource()).getTitle();
- report(title + " fired " + event.toDebugString());
- }
-
- // will be replaced by logging
- private void report(String s) {
- report.insert(new Label(s), 0);
- if (report.getWidgetCount() == 10) {
- report.remove(9);
- }
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForEventsFiring.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForEventsFiring.java
deleted file mode 100644
index 41f60fd..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForEventsFiring.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.dom.client.NativeEvent;
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.ContextMenuEvent;
-import com.google.gwt.event.dom.client.ContextMenuHandler;
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.dom.client.ErrorEvent;
-import com.google.gwt.event.dom.client.ErrorHandler;
-import com.google.gwt.event.dom.client.FocusEvent;
-import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.event.dom.client.HasChangeHandlers;
-import com.google.gwt.event.dom.client.HasContextMenuHandlers;
-import com.google.gwt.event.dom.client.HasDoubleClickHandlers;
-import com.google.gwt.event.dom.client.HasMouseWheelHandlers;
-import com.google.gwt.event.dom.client.KeyDownEvent;
-import com.google.gwt.event.dom.client.KeyDownHandler;
-import com.google.gwt.event.dom.client.KeyPressEvent;
-import com.google.gwt.event.dom.client.KeyPressHandler;
-import com.google.gwt.event.dom.client.KeyUpEvent;
-import com.google.gwt.event.dom.client.KeyUpHandler;
-import com.google.gwt.event.dom.client.LoadEvent;
-import com.google.gwt.event.dom.client.LoadHandler;
-import com.google.gwt.event.dom.client.MouseDownEvent;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseMoveEvent;
-import com.google.gwt.event.dom.client.MouseMoveHandler;
-import com.google.gwt.event.dom.client.MouseOutEvent;
-import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverEvent;
-import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpEvent;
-import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.event.dom.client.MouseWheelEvent;
-import com.google.gwt.event.dom.client.MouseWheelHandler;
-import com.google.gwt.event.dom.client.ScrollEvent;
-import com.google.gwt.event.dom.client.ScrollHandler;
-import com.google.gwt.event.logical.shared.ResizeEvent;
-import com.google.gwt.event.logical.shared.ResizeHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HasHorizontalAlignment;
-import com.google.gwt.user.client.ui.HasVerticalAlignment;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Verify that events fire in all browsers.
- */
-public class VisualsForEventsFiring extends AbstractIssue {
- private static class CustomImage extends Image implements
- HasDoubleClickHandlers, HasContextMenuHandlers {
- public HandlerRegistration addContextMenuHandler(ContextMenuHandler handler) {
- return addDomHandler(handler, ContextMenuEvent.getType());
- }
-
- public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) {
- return addDomHandler(handler, DoubleClickEvent.getType());
- }
- }
-
- private static class CustomScrollPanel extends ScrollPanel implements
- HasMouseWheelHandlers {
- public CustomScrollPanel(Widget content) {
- super(content);
- }
-
- public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
- return addDomHandler(handler, MouseWheelEvent.getType());
- }
- }
-
- private static class CustomTextBox extends TextBox implements
- HasChangeHandlers {
- public HandlerRegistration addChangeHandler(ChangeHandler handler) {
- return addDomHandler(handler, ChangeEvent.getType());
- }
- }
-
- private static final int WINDOW_EVENT_SCROLL = -1;
- private static final int WINDOW_EVENT_RESIZE = -2;
- private static final int WINDOW_EVENT_CLOSING = -3;
- private static final int VELOCITY_EVENT = -4;
-
- /**
- * The main grid used for layout.
- */
- private FlexTable layout = null;
-
- private Map<Integer, Integer> eventMap = new HashMap<Integer, Integer>();
-
- @Override
- public Widget createIssue() {
- // Create a grid to hold all of the tests
- eventMap.clear();
- layout = new FlexTable();
- layout.setCellPadding(3);
- layout.setBorderWidth(2);
- layout.setHTML(0, 0, "<b>Action to Perform</b>");
- layout.setHTML(0, 1, "<b>Event</b>");
- layout.setHTML(0, 2, "<b>Status</b>");
-
- prepMouseEvents();
- prepKeyboardEvents();
- prepScrollAndMouseWheelEvents();
- prepLoadEvents();
- prepWindowEvents();
-
- // The following are not testable or not supported in all browsers
- // onlosecapture
-
- return layout;
- }
-
- @Override
- public String getInstructions() {
- return "Use the Widgets below to verify that all events fire in all "
- + "browsers. To test an event, perform the action require to trigger "
- + "the event using the provided widget.";
- }
-
- @Override
- public String getSummary() {
- return "Events fire in current browsers";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- /**
- * Add a test that is dependent on a previous test.
- *
- * @param eventType the type of event defined in {@link Event}
- * @param eventName the name of the event
- * @return the index of the test
- */
- private int addDependentTest(int eventType, String eventName) {
- // Find the last test
- int numRows = layout.getRowCount();
- eventMap.put(new Integer(eventType), new Integer(numRows));
- for (int i = numRows - 1; i > 0; i--) {
- if (layout.getCellCount(i) == 3) {
- FlexCellFormatter formatter = layout.getFlexCellFormatter();
- int rowSpan = formatter.getRowSpan(i, 0);
- formatter.setRowSpan(i, 0, rowSpan + 1);
- break;
- }
- }
- layout.setText(numRows, 0, eventName);
- layout.setText(numRows, 1, "?");
- return numRows;
- }
-
- /**
- * Add a new test that tests one or more events.
- *
- * @param eventType the type of event defined in {@link Event}
- * @param eventName the name of the event
- * @param trigger the widget that triggers the events
- * @return the index of the test
- */
- private int addTest(int eventType, String eventName, Widget trigger) {
- int numRows = layout.getRowCount();
- eventMap.put(new Integer(eventType), new Integer(numRows));
- layout.setWidget(numRows, 0, trigger);
- layout.setText(numRows, 1, eventName);
- layout.setText(numRows, 2, "?");
-
- FlexCellFormatter formatter = layout.getFlexCellFormatter();
- formatter.setVerticalAlignment(numRows, 0,
- HasVerticalAlignment.ALIGN_MIDDLE);
- formatter.setHorizontalAlignment(numRows, 0,
- HasHorizontalAlignment.ALIGN_CENTER);
- return numRows;
- }
-
- /**
- * Mark the event as passed.
- *
- * @param event the event that was triggered
- */
- private void passTest(NativeEvent event) {
- passTest(Event.as(event).getTypeInt());
- }
-
- /**
- * Mark the event as passed.
- *
- * @param eventType the event type that was triggered
- */
- private void passTest(int eventType) {
- int rowIndex = eventMap.get(new Integer(eventType));
- if (layout.getCellCount(rowIndex) == 3) {
- layout.setHTML(rowIndex, 2, "pass");
- } else {
- layout.setHTML(rowIndex, 1, "pass");
- }
- }
-
- private void prepKeyboardEvents() {
- // Setup a text box to trigger the events
- CustomTextBox textBox = new CustomTextBox();
-
- // Setup the tests
- textBox.setText("Type a letter");
- addTest(Event.ONKEYDOWN, "keydown", textBox);
- addDependentTest(Event.ONKEYPRESS, "keypress");
- addDependentTest(Event.ONKEYUP, "keyup");
- addDependentTest(Event.ONFOCUS, "focus");
- addDependentTest(Event.ONBLUR, "blur");
- addDependentTest(Event.ONCHANGE, "change");
-
- // Add event handlers
- textBox.addKeyDownHandler(new KeyDownHandler() {
- public void onKeyDown(KeyDownEvent event) {
-
- event.isAltKeyDown();
- event.isControlKeyDown();
- event.isShiftKeyDown();
- event.isMetaKeyDown();
- assert event.getNativeKeyCode() > 0;
- passTest(event.getNativeEvent());
- }
- });
- textBox.addKeyUpHandler(new KeyUpHandler() {
- public void onKeyUp(KeyUpEvent event) {
- event.isAltKeyDown();
- event.isControlKeyDown();
- event.isShiftKeyDown();
- event.isMetaKeyDown();
- assert event.getNativeKeyCode() > 0;
- passTest(event.getNativeEvent());
- }
- });
- textBox.addKeyPressHandler(new KeyPressHandler() {
- public void onKeyPress(KeyPressEvent event) {
- event.isAltKeyDown();
- event.isControlKeyDown();
- event.isShiftKeyDown();
- event.isMetaKeyDown();
- assert event.getCharCode() > 0;
- passTest(event.getNativeEvent());
- }
- });
- textBox.addFocusHandler(new FocusHandler() {
- public void onFocus(FocusEvent event) {
- passTest(event.getNativeEvent());
- }
- });
- textBox.addBlurHandler(new BlurHandler() {
- public void onBlur(BlurEvent event) {
- passTest(event.getNativeEvent());
- }
- });
- textBox.addChangeHandler(new ChangeHandler() {
- public void onChange(ChangeEvent event) {
- passTest(event.getNativeEvent());
- }
- });
- }
-
- private void prepLoadEvents() {
- // Create an image to trigger events
- final CustomImage loadable = new CustomImage();
-
- // Setup the tests
- addTest(Event.ONERROR, "error", loadable);
- addDependentTest(Event.ONLOAD, "load");
- addDependentTest(Event.ONCONTEXTMENU, "contextMenu");
- addDependentTest(Event.ONDBLCLICK, "dblclick");
-
- // Add the handlers
- loadable.addErrorHandler(new ErrorHandler() {
- public void onError(ErrorEvent event) {
- loadable.setUrl("issues/images/gwtLogo.png");
- passTest(event.getNativeEvent());
- }
- });
- loadable.addLoadHandler(new LoadHandler() {
- public void onLoad(LoadEvent event) {
- passTest(event.getNativeEvent());
- }
- });
- loadable.addDoubleClickHandler(new DoubleClickHandler() {
- public void onDoubleClick(DoubleClickEvent event) {
- passTest(event.getNativeEvent());
- }
- });
- loadable.addContextMenuHandler(new ContextMenuHandler() {
- public void onContextMenu(ContextMenuEvent event) {
- passTest(event.getNativeEvent());
- }
- });
-
- // Trigger the events
- loadable.setUrl("imageDoesNotExist.abc");
- }
-
- private void prepMouseEvents() {
- // Create a button to trigger events
- final Button button = new Button("Click me, move over me") {
- @Override
- public void onBrowserEvent(Event event) {
- super.onBrowserEvent(event);
-
- // Verify that values associated with events are defined. For some
- // values, we just want to make sure we can get them without any
- // errors.
- assert event.getClientX() > 0;
- assert event.getClientY() > 0;
- assert event.getScreenX() > 0;
- assert event.getScreenY() > 0;
- event.getAltKey();
- event.getCtrlKey();
- event.getShiftKey();
- event.getMetaKey();
- }
- };
-
- // Setup the tests
- addTest(Event.ONCLICK, "click", button);
- addDependentTest(Event.ONMOUSEDOWN, "mousedown");
- addDependentTest(Event.ONMOUSEUP, "mouseup");
- addDependentTest(Event.ONMOUSEOVER, "mouseover");
- addDependentTest(Event.ONMOUSEOUT, "mouseout");
- addDependentTest(Event.ONMOUSEMOVE, "mousemove");
-
- // Add event handlers
- button.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent event) {
- passTest(event.getNativeEvent());
- }
- });
- button.addMouseDownHandler(new MouseDownHandler() {
- public void onMouseDown(MouseDownEvent event) {
- event.getNativeButton();
- passTest(event.getNativeEvent());
- }
- });
- button.addMouseUpHandler(new MouseUpHandler() {
- public void onMouseUp(MouseUpEvent event) {
- event.getNativeButton();
- passTest(event.getNativeEvent());
- }
- });
- button.addMouseMoveHandler(new MouseMoveHandler() {
- public void onMouseMove(MouseMoveEvent event) {
- passTest(event.getNativeEvent());
- }
- });
- button.addMouseOutHandler(new MouseOutHandler() {
- public void onMouseOut(MouseOutEvent event) {
- NativeEvent nativeEvent = event.getNativeEvent();
- assert nativeEvent.getRelatedEventTarget() != null;
- assert nativeEvent.getEventTarget() != null;
- if (button.getElement().equals(nativeEvent.getEventTarget())
- && button.getElement().getParentElement().equals(
- nativeEvent.getRelatedEventTarget())) {
- passTest(nativeEvent);
- }
- }
- });
- button.addMouseOverHandler(new MouseOverHandler() {
- public void onMouseOver(MouseOverEvent event) {
- NativeEvent nativeEvent = event.getNativeEvent();
- assert nativeEvent.getRelatedEventTarget() != null;
- assert nativeEvent.getEventTarget() != null;
- if (button.getElement().equals(nativeEvent.getEventTarget())
- && button.getElement().getParentElement().equals(
- nativeEvent.getRelatedEventTarget())) {
- passTest(nativeEvent);
- }
- }
- });
- }
-
- private void prepScrollAndMouseWheelEvents() {
- // Create a widget to trigger events
- String scrollableMessage = "Scroll to the bottom<br>(using mouse wheel<br>"
- + "if supported)";
- HTML scrollableContents = new HTML(scrollableMessage);
- scrollableContents.setPixelSize(400, 400);
- scrollableContents.getElement().getStyle().setProperty("textAlign", "left");
- CustomScrollPanel scrollable = new CustomScrollPanel(scrollableContents);
-
- // Setup the tests
- scrollable.setAlwaysShowScrollBars(true);
- scrollable.setPixelSize(200, 100);
- addTest(Event.ONSCROLL, "scroll", scrollable);
- addDependentTest(Event.ONMOUSEWHEEL, "mousewheel");
-
- // Display the mouse wheel velocity
- final int velocityIndex = addDependentTest(VELOCITY_EVENT, "velocityY");
-
- // Add event handlers
- scrollable.addScrollHandler(new ScrollHandler() {
- public void onScroll(ScrollEvent event) {
- passTest(event.getNativeEvent());
- }
- });
- scrollable.addMouseWheelHandler(new MouseWheelHandler() {
- public void onMouseWheel(MouseWheelEvent event) {
- event.getClientX();
- event.getClientY();
- event.getScreenX();
- event.getScreenY();
- int velocityY = event.getDeltaY();
- layout.setText(velocityIndex, 1, velocityY + "");
- passTest(event.getNativeEvent());
- }
- });
- }
-
- private void prepWindowEvents() {
- Label windowLabel = new Label("Window level events");
-
- // Setup the tests
- addTest(WINDOW_EVENT_SCROLL, "window.onscroll", windowLabel);
- addDependentTest(WINDOW_EVENT_RESIZE, "window.onresize");
- addDependentTest(WINDOW_EVENT_CLOSING, "window.onbeforeunload");
-
- // Add event handlers
- Window.addWindowScrollHandler(new Window.ScrollHandler() {
- public void onWindowScroll(Window.ScrollEvent event) {
- passTest(WINDOW_EVENT_SCROLL);
- }
- });
- Window.addResizeHandler(new ResizeHandler() {
- public void onResize(ResizeEvent event) {
- passTest(WINDOW_EVENT_RESIZE);
- }
- });
- Window.addWindowClosingHandler(new Window.ClosingHandler() {
- public void onWindowClosing(Window.ClosingEvent event) {
- event.setMessage("Stay and verify that window.onbeforeunload() has passed");
- passTest(WINDOW_EVENT_CLOSING);
- }
- });
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForMenuEvents.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForMenuEvents.java
deleted file mode 100644
index d11371a..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForMenuEvents.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.logical.shared.CloseEvent;
-import com.google.gwt.event.logical.shared.CloseHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.EventReporter;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.MenuBar;
-import com.google.gwt.user.client.ui.Panel;
-import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * A simple test for suggest box events.
- */
-@SuppressWarnings("deprecation")
-public class VisualsForMenuEvents extends AbstractIssue {
-
- HorizontalPanel report = new HorizontalPanel();
-
- @Override
- public Widget createIssue() {
- VerticalPanel p = new VerticalPanel();
-
- createMenu(p);
- report.setBorderWidth(3);
-
- report.setCellWidth(report.getWidget(0), "300px");
-
- p.add(report);
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "Open and close menu items and see that you get close events";
- }
-
- @Override
- public String getSummary() {
- return "Menu event tests";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- void createMenu(Panel p) {
- final EventReporter<Object, PopupPanel> reporter = new EventReporter<Object, PopupPanel>(
- report);
- Command command = new Command() {
-
- public void execute() {
- reporter.report("menu item selected");
- }
-
- };
-
- MenuBar main = new MenuBar();
- main.setTitle("Main");
- p.add(main);
- MenuBar barA = new MenuBar();
- barA.setTitle("A");
- CloseHandler<PopupPanel> handler = new CloseHandler<PopupPanel>() {
-
- public void onClose(CloseEvent<PopupPanel> event) {
- reporter.report("closed popup belonging to Main");
- }
-
- };
- main.addCloseHandler(handler);
- barA.addItem("a1", command);
- barA.addItem("a2", command);
-
- handler = new CloseHandler<PopupPanel>() {
-
- public void onClose(CloseEvent<PopupPanel> event) {
- reporter.report("closed popup belonging to A");
- }
-
- };
- barA.addCloseHandler(handler);
- MenuBar barB = new MenuBar();
- barB.setTitle("B");
- barB.addItem("b1", command);
- barB.addItem("b2", command);
-
- handler = new CloseHandler<PopupPanel>() {
-
- public void onClose(CloseEvent<PopupPanel> event) {
- reporter.report("closed popup belonging to B");
- }
-
- };
- barB.addCloseHandler(handler);
- MenuBar barC = new MenuBar();
- barC.addItem("c1", command);
- barC.addItem("c2", command);
-
- handler = new CloseHandler<PopupPanel>() {
-
- public void onClose(CloseEvent<PopupPanel> event) {
- reporter.report("closed popup belonging to c");
- }
-
- };
- barC.addCloseHandler(handler);
- barC.setTitle("C");
-
- handler = new CloseHandler<PopupPanel>() {
-
- public void onClose(CloseEvent<PopupPanel> event) {
- reporter.report("closed popup belonging to B");
- }
-
- };
-
- main.addItem("A", barA);
- barA.addItem("b", barB);
- barB.addItem("c", barC);
- }
-}
\ No newline at end of file
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForPopupEvents.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForPopupEvents.java
deleted file mode 100644
index 81fa475..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForPopupEvents.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.logical.shared.CloseEvent;
-import com.google.gwt.event.logical.shared.CloseHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Visual tests for {@link PopupPanel}.
- */
-public class VisualsForPopupEvents extends AbstractIssue {
- static int xPos = 0;
-
- @Override
- public Widget createIssue() {
- VerticalPanel panel = new VerticalPanel();
- panel.setSpacing(3);
- {
- PopupPanel popup = createButton(true, false, panel);
- Label partner0 = new Label("AutoHide Partner 0");
- Label partner1 = new Label("AutoHide Partner 1");
- popup.addAutoHidePartner(partner0.getElement());
- popup.addAutoHidePartner(partner1.getElement());
-
- HorizontalPanel hPanel = new HorizontalPanel();
- hPanel.setBorderWidth(1);
- hPanel.setSpacing(3);
- hPanel.add(partner0);
- hPanel.add(partner1);
- panel.add(new Label(
- "Clicking on partners should not autoHide this popup:"));
- panel.add(hPanel);
- }
- createButton(true, true, panel);
- createButton(false, false, panel);
- createButton(false, true, panel);
- return panel;
- }
-
- @Override
- public String getInstructions() {
- return "Open and close each popup, check for the closing text in the window title";
- }
-
- @Override
- public String getSummary() {
- return "popup event visual test";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- private PopupPanel createButton(boolean autoHide, boolean modal,
- VerticalPanel panel) {
- final String text = " popup " + (modal ? " modal " : " non-modal ")
- + (autoHide ? "auto hide" : " persistent");
- panel.add(new HTML("<h2>" + text + "</h2>"));
- final PopupPanel p = new PopupPanel(autoHide, modal);
- p.setTitle(text);
- Button b = new Button("show", new ClickHandler() {
- public void onClick(ClickEvent event) {
- p.setPopupPosition(200,
- ((Button) event.getSource()).getAbsoluteTop() - 10);
- p.show();
- }
- });
- panel.add(b);
- p.setWidget(new Button("hide me", new ClickHandler() {
- public void onClick(ClickEvent event) {
- p.hide();
- }
- }));
-
- p.addCloseHandler(new CloseHandler<PopupPanel>() {
- public void onClose(CloseEvent<PopupPanel> event) {
- Window.setTitle("closing popup '" + p.getTitle() + "'. autohide:"
- + event.isAutoClosed());
- }
- });
-
- return p;
- }
-}
\ No newline at end of file
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBox.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBox.java
deleted file mode 100644
index a495c3a..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBox.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.dom.client.Document;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.MouseDownEvent;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
-import com.google.gwt.user.client.ui.SuggestBox;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Visual test for suggest box.
- */
-public class VisualsForSuggestBox extends AbstractIssue {
- MultiWordSuggestOracle girlsNames = new MultiWordSuggestOracle();
- MultiWordSuggestOracle girlsNamesWithDefault = new MultiWordSuggestOracle();
-
- Element textBoxToWrap;
-
- VisualsForSuggestBox() {
- List<String> femaleNames = Arrays.asList("Jamie", "Jill", "Jackie",
- "Susan", "Helen", "Emily", "Karen", "Emily", "Isabella", "Emma", "Ava",
- "Madison", "Sophia", "Olivia", "Abigail", "Hannah", "Elizabeth",
- "Addison", "Samantha", "Ashley", "Alyssa", "Mia", "Chloe", "Natalie",
- "Sarah", "Alexis", "Grace", "Ella", "Brianna", "Hailey", "Taylor",
- "Anna", "Kayla", "Lily", "Lauren", "Victoria", "Savannah", "Nevaeh",
- "Jasmine", "Lillian", "Julia", "Sofia", "Kaylee", "Sydney",
- "Gabriella", "Katherine", "Alexa", "Destiny", "Jessica", "Morgan",
- "Kaitlyn", "Brooke", "Allison", "Makayla", "Avery", "Alexandra",
- "Jocelyn");
- girlsNames.addAll(femaleNames);
- girlsNamesWithDefault.addAll(femaleNames);
- girlsNamesWithDefault.setDefaultSuggestionsFromText(femaleNames);
- }
-
- /**
- * This is the entry point method.
- */
- @Override
- public Widget createIssue() {
- VerticalPanel panel = new VerticalPanel();
- HTML wrapperText = new HTML(
- "Make sure this wrapped suggest box works as normal.");
- panel.add(wrapperText);
- textBoxToWrap = Document.get().createTextInputElement();
- wrapperText.getElement().appendChild(textBoxToWrap);
-
- panel.add(new HTML(
- "Select the show button, nothing should open <br/> Type 'e' and select the button again, now a suggestion list should open and close."));
- panel.add(manuallyShowAndHide());
- panel.add(new Label(
- "Click on suggest box, it should open automatically. Check that First item is not selected"));
- panel.add(suggestBoxWithDefault());
- return panel;
- }
-
- @Override
- public String getInstructions() {
- return "Follow the directions above each suggest box";
- }
-
- @Override
- public String getSummary() {
- return "suggest box visuals";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- private Widget manuallyShowAndHide() {
- FlexTable t = new FlexTable();
- t.getFlexCellFormatter().setColSpan(0, 0, 20);
- final SuggestBox box = simpleSuggestBox();
- box.setAnimationEnabled(true);
- t.setWidget(0, 0, box);
-
- Button showSuggestions = new Button(
- "show suggestions, then hide after 2 seconds", new ClickHandler() {
- public void onClick(ClickEvent event) {
- box.showSuggestionList();
- new Timer() {
-
- @Override
- public void run() {
- box.hideSuggestionList();
- }
-
- }.schedule(2000);
- }
- });
- t.setWidget(1, 0, showSuggestions);
- return t;
- }
-
- private SuggestBox simpleSuggestBox() {
- SuggestBox b = new SuggestBox(girlsNames);
- return b;
- }
-
- private SuggestBox suggestBoxWithDefault() {
- final SuggestBox b = new SuggestBox(girlsNamesWithDefault);
- b.setAutoSelectEnabled(false);
- b.getTextBox().addMouseDownHandler(new MouseDownHandler() {
-
- public void onMouseDown(MouseDownEvent event) {
- b.showSuggestionList();
- }
-
- });
- return b;
- }
-}
\ No newline at end of file
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBoxEvents.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBoxEvents.java
deleted file mode 100644
index d96eac9..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForSuggestBoxEvents.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.logical.shared.ValueChangeEvent;
-import com.google.gwt.event.logical.shared.ValueChangeHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.EventReporter;
-import com.google.gwt.user.client.ui.CheckBox;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
-import com.google.gwt.user.client.ui.Panel;
-import com.google.gwt.user.client.ui.SuggestBox;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * A simple test for suggest box events.
- */
-@SuppressWarnings("deprecation")
-public class VisualsForSuggestBoxEvents extends AbstractIssue {
-
- HorizontalPanel report = new HorizontalPanel();
-
- @Override
- public Widget createIssue() {
- VerticalPanel p = new VerticalPanel();
-
- p.add(createSuggestBox("suggest 1", p));
- p.add(createSuggestBox("suggest 2", p));
- report.setBorderWidth(3);
-
- report.setCellWidth(report.getWidget(0), "300px");
- report.setCellWidth(report.getWidget(1), "300px");
-
- p.add(report);
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "Select suggestions from suggest box, check report for events being fired";
- }
-
- @Override
- public String getSummary() {
- return "suggest box event visual test";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- SuggestBox createSuggestBox(final String suggestBoxName, Panel p) {
-
- List<String> femaleNames = Arrays.asList(new String[] {
- "Jamie", "Jill", "Jackie", "Susan", "Helen", "Emily", "Karen",
- "Abigail", "Kaitlyn", "Laura", "Joanna", "Tasha"});
- MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
- oracle.addAll(femaleNames);
-
- final SuggestBox b = new SuggestBox(oracle);
- b.setTitle(suggestBoxName);
- p.add(b);
- final CheckBox selectsFirst = new CheckBox("Selects first suggestion");
- selectsFirst.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
- public void onValueChange(ValueChangeEvent<Boolean> event) {
- b.setAutoSelectEnabled(event.getValue());
- }
- });
- selectsFirst.setChecked(b.isAutoSelectEnabled());
- p.add(selectsFirst);
- final EventReporter<String, SuggestBox> handler = new EventReporter<String, SuggestBox>(
- report);
-
- handler.new CheckBoxEvent("KeyDown", p) {
-
- @Override
- public HandlerRegistration addHandler() {
- return b.addKeyDownHandler(handler);
- }
-
- };
-
- handler.new CheckBoxListener("ChangeListener", p) {
-
- @Override
- public void addListener() {
- b.addChangeListener(handler);
- }
-
- @Override
- public void removeListener() {
- b.removeChangeListener(handler);
- }
- };
- handler.new CheckBoxListener("Suggestion listener", p) {
-
- @Override
- public void addListener() {
- b.addEventHandler(handler);
- }
-
- @Override
- public void removeListener() {
- b.removeEventHandler(handler);
- }
- };
-
- b.addKeyUpHandler(handler);
- b.addKeyPressHandler(handler);
- b.addFocusListener(handler);
- b.addSelectionHandler(handler);
- b.addValueChangeHandler(handler);
- return b;
- }
-}
\ No newline at end of file
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTableEvents.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTableEvents.java
deleted file mode 100644
index d6a2d15..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTableEvents.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.FocusEvent;
-import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.CheckBox;
-import com.google.gwt.user.client.ui.Grid;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.HTMLTable.Cell;
-
-/**
- * Visual test for table events.
- */
-public class VisualsForTableEvents extends AbstractIssue {
- final Grid g = new Grid(5, 5);
-
- public void fillInGrid() {
- int row = 0;
-
- for (int i = 0; i < 5; i++) {
- g.setText(row, i, "click on cell in row to change");
- }
- ++row;
- for (int i = 0; i < 5; i++) {
- g.setText(row, i, "cell(0," + i + ")");
- }
- ++row;
- for (int i = 0; i < 5; i++) {
- g.setHTML(row, i, "<b>cell(1," + i + "</b>)");
- }
-
- ++row;
- for (int i = 0; i < 5; i++) {
- g.setWidget(row, i, new CheckBox("cell(1," + i + "</b>)"));
- }
-
- ++row;
- for (int i = 0; i < 5; i++) {
- final CheckBox box = new CheckBox("eventful cell(1," + i + "</b>)");
- box.addFocusHandler(new FocusHandler() {
- public void onFocus(FocusEvent event) {
- Window.setTitle(box.getText() + " has focus");
- }
- });
- final int index = i;
- box.addClickHandler(new ClickHandler() {
-
- public void onClick(ClickEvent event) {
- g.setText(0, index, "checkbox click");
- }
- });
-
- g.setWidget(row, i, box);
- }
- }
-
- @Override
- public Widget createIssue() {
- VerticalPanel p = new VerticalPanel();
- fillInGrid();
- p.add(g);
- g.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent event) {
- Cell cell = g.getCellForEvent(event);
- g.setText(0, cell.getCellIndex(), "clicked on " + cell.getCellIndex()
- + "," + cell.getRowIndex());
- }
-
- });
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "Click on the cells";
- }
-
- @Override
- public String getSummary() {
- return "table events";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTextEvents.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTextEvents.java
deleted file mode 100644
index 76cfe4a..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTextEvents.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.HandlesAllKeyEvents;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.EventReporter;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.RichTextArea;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * Visual testing of rich text box events.
- */
-public class VisualsForTextEvents extends AbstractIssue {
- private VerticalPanel p = new VerticalPanel();
-
- @SuppressWarnings("deprecation")
- @Override
- public Widget createIssue() {
- p.setWidth("500px");
- p.setBorderWidth(1);
- // TextBox
- final TextBox b = new TextBox();
- b.setTitle("text box");
- p.add(b);
- EventReporter<String, Object> handler = new EventReporter<String, Object>(p);
- p.add(new Button("change value with event", new ClickHandler() {
- public void onClick(ClickEvent event) {
- b.setValue("emily", true);
- }
- }));
- b.addKeyboardListener(handler);
- HandlesAllKeyEvents.addHandlers(b, handler);
- b.addChangeListener(handler);
- b.addFocusHandler(handler);
- b.addBlurHandler(handler);
- b.addFocusListener(handler);
- b.addValueChangeHandler(handler);
- b.addMouseListener(handler);
- // Rich text box:
- RichTextArea rich = new RichTextArea();
- rich.setTitle("rich text box");
- p.add(rich);
- handler = new EventReporter<String, Object>(p);
- rich.addKeyboardListener(handler);
- HandlesAllKeyEvents.addHandlers(rich,handler);
-
- rich.addBlurHandler(handler);
- rich.addFocusHandler(handler);
- rich.addClickHandler(handler);
- rich.addClickListener(handler);
-
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "type and click into text boxes, see that correct events show up";
- }
-
- @Override
- public String getSummary() {
- return "Text widget event tests";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTree.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTree.java
deleted file mode 100644
index c317aa2..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTree.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.user.client.ui.CheckBox;
-import com.google.gwt.user.client.ui.Focusable;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.RadioButton;
-import com.google.gwt.user.client.ui.SimpleCheckBox;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.TreeItem;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * A simple tree used to quickly exercise tree behavior.
- */
-public class VisualsForTree extends AbstractIssue {
-
- static class DelegatingFocusPanel extends HorizontalPanel implements
- Focusable {
-
- public int getTabIndex() {
- return getFocusable().getTabIndex();
- }
-
- public void setAccessKey(char key) {
- getFocusable().setAccessKey(key);
- }
-
- public void setFocus(boolean focused) {
- getFocusable().setFocus(focused);
- }
-
- public void setTabIndex(int index) {
- getFocusable().setTabIndex(index);
- }
-
- private Focusable getFocusable() {
- for (Widget widget : this.getChildren()) {
- if (widget instanceof Focusable) {
- return (Focusable) widget;
- }
- }
- throw new IllegalArgumentException("No focusable children to focus on");
- }
- }
-
- public static Tree createTree() {
- Tree tree = new Tree();
- TreeItem a = new TreeItem("a");
- TreeItem b = new TreeItem(
- "b, though this is a very, very long text field in order to trigger text wrapping bugs, if there are any such bugs currently in the tree.");
- TreeItem ba = new TreeItem("b.a");
- TreeItem bb = new TreeItem("b.b");
- TreeItem bba = new TreeItem("b.b.a");
- TreeItem bc = new TreeItem("b.c");
- TreeItem c = new TreeItem("c");
- TreeItem d = new TreeItem(new RadioButton("myradio",
- "I should line up nicely"));
- TreeItem e = new TreeItem(new CheckBox("I should line up nicely"));
- TreeItem f = new TreeItem(new CheckBox("I should also line up nicely"));
- f.addItem(new CheckBox("me to"));
- SimplePanel panel = new SimplePanel();
- panel.setWidget(new Label("There should not be any space above me"));
- TreeItem g = new TreeItem(panel);
-
- tree.setSelectedItem(b);
- tree.addItem(a);
- tree.addItem(b);
- tree.addItem(c);
- tree.addItem(d);
- tree.addItem(e);
- tree.addItem(f);
- tree.addItem(g);
- b.addItem(ba);
- b.addItem(bb);
- bb.addItem(bba);
- b.addItem(bc);
-
- // Focus checks
- DelegatingFocusPanel focus = new DelegatingFocusPanel();
- focus.add(new Label("first check box should have focus "));
- focus.add(new SimpleCheckBox());
- focus.add(new SimpleCheckBox());
-
- final DelegatingFocusPanel focus2 = new DelegatingFocusPanel();
- focus2.add(new Label("second check box should have focus "));
- focus2.add(new SimpleCheckBox());
- focus2.add(new SimpleCheckBox());
-
- TreeItem customFocus = new TreeItem(focus2) {
- @Override
- public Focusable getFocusable() {
- return (Focusable) focus2.getWidget(2);
- }
- };
- tree.addItem(focus);
- tree.addItem(customFocus);
- return tree;
- }
-
- @Override
- public Widget createIssue() {
- VerticalPanel p = new VerticalPanel();
- p.add(createTree());
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "Open each node, make sure everything looks right";
- }
-
- @Override
- public String getSummary() {
- return "simple tree, used for generic tree tests";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTreeEvents.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTreeEvents.java
deleted file mode 100644
index 601eb05..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForTreeEvents.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.logical.shared.CloseEvent;
-import com.google.gwt.event.logical.shared.CloseHandler;
-import com.google.gwt.event.logical.shared.OpenEvent;
-import com.google.gwt.event.logical.shared.OpenHandler;
-import com.google.gwt.event.logical.shared.SelectionEvent;
-import com.google.gwt.event.logical.shared.SelectionHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.EventReporter;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.TreeItem;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * A simple tree used to quickly exercise tree behavior.
- */
-public class VisualsForTreeEvents extends AbstractIssue {
-
- @Override
- public Widget createIssue() {
- VerticalPanel p = new VerticalPanel();
- Tree t = VisualsForTree.createTree();
- p.add(t);
- EventReporter<Object, TreeItem> handler = new EventReporter<Object, TreeItem>(
- p);
- t.addKeyboardListener(handler);
- t.addMouseListener(handler);
-
- t.addSelectionHandler(new SelectionHandler<TreeItem>() {
- public void onSelection(SelectionEvent<TreeItem> event) {
- Window.setTitle("select " + prettyPrint(event.getSelectedItem()));
- }
- });
-
- t.addCloseHandler(new CloseHandler<TreeItem>() {
-
- public void onClose(CloseEvent<TreeItem> event) {
- Window.setTitle("close " + prettyPrint(event.getTarget()));
- }
-
- });
-
- t.addOpenHandler(new OpenHandler<TreeItem>() {
-
- public void onOpen(OpenEvent<TreeItem> event) {
- Window.setTitle("open " + prettyPrint(event.getTarget()));
- }
-
- });
-
- return p;
- }
-
- @Override
- public String getInstructions() {
- return "Open each node, ensure you see the right events in the window title";
- }
-
- @Override
- public String getSummary() {
- return "Event Tree tests";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- private String prettyPrint(TreeItem item) {
- return item.getText();
- }
-
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForWindowEvents.java b/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForWindowEvents.java
deleted file mode 100644
index dcb7019..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForWindowEvents.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.museum.client.defaultmuseum;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.logical.shared.CloseEvent;
-import com.google.gwt.event.logical.shared.CloseHandler;
-import com.google.gwt.event.logical.shared.ResizeEvent;
-import com.google.gwt.event.logical.shared.ResizeHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.SimpleLogger;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Window.ClosingEvent;
-import com.google.gwt.user.client.Window.ScrollEvent;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.ArrayList;
-
-/**
- * Simple visual test for checking up on window events with Handlers.
- */
-public class VisualsForWindowEvents extends AbstractIssue implements
- CloseHandler<Window>, Window.ClosingHandler, Window.ScrollHandler,
- ResizeHandler {
- static int numResizes = 0;
- private SimpleLogger messages = new SimpleLogger();
- private ArrayList<HandlerRegistration> registrations = new ArrayList<HandlerRegistration>();
-
- @Override
- public Widget createIssue() {
- FlowPanel out = new FlowPanel();
-
- FlowPanel body = new FlowPanel();
-
- body.setHeight(Window.getClientHeight() * 2 + "px");
- FlowPanel buttons = new FlowPanel();
-
- Button addHandlersButton = new Button("Add window handlers.");
- addHandlersButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent event) {
- setupWindowHandlers();
- }
- });
-
- Button removeHandlersButton = new Button("Remove window handlers.");
- removeHandlersButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent event) {
- removeWindowHandlers();
- }
- });
-
- buttons.add(addHandlersButton);
- buttons.add(removeHandlersButton);
-
- body.add(buttons);
- body.add(messages);
- ScrollPanel p = new ScrollPanel();
- p.setHeight("100%");
- p.setWidth("100%");
- HTML tester = new HTML("scroller");
- tester.setHeight("500px");
- tester.getElement().getStyle().setProperty("border", "10px solid green");
- p.add(tester);
- body.add(p);
-
- out.add(body);
-
- return out;
- }
-
- @Override
- public String getInstructions() {
- return "Click on the button to add all the window handlers. "
- + "Then click the other button to remove them all. "
- + "With handlers enabled, you should get messages for scrolling or "
- + "resizing the window, a \"do you want to navigate away?\" message"
- + "if you're about to navigate away, and an alert when you do navigate"
- + "away or close the window.";
- }
-
- @Override
- public String getSummary() {
- return "window events";
- }
-
- @Override
- public boolean hasCSS() {
- return false;
- }
-
- public void onClose(CloseEvent<Window> event) {
- Window.alert("Closing the window.");
- }
-
- public void onResize(ResizeEvent event) {
- messages.report("Got resize " + numResizes++ + " with values "
- + event.getWidth() + ", " + event.getHeight());
- }
-
- public void onWindowClosing(ClosingEvent event) {
- event.setMessage("Are you sure you want to navigate away?");
- }
-
- public void onWindowScroll(ScrollEvent event) {
- addMessage("Got a window scroll with " + event.getScrollLeft() + ", "
- + event.getScrollTop());
- }
-
- private void addMessage(String msg) {
- messages.report(msg);
- }
-
- private void removeWindowHandlers() {
- for (HandlerRegistration reg : registrations) {
- reg.removeHandler();
- }
- registrations.clear();
- }
-
- private void setupWindowHandlers() {
- if (registrations.size() == 0) {
- registrations.add(Window.addCloseHandler(this));
- registrations.add(Window.addResizeHandler(this));
- registrations.add(Window.addWindowClosingHandler(this));
- registrations.add(Window.addWindowScrollHandler(this));
- }
- }
-}
\ No newline at end of file
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/viewer/Museum.java b/reference/code-museum/src/com/google/gwt/museum/client/viewer/Museum.java
deleted file mode 100644
index c934a9c..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/viewer/Museum.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.google.gwt.museum.client.viewer;
-
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.LinkElement;
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.logical.shared.SelectionEvent;
-import com.google.gwt.event.logical.shared.SelectionHandler;
-import com.google.gwt.museum.client.common.AbstractIssue;
-import com.google.gwt.museum.client.common.Utility;
-import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.IncrementalCommand;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HasVerticalAlignment;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.ImageBundle;
-import com.google.gwt.user.client.ui.ListBox;
-import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.SuggestBox;
-import com.google.gwt.user.client.ui.SuggestOracle;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.SuggestOracle.Suggestion;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-
-/**
- * A repository for demonstrating bugs we once faced.
- */
-public class Museum implements EntryPoint {
- /**
- * Images used in the museum.
- */
- public static interface MuseumImages extends ImageBundle {
- AbstractImagePrototype nextButton();
-
- AbstractImagePrototype prevButton();
- }
-
- /**
- * Class used to implement a callback when a css file is loaded. We add a
- * width style of 10px to isLoaded classes, then test to see if the style is
- * active.
- */
- class Poller implements IncrementalCommand {
- private HTML test;
- private AbstractIssue issue;
- private SimplePanel monitor = new SimplePanel();
-
- public Poller() {
- RootPanel.get().add(monitor);
- }
-
- public boolean execute() {
- if (test.getOffsetWidth() == 10) {
- issueContainer.setWidget(issue.createIssue());
- issue.onAttached();
- return false;
- } else {
- return true;
- }
- }
-
- public void startPolling(AbstractIssue issue) {
- test = new HTML();
- test.setStyleName("isLoaded");
- monitor.setWidget(test);
- this.issue = issue;
- DeferredCommand.addCommand(this);
- }
- }
-
- /**
- * The images used in this application.
- */
- public static final MuseumImages IMAGES = GWT.create(MuseumImages.class);
-
- /**
- * A reference for all issues.
- */
- private final ArrayList<AbstractIssue> issues = new ArrayList<AbstractIssue>();
-
- /**
- * Add an issue to the list of issues.
- */
- private final Poller poller = new Poller();
-
- /**
- * The panel that contains the current example.
- */
- private final SimplePanel issueContainer = new SimplePanel();
-
- /**
- * A container to hold the CSS that will be applied to the issue.
- */
- private LinkElement issueLinkElement = null;
-
- /**
- * A description of the current issue.
- */
- private final HTML issueDescription = new HTML();
-
- /**
- * The list of all issues.
- */
- private final ListBox issueList = new ListBox();
-
- /**
- * Add an issue to the museum. Should be called in the inherited constructor.
- *
- * @param issue the issue to be added
- */
- public void addIssue(AbstractIssue issue) {
- issues.add(issue);
- }
-
- public void onModuleLoad() {
- // Add the options and issue containers to the page
- RootPanel.get().add(createOptionsPanel());
- RootPanel.get().add(issueDescription);
- issueDescription.setStylePrimaryName("museum-issueDescription");
- RootPanel.get().add(issueContainer);
- issueContainer.setStylePrimaryName("museum-issueContainer");
-
- // Default to the first issue
- refreshIssue();
- }
-
- /**
- * Create a suggest box with all current suggestions in it.
- */
- private SuggestBox createIssueFinder() {
- class IssueSuggestion extends MultiWordSuggestOracle.MultiWordSuggestion {
- private AbstractIssue issue;
-
- public IssueSuggestion(AbstractIssue issue) {
- super("", issue.getHeadline());
- this.issue = issue;
- }
-
- public AbstractIssue getIssue() {
- return issue;
- }
- }
-
- SuggestOracle oracle = new SuggestOracle() {
-
- @Override
- public void requestSuggestions(Request request, Callback callback) {
- String ofInterest = (".*" + request.getQuery() + ".*").toLowerCase();
- ArrayList<Suggestion> suggestions = new ArrayList<Suggestion>();
- HashSet<AbstractIssue> s = new HashSet<AbstractIssue>();
- for (AbstractIssue issue : issues) {
- if (issue.getHeadline().toLowerCase().matches(ofInterest)) {
- s.add(issue);
- suggestions.add(new IssueSuggestion(issue));
- }
- }
-
- for (AbstractIssue issue : issues) {
- if (!s.contains(issue) && issue.getInstructions().matches(ofInterest)) {
- suggestions.add(new IssueSuggestion(issue));
- }
- }
- callback.onSuggestionsReady(request, new Response(suggestions));
- }
-
- };
-
- SuggestBox box = new SuggestBox(oracle);
- box.addSelectionHandler(new SelectionHandler<Suggestion>() {
- public void onSelection(SelectionEvent<Suggestion> event) {
- AbstractIssue issue = ((IssueSuggestion) event.getSelectedItem()).getIssue();
- int index = issues.indexOf(issue);
- issueList.setSelectedIndex(index);
- refreshIssue();
- }
- });
- box.setAnimationEnabled(false);
- return box;
- }
-
- /**
- * Create the options panel.
- *
- * @return the options panel
- */
- private Widget createOptionsPanel() {
- // Populate a list box containing all issues
- for (AbstractIssue issue : issues) {
- issueList.addItem(issue.getHeadline());
- }
- issueList.addChangeHandler(new ChangeHandler() {
- public void onChange(ChangeEvent event) {
- refreshIssue();
- }
- });
-
- // Create a button to refresh the current issue
- Button refreshIssueButton = new Button("Refresh", new ClickHandler() {
- public void onClick(ClickEvent event) {
- refreshIssue();
- }
- });
-
- // Create a suggest box to search for issues
- SuggestBox suggestBox = createIssueFinder();
-
- // Create a button to move to the previous issue
- Image prevButton = IMAGES.prevButton().createImage();
- prevButton.setStyleName("prevButton");
- prevButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent event) {
- int selectedIndex = issueList.getSelectedIndex();
- if (selectedIndex > 0) {
- issueList.setSelectedIndex(selectedIndex - 1);
- refreshIssue();
- } else {
- Window.alert("You are already on the first issue");
- }
- }
- });
-
- // Create a button to move to the next issue
- Image nextButton = IMAGES.nextButton().createImage();
- nextButton.setStyleName("nextButton");
- nextButton.addClickHandler(new ClickHandler() {
- public void onClick(ClickEvent event) {
- int selectedIndex = issueList.getSelectedIndex();
- if (selectedIndex < issueList.getItemCount() - 1) {
- issueList.setSelectedIndex(selectedIndex + 1);
- refreshIssue();
- } else {
- Window.alert("You are already on the last issue");
- }
- }
- });
-
- // Combine the list box and text into a panel
- HorizontalPanel hPanel = new HorizontalPanel();
- hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
- hPanel.add(new HTML("Select an issue: "));
- hPanel.add(issueList);
- hPanel.add(prevButton);
- hPanel.add(nextButton);
- hPanel.add(refreshIssueButton);
- hPanel.add(suggestBox);
- SimplePanel wrapper = new SimplePanel();
- wrapper.setStyleName("museum-optionsPanel");
- wrapper.setWidget(hPanel);
- return wrapper;
- }
-
- /**
- * Refresh the current issue in the issue list.
- */
- private void refreshIssue() {
- setIssue(issues.get(issueList.getSelectedIndex()));
- }
-
- /**
- * Set the current issue in the issue container.
- *
- * @param issue the issue to set
- */
- private void setIssue(AbstractIssue issue) {
- if (issueLinkElement != null) {
- Utility.getHeadElement().removeChild(issueLinkElement);
- issueLinkElement = null;
- }
- // Fetch the associated style sheet using an HTTP request
- issueLinkElement = issue.createCSS();
- Utility.getHeadElement().appendChild(issueLinkElement);
- issueDescription.setHTML(issue.getInstructions());
- poller.startPolling(issue);
- }
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/viewer/nextButton.png b/reference/code-museum/src/com/google/gwt/museum/client/viewer/nextButton.png
deleted file mode 100644
index 5a9cdf0..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/viewer/nextButton.png
+++ /dev/null
Binary files differ
diff --git a/reference/code-museum/src/com/google/gwt/museum/client/viewer/prevButton.png b/reference/code-museum/src/com/google/gwt/museum/client/viewer/prevButton.png
deleted file mode 100644
index 289b0d4..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/client/viewer/prevButton.png
+++ /dev/null
Binary files differ
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/Museum.css b/reference/code-museum/src/com/google/gwt/museum/public/Museum.css
deleted file mode 100644
index 2b01c4e..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/Museum.css
+++ /dev/null
@@ -1,77 +0,0 @@
-body {
- padding: 0px;
- margin: 0px;
-}
-
-.isLoaded {
- width: 40px;
- height: 1px;
- visibility: hidden;
- position: absolute;
-}
-
-.museum-optionsPanel {
- background: #D6E9F8;
- border-bottom: 1px solid #aaf;
-}
-
-.museum-optionsPanel td {
- padding: 2px 0px;
- font-size: 10pt;
- font-weight: bold;
-}
-
-.museum-optionsPanel .gwt-ListBox {
- font-size: 9pt;
- color: blue;
- margin: 0px 6px;
-}
-
-.museum-optionsPanel .gwt-Button {
- font-size: 8pt;
- margin: 0px 6px;
-}
-
-.museum-optionsPanel .nextButton, .museum-optionsPanel .prevButton {
- font-weight: normal;
- color: blue;
- margin: 0px 2px;
- cursor: pointer;
-}
-
-.museum-issueDescription {
- margin: 5px;
- border: 1px solid #bbb;
- padding: 8px 3px;
- background: #fafafa;
- font-size: 10pt;
-}
-
-.museum-issueContainer {
- padding: 15px 20px;
-}
-/**
- * Applied to the suggest box.
- */
-.gwt-SuggestBox .topLeft,
-.gwt-SuggestBox .topRight,
-.gwt-SuggestBox .bottomLeft,
-.gwt-SuggestBox .bottomRight {
- display: none;
-}
-
-
-.gwt-SuggestBoxPopup .item {
- padding: 2px 6px;
- color: #424242;
- cursor: default;
-}
-
-.gwt-SuggestBoxPopup .item-selected {
- background: #b7d6f6;
-}
-
-.gwt-SuggestBoxPopup .middleCenter {
- border: 1px solid black;
- background: white;
-}
\ No newline at end of file
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/issues/Default.css b/reference/code-museum/src/com/google/gwt/museum/public/issues/Default.css
deleted file mode 100644
index 15f6d03..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/issues/Default.css
+++ /dev/null
@@ -1,3 +0,0 @@
-@import url("../gwt/standard/standard.css");
-@import url("MasterIssue.css");
-
\ No newline at end of file
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue1169.css b/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue1169.css
deleted file mode 100644
index 4b446c0..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue1169.css
+++ /dev/null
@@ -1,14 +0,0 @@
-@import url("Default.css");
-
-.myMenuBar {
- width: 300px;
-}
-.myMenuBarPopup {
- border: 1px solid red;
-}
-.myMenuBarPopup .menuPopupTopLeft,
-.myMenuBarPopup .menuPopupTopRight,
-.myMenuBarPopup .menuPopupBottomLeft,
-.myMenuBarPopup .menuPopupBottomRight {
- display: none;
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue1897.css b/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue1897.css
deleted file mode 100644
index d31765f..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue1897.css
+++ /dev/null
@@ -1,5 +0,0 @@
-@import url("MasterIssue.css");
-
-.gwt-RichTextArea {
- border: 1px solid black;
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue1932.css b/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue1932.css
deleted file mode 100644
index 8766cd9..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue1932.css
+++ /dev/null
@@ -1,6 +0,0 @@
-@import url("MasterIssue.css");
-
-HTML {
- margin: 10px;
- border: 5px solid #DDDDDD;
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue2290.css b/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue2290.css
deleted file mode 100644
index 3df1ea4..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue2290.css
+++ /dev/null
@@ -1,9 +0,0 @@
-@import url("MasterIssue.css");
-
-.gwt-TreeItem {
- background-color: green;
-}
-
-.gwt-TreeItem-selected {
- background-color: red;
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue2392.css b/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue2392.css
deleted file mode 100644
index 9cd2582..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue2392.css
+++ /dev/null
@@ -1,16 +0,0 @@
-@import url("MasterIssue.css");
-
-/* Outside of the popup */
-.gwt-SuggestBoxPopup {
- border: 1px solid red;
-}
-
-/* The cell containing the suggestions */
-.gwt-SuggestBoxPopup .suggestPopupMiddleCenter {
- border: 1px solid blue;
-}
-
-/* The div containing the suggests */
-.gwt-SuggestBoxPopup .suggestPopupContent {
- border: 1px solid green;
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue2443.css b/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue2443.css
deleted file mode 100644
index fd19a37..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/issues/Issue2443.css
+++ /dev/null
@@ -1,5 +0,0 @@
-@import url("Default.css");
-
-iframe {
- border: 2px solid black;
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/issues/MasterIssue.css b/reference/code-museum/src/com/google/gwt/museum/public/issues/MasterIssue.css
deleted file mode 100644
index 5b91db1..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/issues/MasterIssue.css
+++ /dev/null
@@ -1,4 +0,0 @@
-
-.isLoaded {
- width: 10px;
-}
diff --git a/reference/code-museum/src/com/google/gwt/museum/public/issues/images/gwtLogo.png b/reference/code-museum/src/com/google/gwt/museum/public/issues/images/gwtLogo.png
deleted file mode 100644
index e0fb4f1..0000000
--- a/reference/code-museum/src/com/google/gwt/museum/public/issues/images/gwtLogo.png
+++ /dev/null
Binary files differ