svn changeset:8588/svn branch:6.1tags/6.7.0.beta1
@@ -10,13 +10,19 @@ import java.util.Date; | |||
import java.util.Iterator; | |||
import java.util.List; | |||
import com.google.gwt.event.dom.client.BlurEvent; | |||
import com.google.gwt.event.dom.client.BlurHandler; | |||
import com.google.gwt.event.dom.client.ClickEvent; | |||
import com.google.gwt.event.dom.client.ClickHandler; | |||
import com.google.gwt.event.dom.client.FocusEvent; | |||
import com.google.gwt.event.dom.client.FocusHandler; | |||
import com.google.gwt.event.dom.client.KeyCodes; | |||
import com.google.gwt.event.dom.client.KeyDownEvent; | |||
import com.google.gwt.event.dom.client.KeyDownHandler; | |||
import com.google.gwt.event.dom.client.KeyUpEvent; | |||
import com.google.gwt.event.dom.client.KeyUpHandler; | |||
import com.google.gwt.event.dom.client.LoadEvent; | |||
import com.google.gwt.event.dom.client.LoadHandler; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
@@ -24,14 +30,11 @@ import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.ui.Composite; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.google.gwt.user.client.ui.FocusListener; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.Image; | |||
import com.google.gwt.user.client.ui.LoadListener; | |||
import com.google.gwt.user.client.ui.PopupListener; | |||
import com.google.gwt.user.client.ui.PopupPanel; | |||
import com.google.gwt.user.client.ui.TextBox; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.google.gwt.user.client.ui.PopupPanel.PositionCallback; | |||
import com.google.gwt.user.client.ui.SuggestOracle.Suggestion; | |||
import com.vaadin.terminal.gwt.client.ApplicationConnection; | |||
@@ -47,7 +50,8 @@ import com.vaadin.terminal.gwt.client.VTooltip; | |||
* TODO needs major refactoring (to be extensible etc) | |||
*/ | |||
public class VFilterSelect extends Composite implements Paintable, Field, | |||
KeyDownHandler, KeyUpHandler, ClickHandler, FocusListener, Focusable { | |||
KeyDownHandler, KeyUpHandler, ClickHandler, FocusHandler, BlurHandler, | |||
Focusable { | |||
public class FilterSelectSuggestion implements Suggestion, Command { | |||
@@ -589,11 +593,8 @@ public class VFilterSelect extends Composite implements Paintable, Field, | |||
public VFilterSelect() { | |||
selectedItemIcon.setStyleName("v-icon"); | |||
selectedItemIcon.addLoadListener(new LoadListener() { | |||
public void onError(Widget sender) { | |||
} | |||
public void onLoad(Widget sender) { | |||
selectedItemIcon.addLoadHandler(new LoadHandler() { | |||
public void onLoad(LoadEvent event) { | |||
updateRootWidth(); | |||
updateSelectedIconPosition(); | |||
} | |||
@@ -607,7 +608,8 @@ public class VFilterSelect extends Composite implements Paintable, Field, | |||
tb.addKeyDownHandler(this); | |||
tb.addKeyUpHandler(this); | |||
tb.setStyleName(CLASSNAME + "-input"); | |||
tb.addFocusListener(this); | |||
tb.addFocusHandler(this); | |||
tb.addBlurHandler(this); | |||
popupOpener.setStyleName(CLASSNAME + "-button"); | |||
popupOpener.addClickHandler(this); | |||
} | |||
@@ -987,7 +989,7 @@ public class VFilterSelect extends Composite implements Paintable, Field, | |||
return w; | |||
}-*/; | |||
public void onFocus(Widget sender) { | |||
public void onFocus(FocusEvent event) { | |||
focused = true; | |||
if (prompting) { | |||
setPromptingOff(""); | |||
@@ -995,7 +997,7 @@ public class VFilterSelect extends Composite implements Paintable, Field, | |||
addStyleDependentName("focus"); | |||
} | |||
public void onLostFocus(Widget sender) { | |||
public void onBlur(BlurEvent event) { | |||
focused = false; | |||
if (!suggestionPopup.isAttached() || suggestionPopup.isJustClosed()) { | |||
// typing so fast the popup was never opened, or it's just closed |
@@ -10,7 +10,7 @@ import java.util.Map; | |||
import com.google.gwt.event.dom.client.ClickEvent; | |||
import com.google.gwt.user.client.ui.CheckBox; | |||
import com.google.gwt.user.client.ui.HasFocus; | |||
import com.google.gwt.user.client.ui.Focusable; | |||
import com.google.gwt.user.client.ui.Panel; | |||
import com.google.gwt.user.client.ui.RadioButton; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -96,7 +96,7 @@ public class VOptionGroup extends VOptionGroupBase { | |||
public void focus() { | |||
Iterator<Widget> iterator = panel.iterator(); | |||
if (iterator.hasNext()) { | |||
((HasFocus) iterator.next()).setFocus(true); | |||
((Focusable) iterator.next()).setFocus(true); | |||
} | |||
} | |||
@@ -8,8 +8,8 @@ import com.google.gwt.event.dom.client.ClickHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.Focusable; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.HasFocus; | |||
import com.google.gwt.user.client.ui.Label; | |||
import com.google.gwt.user.client.ui.PopupListener; | |||
import com.google.gwt.user.client.ui.PopupPanel; | |||
@@ -268,8 +268,8 @@ public class VPopupView extends HTML implements Container { | |||
*/ | |||
public void syncChildren() { | |||
// Notify children with focus | |||
if ((popupComponentWidget instanceof HasFocus)) { | |||
((HasFocus) popupComponentWidget).setFocus(false); | |||
if ((popupComponentWidget instanceof Focusable)) { | |||
((Focusable) popupComponentWidget).setFocus(false); | |||
} | |||
// Notify children that have used the keyboard |
@@ -1,14 +1,17 @@ | |||
/* | |||
/* | |||
@ITMillApache2LicenseForJavaFiles@ | |||
*/ | |||
package com.vaadin.terminal.gwt.client.ui; | |||
import com.google.gwt.event.dom.client.BlurEvent; | |||
import com.google.gwt.event.dom.client.BlurHandler; | |||
import com.google.gwt.event.dom.client.FocusEvent; | |||
import com.google.gwt.event.dom.client.FocusHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.ChangeListener; | |||
import com.google.gwt.user.client.ui.FocusListener; | |||
import com.google.gwt.user.client.ui.TextBoxBase; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.terminal.gwt.client.ApplicationConnection; | |||
@@ -20,12 +23,12 @@ import com.vaadin.terminal.gwt.client.VTooltip; | |||
/** | |||
* This class represents a basic text input field with one row. | |||
* | |||
* | |||
* @author IT Mill Ltd. | |||
* | |||
* | |||
*/ | |||
public class VTextField extends TextBoxBase implements Paintable, Field, | |||
ChangeListener, FocusListener { | |||
ChangeListener, FocusHandler, BlurHandler { | |||
/** | |||
* The input node CSS classname. | |||
@@ -65,7 +68,8 @@ public class VTextField extends TextBoxBase implements Paintable, Field, | |||
} | |||
setStyleName(CLASSNAME); | |||
addChangeListener(this); | |||
addFocusListener(this); | |||
addFocusHandler(this); | |||
addBlurHandler(this); | |||
sinkEvents(VTooltip.TOOLTIP_EVENTS); | |||
} | |||
@@ -158,7 +162,7 @@ public class VTextField extends TextBoxBase implements Paintable, Field, | |||
} | |||
} | |||
public void onFocus(Widget sender) { | |||
public void onFocus(FocusEvent event) { | |||
addStyleDependentName(CLASSNAME_FOCUS); | |||
if (prompting) { | |||
setText(""); | |||
@@ -167,7 +171,7 @@ public class VTextField extends TextBoxBase implements Paintable, Field, | |||
focusedTextField = this; | |||
} | |||
public void onLostFocus(Widget sender) { | |||
public void onBlur(BlurEvent event) { | |||
removeStyleDependentName(CLASSNAME_FOCUS); | |||
focusedTextField = null; | |||
String text = getText(); | |||
@@ -176,7 +180,7 @@ public class VTextField extends TextBoxBase implements Paintable, Field, | |||
setText(inputPrompt); | |||
addStyleDependentName(CLASSNAME_PROMPT); | |||
} | |||
onChange(sender); | |||
onChange((Widget) event.getSource()); | |||
} | |||
private void setPrompting(boolean prompting) { |
@@ -1,4 +1,4 @@ | |||
/* | |||
/* | |||
@ITMillApache2LicenseForJavaFiles@ | |||
*/ | |||
@@ -21,7 +21,6 @@ import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.WindowCloseListener; | |||
import com.google.gwt.user.client.WindowResizeListener; | |||
import com.google.gwt.user.client.ui.HasFocus; | |||
import com.google.gwt.user.client.ui.RootPanel; | |||
import com.google.gwt.user.client.ui.SimplePanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -35,7 +34,7 @@ import com.vaadin.terminal.gwt.client.UIDL; | |||
import com.vaadin.terminal.gwt.client.Util; | |||
/** | |||
* | |||
* | |||
*/ | |||
public class VView extends SimplePanel implements Container, | |||
WindowResizeListener, WindowCloseListener { | |||
@@ -128,7 +127,7 @@ public class VView extends SimplePanel implements Container, | |||
try { | |||
el.focus(); | |||
} catch (e) { | |||
} | |||
}-*/; | |||
@@ -141,7 +140,7 @@ public class VView extends SimplePanel implements Container, | |||
*/ | |||
private static native void reloadHostPage() | |||
/*-{ | |||
$wnd.location.reload(); | |||
$wnd.location.reload(); | |||
}-*/; | |||
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { | |||
@@ -317,8 +316,8 @@ public class VView extends SimplePanel implements Container, | |||
* GWT HasFocus of a thinner Vaadin specific Focusable | |||
* interface. | |||
*/ | |||
if (toBeFocused instanceof HasFocus) { | |||
final HasFocus toBeFocusedWidget = (HasFocus) toBeFocused; | |||
if (toBeFocused instanceof com.google.gwt.user.client.ui.Focusable) { | |||
final com.google.gwt.user.client.ui.Focusable toBeFocusedWidget = (com.google.gwt.user.client.ui.Focusable) toBeFocused; | |||
toBeFocusedWidget.setFocus(true); | |||
} else if (toBeFocused instanceof Focusable) { | |||
((Focusable) toBeFocused).focus(); | |||
@@ -603,7 +602,7 @@ public class VView extends SimplePanel implements Container, | |||
/** | |||
* Return an iterator for current subwindows. This method is meant for | |||
* testing purposes only. | |||
* | |||
* | |||
* @return | |||
*/ | |||
public ArrayList<VWindow> getSubWindowList() { |
@@ -1,9 +1,11 @@ | |||
/* | |||
/* | |||
@ITMillApache2LicenseForJavaFiles@ | |||
*/ | |||
package com.vaadin.terminal.gwt.client.ui.richtextarea; | |||
import com.google.gwt.event.dom.client.BlurEvent; | |||
import com.google.gwt.event.dom.client.BlurHandler; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.DeferredCommand; | |||
@@ -11,7 +13,6 @@ import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.ChangeListener; | |||
import com.google.gwt.user.client.ui.Composite; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.google.gwt.user.client.ui.FocusListener; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.KeyboardListener; | |||
import com.google.gwt.user.client.ui.RichTextArea; | |||
@@ -25,12 +26,12 @@ import com.vaadin.terminal.gwt.client.ui.Field; | |||
/** | |||
* This class implements a basic client side rich text editor component. | |||
* | |||
* | |||
* @author IT Mill Ltd. | |||
* | |||
* | |||
*/ | |||
public class VRichTextArea extends Composite implements Paintable, Field, | |||
ChangeListener, FocusListener, KeyboardListener { | |||
ChangeListener, BlurHandler, KeyboardListener { | |||
/** | |||
* The input node CSS classname. | |||
@@ -64,7 +65,7 @@ public class VRichTextArea extends Composite implements Paintable, Field, | |||
fp.add(formatter); | |||
rta.setWidth("100%"); | |||
rta.addFocusListener(this); | |||
rta.addBlurHandler(this); | |||
fp.add(rta); | |||
@@ -131,11 +132,7 @@ public class VRichTextArea extends Composite implements Paintable, Field, | |||
} | |||
} | |||
public void onFocus(Widget sender) { | |||
} | |||
public void onLostFocus(Widget sender) { | |||
public void onBlur(BlurEvent event) { | |||
final String html = rta.getHTML(); | |||
client.updateVariable(id, "text", html, immediate); | |||