Reviewers: ,

Description:
Introduce an interface for widgets that has a setEnabled method.


Please review this at http://gwt-code-reviews.appspot.com/757801/show

Affected files:
  user/src/com/google/gwt/user/client/ui/FocusWidget.java
  user/src/com/google/gwt/user/client/ui/HasEnabled.java


Index: user/src/com/google/gwt/user/client/ui/FocusWidget.java
===================================================================
--- user/src/com/google/gwt/user/client/ui/FocusWidget.java     (revision 8519)
+++ user/src/com/google/gwt/user/client/ui/FocusWidget.java     (working copy)
@@ -53,7 +53,7 @@
  */
 @SuppressWarnings("deprecation")
public abstract class FocusWidget extends Widget implements SourcesClickEvents,
-    HasClickHandlers, HasFocus, HasAllFocusHandlers, HasAllKeyHandlers,
+ HasClickHandlers, HasFocus, HasEnabled, HasAllFocusHandlers, HasAllKeyHandlers,
     HasAllMouseHandlers, SourcesMouseEvents {

   private static final FocusImpl impl = FocusImpl.getFocusImplForWidget();
Index: user/src/com/google/gwt/user/client/ui/HasEnabled.java
===================================================================
--- user/src/com/google/gwt/user/client/ui/HasEnabled.java      (revision 0)
+++ user/src/com/google/gwt/user/client/ui/HasEnabled.java      (revision 0)
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+/**
+ * A widget that implements this interface can be put in an "enabled"
+ * or "disabled" state.
+ */
+public interface HasEnabled {
+
+  /**
+   * Sets whether this widget is enabled.
+   *
+ * @param enabled <code>true</code> to enable the widget, <code>false</code>
+   *          to disable it
+   */
+  void setEnabled(boolean enabled);
+}


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

Reply via email to