• <small id='cvXOp'></small><noframes id='cvXOp'>

  • <i id='cvXOp'><tr id='cvXOp'><dt id='cvXOp'><q id='cvXOp'><span id='cvXOp'><b id='cvXOp'><form id='cvXOp'><ins id='cvXOp'></ins><ul id='cvXOp'></ul><sub id='cvXOp'></sub></form><legend id='cvXOp'></legend><bdo id='cvXOp'><pre id='cvXOp'><center id='cvXOp'></center></pre></bdo></b><th id='cvXOp'></th></span></q></dt></tr></i><div id='cvXOp'><tfoot id='cvXOp'></tfoot><dl id='cvXOp'><fieldset id='cvXOp'></fieldset></dl></div>
    • <bdo id='cvXOp'></bdo><ul id='cvXOp'></ul>

    <tfoot id='cvXOp'></tfoot>
    <legend id='cvXOp'><style id='cvXOp'><dir id='cvXOp'><q id='cvXOp'></q></dir></style></legend>

        自定义 gxt Cell 可能需要 Widget

        时间:2024-08-24
      1. <legend id='XBdFv'><style id='XBdFv'><dir id='XBdFv'><q id='XBdFv'></q></dir></style></legend>

              <bdo id='XBdFv'></bdo><ul id='XBdFv'></ul>

                <tfoot id='XBdFv'></tfoot>

                  <tbody id='XBdFv'></tbody>

                <small id='XBdFv'></small><noframes id='XBdFv'>

              1. <i id='XBdFv'><tr id='XBdFv'><dt id='XBdFv'><q id='XBdFv'><span id='XBdFv'><b id='XBdFv'><form id='XBdFv'><ins id='XBdFv'></ins><ul id='XBdFv'></ul><sub id='XBdFv'></sub></form><legend id='XBdFv'></legend><bdo id='XBdFv'><pre id='XBdFv'><center id='XBdFv'></center></pre></bdo></b><th id='XBdFv'></th></span></q></dt></tr></i><div id='XBdFv'><tfoot id='XBdFv'></tfoot><dl id='XBdFv'><fieldset id='XBdFv'></fieldset></dl></div>
                  本文介绍了自定义 gxt Cell 可能需要 Widget的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要一个可以在其中放置小部件的列.我有这个:

                  I need a Column in which it was possible to put a Widget. I have this:

                  import com.google.gwt.cell.client.AbstractCell;
                  import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
                  import com.google.gwt.user.client.ui.Widget;
                  
                  public class WidgetGridCell extends AbstractCell<Widget> {
                  
                      Widget widget;
                  
                      public WidgetGridCell(Widget widget) {
                          this.widget = widget;
                      }
                  
                      @Override
                      public void render(Context paramContext,
                              Widget param, SafeHtmlBuilder pb) {
                  
                      }
                  }
                  

                  但我不知道如何在 HTML 中包含小部件

                  But I do not know how to include the widget in HTML

                  附:或者不是 Widget,只有 GWT Button 适合我.

                  P.S. Or not Widget, only GWT Button will suit me.

                  推荐答案

                  参见这里 了解 AbstractCell 实现的一些示例.

                  See here for a number of examples of AbstractCell implementations.

                  要回答有关 GWT 按钮的问题:

                  To answer your question regarding a GWT button:

                  import com.google.gwt.cell.client.AbstractCell;
                  import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
                  import com.google.gwt.user.client.ui.Widget;
                  
                  public class WidgetGridCell extends AbstractCell<Widget> {
                  
                    Widget widget;
                  
                    public WidgetGridCell(Widget widget) {
                        this.widget = widget;
                    }
                  
                    @Override
                    public void render(Context paramContext,
                            Widget param, SafeHtmlBuilder pb) {
                      Button aButton = new Button();
                      // add text to the button, etc...
                      pb.append(SafeHtmlUtils.fromTrustedString(aButton.toString()));
                    }
                  }
                  

                  尝试在单元格元素中渲染整个小部件在很大程度上是不可行的(也不可取),但听起来好像您真的在尝试从单元格中渲染按钮.

                  It's largely not feasible (and not advisable) to try and render an entire widget within a cell element but it sounds as though you are really trying to render a button from within the cell.

                  AbstractCell 是 Cell 接口的一个实现,它允许您定义要在单元格中呈现的 HTML.如果您需要一个可以响应事件的按钮,则需要定义自定义单元格来处理浏览器事件(例如单击事件).Google 在其关于自定义单元格的文档中做得很好,解释了如何去做.

                  AbstractCell is an implementation of the Cell interface which allows you to define the HTML to render within the cell. If you need a button which can respond to events you'll need to define your custom cell to handle browser events (such as the click event). Google does a good job in their documentation on custom cells explaining how you can go about doing that.

                  查看此链接:http://www.gwtproject.org/doc/latest/DevGuideUiCustomCells.html

                  这篇关于自定义 gxt Cell 可能需要 Widget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Java hashCode 不适用于 HashMap? 下一篇:创建一个多彩多姿的板

                  相关文章

                • <tfoot id='ijisr'></tfoot>
                    <bdo id='ijisr'></bdo><ul id='ijisr'></ul>
                  <legend id='ijisr'><style id='ijisr'><dir id='ijisr'><q id='ijisr'></q></dir></style></legend>

                • <small id='ijisr'></small><noframes id='ijisr'>

                  1. <i id='ijisr'><tr id='ijisr'><dt id='ijisr'><q id='ijisr'><span id='ijisr'><b id='ijisr'><form id='ijisr'><ins id='ijisr'></ins><ul id='ijisr'></ul><sub id='ijisr'></sub></form><legend id='ijisr'></legend><bdo id='ijisr'><pre id='ijisr'><center id='ijisr'></center></pre></bdo></b><th id='ijisr'></th></span></q></dt></tr></i><div id='ijisr'><tfoot id='ijisr'></tfoot><dl id='ijisr'><fieldset id='ijisr'></fieldset></dl></div>