代码之家  ›  专栏  ›  技术社区  ›  kirtcathey

GWT,GXT HtmlEditor,关键事件

  •  0
  • kirtcathey  · 技术社区  · 14 年前

    无论我尝试什么,当我添加 公共无效handleEvent(FieldEvent e){ } });

        addKeyListener(new KeyListener() {
            public void componentKeyDown(ComponentEvent event) {
                changed = true;
            }
        });
    

    没有记录。。。未捕获事件。有人知道怎么做吗?

    谢谢您。 短裙

    1 回复  |  直到 14 年前
        1
  •  0
  •   z00bs    14 年前

    目前你必须延长 HtmlEditor 覆盖 onEditorKeyDown() .

    class ExtendedHtmlEditor extends HtmlEditor {
    
        public ExtendedHtmlEditor() {
            super();
        }
    
        @Override
        protected void onEditorKeyDown(KeyDownEvent e) {
            super.onEditorKeyDown(e);
            Window.alert("w000t");
        }
    
    }
    

    另见 here .