Revision: 8264
Author: amitman...@google.com
Date: Wed Jun 16 08:40:15 2010
Log: Deleted HasPages, HasValueMap, and ValueListBox since they are not being used.

Review at http://gwt-code-reviews.appspot.com/619802

Review by: rj...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=8264

Deleted:
 /trunk/bikeshed/src/com/google/gwt/user/client/ui/HasPages.java
 /trunk/bikeshed/src/com/google/gwt/user/client/ui/HasValueMap.java
 /trunk/bikeshed/src/com/google/gwt/user/client/ui/ValueListBox.java

=======================================
--- /trunk/bikeshed/src/com/google/gwt/user/client/ui/HasPages.java Fri Apr 9 11:25:51 2010
+++ /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);
-}
=======================================
--- /trunk/bikeshed/src/com/google/gwt/user/client/ui/HasValueMap.java Fri Apr 9 11:25:51 2010
+++ /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);
-}
=======================================
--- /trunk/bikeshed/src/com/google/gwt/user/client/ui/ValueListBox.java Fri May 28 04:09:54 2010
+++ /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();
-  }
-}

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to