View Javadoc

1   /*
2    * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.gwtwidgets.client.temp;
18  
19  import com.google.gwt.user.client.DOM;
20  import com.google.gwt.user.client.Element;
21  import com.google.gwt.user.client.ui.Grid;
22  
23  /***
24   * An extension of Grid that does not put an &nbsp;
25   * inside a cell when it is cleared.  This is a temporary
26   * fix until this same fix is made in the GWT Grid
27   * component, or may become a permanant addition to
28   * the GWT-WL if this change is not made in the Grid.
29   * 
30   * @author rhanson
31   */
32  public class TGrid extends Grid
33  {
34  
35      public TGrid (int width, int height)
36      {
37          super(width, height);
38      }
39  
40      /***
41       * Completely clear cell, does not leave an &nbsp;
42       */
43      public boolean clearCell (int row, int column)
44      {
45          boolean result = super.clearCell(row, column);
46          Element td = getCellFormatter().getElement(row, column);
47          DOM.setInnerHTML(td, "");
48          return result;
49      }
50  
51  }