Deleted HasPages, HasValueMap, and ValueListBox since they are not being used.
Review at http://gwt-code-reviews.appspot.com/619802
Review by: rjrjr@google.com
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@8264 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/bikeshed/src/com/google/gwt/user/client/ui/HasPages.java b/bikeshed/src/com/google/gwt/user/client/ui/HasPages.java
deleted file mode 100644
index 191b34c..0000000
--- a/bikeshed/src/com/google/gwt/user/client/ui/HasPages.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2010 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.user.client.ui;
-
-import com.google.gwt.event.shared.HandlerRegistration;
-
-/**
- * Implemented by objects that can be paged through.
- * <p>
- * Note that there are no listeners for the numberOfPages property,
- * as that is not expected to be set by the user.
- */
-public interface HasPages {
- HandlerRegistration addPageChangeHandler(/* PageChangeHandler handler */);
-
- HandlerRegistration addPageSizeChangeHandler(/* PageSizeChangeHandler handler */);
-
- int getCurrentPage();
-
- int getNumberOfPages();
-
- int getPageSize();
-
- void setCurrentPage(int page);
-
- void setNumberOfPages();
-
- void setPageSize(int size);
-}
diff --git a/bikeshed/src/com/google/gwt/user/client/ui/HasValueMap.java b/bikeshed/src/com/google/gwt/user/client/ui/HasValueMap.java
deleted file mode 100644
index e33f796..0000000
--- a/bikeshed/src/com/google/gwt/user/client/ui/HasValueMap.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2010 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.user.client.ui;
-
-import java.util.Map;
-
-/**
- * Implemented by widgets that let the user pick from a set
- * of values.
- *
- * @param <T> the value type
- */
-public interface HasValueMap<T> {
- /**
- * @param values A map of acceptable values and their display strings
- */
- void setValues(Map<? extends T, String> values);
-}
diff --git a/bikeshed/src/com/google/gwt/user/client/ui/ValueListBox.java b/bikeshed/src/com/google/gwt/user/client/ui/ValueListBox.java
deleted file mode 100644
index 54cec5f..0000000
--- a/bikeshed/src/com/google/gwt/user/client/ui/ValueListBox.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2010 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.user.client.ui;
-
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.logical.shared.ValueChangeEvent;
-import com.google.gwt.event.logical.shared.ValueChangeHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A {@link HasValue} variation on {@link ListBox}.
- *
- * @param <T> the value type
- */
-public class ValueListBox<T> extends Composite implements HasValue<T>,
- HasValueMap<T> {
-
- private ArrayList<T> indexToValue = new ArrayList<T>();
- private Map<T, Integer> valueToIndex = new HashMap<T, Integer>();
-
- public ValueListBox() {
- initWidget(new ListBox(false));
- }
-
- public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler) {
- return addHandler(handler, ValueChangeEvent.getType());
- }
-
- public T getValue() {
- int selectedIndex = getListBox().getSelectedIndex();
- if (selectedIndex > -1) {
- return indexToValue.get(selectedIndex);
- }
-
- return null;
- }
-
- public void setValue(T value) {
- setValue(value, false);
- }
-
- /**
- * Set the value, or clear it if the given value is not in the value map.
- */
- public void setValue(T value, boolean fireEvents) {
- T oldValue = getValue();
- ListBox listBox = getListBox();
- Integer index = valueToIndex.get(value);
- if (index == null) {
- listBox.setSelectedIndex(-1);
- } else {
- listBox.setSelectedIndex(index);
- }
- if (fireEvents) {
- ValueChangeEvent.fireIfNotEqual(this, oldValue, value);
- }
- }
-
- public void setValues(Map<? extends T, String> values) {
- ListBox listBox = getListBox();
-
- indexToValue.clear();
- valueToIndex.clear();
- listBox.clear();
- int i = 0;
- for (T key : values.keySet()) {
- indexToValue.add(key);
- valueToIndex.put(key, i++);
- listBox.addItem(values.get(key));
- }
- }
-
- public void setVisibleItemCount(int size) {
- getListBox().setVisibleItemCount(size);
- }
-
- @Override
- protected void initWidget(Widget widget) {
- super.initWidget(widget);
- getListBox().addChangeHandler(new ChangeHandler() {
- public void onChange(ChangeEvent event) {
- ValueChangeEvent.fire(ValueListBox.this, getValue());
- }
- });
- }
-
- /**
- * @return
- */
- private ListBox getListBox() {
- return (ListBox) getWidget();
- }
-}