List of usage examples for com.google.gwt.user.client Event getEventsSunk
public static int getEventsSunk(Element elem)
From source file:com.dianaui.universal.core.client.ui.CheckBox.java
License:Apache License
@Override public void sinkEvents(final int eventBitsToAdd) { if (isOrWasAttached()) { Event.sinkEvents(inputElem, eventBitsToAdd | Event.getEventsSunk(inputElem)); } else {// w w w . j a va 2 s .c o m super.sinkEvents(eventBitsToAdd); } }
From source file:com.dianaui.universal.core.client.ui.CheckBoxButton.java
License:Apache License
@Override public void sinkEvents(int eventBitsToAdd) { // Sink on the actual element because that's what gets clicked if (isOrWasAttached()) { Event.sinkEvents(getElement(), eventBitsToAdd | Event.getEventsSunk(getElement())); } else {//from w ww.j a v a 2s .c om super.sinkEvents(eventBitsToAdd); } }
From source file:com.dianaui.universal.core.client.ui.Radio.java
License:Apache License
@Override public void sinkEvents(int eventBitsToAdd) { // Like CheckBox, we want to hear about inputElem. We // also want to know what's going on with the label, to // make sure onBrowserEvent is able to record value changes // initiated by label events if (isOrWasAttached()) { Event.sinkEvents(inputElem, eventBitsToAdd | Event.getEventsSunk(inputElem)); if (labelElem != null) Event.sinkEvents(labelElem, eventBitsToAdd | Event.getEventsSunk(labelElem)); } else {//from ww w . ja v a 2 s .co m super.sinkEvents(eventBitsToAdd); } }
From source file:com.extjs.gxt.ui.client.widget.form.Radio.java
License:sencha.com license
private void replaceInputElement(Element elem) { InputElement newInputElem = InputElement.as(elem); int tabIndex = getTabIndex(); boolean checked = getValue(); boolean enabled = isEnabled(); String uid = input.getId();/*from w w w . j a va 2 s. c o m*/ String accessKey = InputElement.as(input.dom).getAccessKey(); int sunkEvents = Event.getEventsSunk(input.dom); String styleName = input.getStyleName(); String valueAttribute = getValueAttribute(); getElement().replaceChild(newInputElem, input.dom); Event.sinkEvents(elem, 0); input = new El((Element) Element.as(newInputElem)); input.makePositionable(); Event.sinkEvents(input.dom, sunkEvents); input.setId(uid); if (!"".equals(accessKey)) { InputElement.as(input.dom).setAccessKey(accessKey); } setTabIndex(tabIndex); setValueAttribute(valueAttribute); setValue(checked); setEnabled(enabled); input.setStyleName(styleName); }
From source file:com.github.gwtbootstrap.client.ui.CheckBox.java
License:Apache License
@Override public void sinkEvents(int eventBitsToAdd) { if (isOrWasAttached()) { Event.sinkEvents(inputElem, eventBitsToAdd | Event.getEventsSunk(inputElem)); } else {/* ww w . jav a2s . c om*/ super.sinkEvents(eventBitsToAdd); } }
From source file:com.github.gwtbootstrap.client.ui.CheckBox.java
License:Apache License
/** * Replace the current input element with a new one. Preserves all state * except for the name property, for nasty reasons related to radio button * grouping. (See implementation of {@link RadioButton#setName}.) * /*from w w w .j a v a 2 s . c om*/ * @param elem * the new input element */ protected void replaceInputElement(Element elem) { InputElement newInputElem = InputElement.as(elem); // Collect information we need to set int tabIndex = getTabIndex(); boolean checked = getValue(); boolean enabled = isEnabled(); String formValue = getFormValue(); String uid = inputElem.getId(); String accessKey = inputElem.getAccessKey(); int sunkEvents = Event.getEventsSunk(inputElem); // Clear out the old input element setEventListener(asOld(inputElem), null); getElement().replaceChild(newInputElem, inputElem); // Sink events on the new element Event.sinkEvents(elem, Event.getEventsSunk(inputElem)); Event.sinkEvents(inputElem, 0); inputElem = newInputElem; // Setup the new element Event.sinkEvents(inputElem, sunkEvents); inputElem.setId(uid); if (!"".equals(accessKey)) { inputElem.setAccessKey(accessKey); } setTabIndex(tabIndex); setValue(checked); setEnabled(enabled); setFormValue(formValue); // Set the event listener if (isAttached()) { setEventListener(asOld(inputElem), this); } }
From source file:com.googlecode.mgwt.ui.client.widget.input.radio.MRadioButton.java
License:Apache License
private void replaceInputElement(Element elem) { InputElement newInputElem = InputElement.as(elem); // Collect information we need to set boolean checked = getValue(); boolean enabled = isEnabled(); String formValue = getFormValue(); String uid = inputRadio.getId(); String accessKey = inputRadio.getAccessKey(); int sunkEvents = Event.getEventsSunk(inputRadio); // Clear out the old input element DOM.setEventListener(inputRadio, null); getElement().replaceChild(newInputElem, inputRadio); // Sink events on the new element Event.sinkEvents(elem, Event.getEventsSunk(inputRadio)); Event.sinkEvents(inputRadio, 0); inputRadio = newInputElem;//from w ww. jav a 2 s. c om // Setup the new element Event.sinkEvents(inputRadio, sunkEvents); inputRadio.setId(uid); if (!"".equals(accessKey)) { inputRadio.setAccessKey(accessKey); } setValue(checked); setEnabled(enabled); setFormValue(formValue); // Set the event listener if (isAttached()) { DOM.setEventListener(inputRadio, this); } }
From source file:com.googlecode.mgwt.ui.client.widget.MRadioButton.java
License:Apache License
private void replaceInputElement(com.google.gwt.user.client.Element elem) { InputElement newInputElem = InputElement.as(elem); // Collect information we need to set boolean checked = getValue(); boolean enabled = isEnabled(); String formValue = getFormValue(); String uid = inputRadio.getId(); String accessKey = inputRadio.getAccessKey(); int sunkEvents = Event.getEventsSunk(inputRadio); // Clear out the old input element setEventListener(asOld(inputRadio), null); getElement().replaceChild(newInputElem, inputRadio); // Sink events on the new element Event.sinkEvents(elem, Event.getEventsSunk(inputRadio)); Event.sinkEvents(inputRadio, 0); inputRadio = newInputElem;/*from w ww. jav a2s.c om*/ // Setup the new element Event.sinkEvents(inputRadio, sunkEvents); inputRadio.setId(uid); if (!"".equals(accessKey)) { inputRadio.setAccessKey(accessKey); } setValue(checked); setEnabled(enabled); setFormValue(formValue); // Set the event listener if (isAttached()) { setEventListener(asOld(inputRadio), this); } }
From source file:gwt.material.design.client.base.BaseCheckBox.java
License:Apache License
/** * @deprecated Call and use {@link #replaceInputElement(Element)} instead. *//*from www .j a v a2 s . co m*/ @Deprecated protected void replaceInputElement(com.google.gwt.user.client.Element elem) { InputElement newInputElem = InputElement.as(elem); // Collect information we need to set int tabIndex = getTabIndex(); boolean checked = getValue(); boolean enabled = isEnabled(); String formValue = getFormValue(); String uid = inputElem.getId(); String accessKey = inputElem.getAccessKey(); int sunkEvents = Event.getEventsSunk(inputElem); // Clear out the old input element DOM.setEventListener(inputElem, null); getElement().replaceChild(newInputElem, inputElem); // Sink events on the new element Event.sinkEvents(elem, Event.getEventsSunk(inputElem)); Event.sinkEvents(inputElem, 0); inputElem = newInputElem; // Setup the new element Event.sinkEvents(inputElem, sunkEvents); inputElem.setId(uid); if (!"".equals(accessKey)) { inputElem.setAccessKey(accessKey); } setTabIndex(tabIndex); setValue(checked); setEnabled(enabled); setFormValue(formValue); // Set the event listener if (isAttached()) { DOM.setEventListener(inputElem, this); } }
From source file:org.gwtbootstrap3.client.ui.impl.RadioImpl.java
License:Apache License
public void sinkEvents(int eventBitsToAdd, Element inputElem, Element labelElem) { Event.sinkEvents(inputElem, eventBitsToAdd | Event.getEventsSunk(inputElem)); }