1 // Copyright (C) 2012-2013 Yozons, Inc. 2 // CKEditor for Vaadin - Fix for broken VWindow implementation as it relates to modal windows 3 // containing CKEditor that then opens its own modal dialogs that no longer work. 4 // 5 // Based on code provided by Tien Tran on 6/20/2012 in the Vaadin forums: 6 // https://vaadin.com/forum/-/message_boards/view_message/1515632 7 // 8 // This software is released under the Apache License 2.0 <http://www.apache.org/licenses/LICENSE-2.0.html> 9 // 10 package org.vaadin.openesignforms.ckeditor.widgetset.client.ui; 11 12 import com.google.gwt.user.client.Event; 13 import com.vaadin.client.ui.VWindow; 14 15 /** 16 * <p> 17 * A placement of VWindow implementation to fix issue with CKEditor component in a modal window. 18 * 19 * Setup your own widgetset and have this somewhere in the module.xml: 20 * <code> 21 * <replace-with class="org.vaadin.openesignforms.ckeditor.widgetset.client.ui.ModalFixVWindow"> 22 * <when-type-is class="com.vaadin.client.ui.VWindow"/> 23 * </replace-with> 24 * </code> 25 * </p> 26 * 27 * @see http://code.google.com/p/vaadin-ckeditor/issues/detail?id=10 28 * @see https://vaadin.com/forum/-/message_boards/view_message/238571 29 * @author ttran, Yozons 30 */ 31 public class ModalFixVWindow extends VWindow { 32 33 @Override 34 public boolean onEventPreview(final Event event) 35 { 36 if (vaadinModality) 37 return true; // why would they block click to other elements? 38 return super.onEventPreview(event); 39 } 40 }