Java Code Examples for com.google.gwt.event.shared.HandlerRegistration

The following examples show how to use com.google.gwt.event.shared.HandlerRegistration. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: gwt-material   Source File: BaseCheckBox.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(
        final ValueChangeHandler<Boolean> handler) {
    // Is this the first value change handler? If so, time to add handlers
    if (!valueChangeHandlerInitialized) {
        ensureDomEventHandlers();
        valueChangeHandlerInitialized = true;
    }
    return addHandler(handler, ValueChangeEvent.getType());
}
 
Example 2
Source Project: gwt-material-addins   Source File: MaterialFileUploader.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addCompleteHandler(final CompleteEvent.CompleteHandler<UploadFile> handler) {
    return addHandler(new CompleteEvent.CompleteHandler<UploadFile>() {
        @Override
        public void onComplete(CompleteEvent<UploadFile> event) {
            if (isEnabled()) {
                handler.onComplete(event);
            }
        }
    }, CompleteEvent.getType());
}
 
Example 3
Source Project: gwt-material   Source File: MaterialValueBox.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addGestureChangeHandler(final GestureChangeHandler handler) {
    return valueBoxBase.addGestureChangeHandler(event -> {
        if (isEnabled()) {
            handler.onGestureChange(event);
        }
    });
}
 
Example 4
Source Project: calendar-component   Source File: DateCell.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onDetach() {
    for (HandlerRegistration handler : handlers) {
        handler.removeHandler();
    }
    handlers.clear();

    super.onDetach();
}
 
Example 5
Source Project: gwt-material   Source File: DefaultHandlerRegistry.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void clearHandlers() {
    if(handlers != null) {
        for(HandlerRegistration handler : handlers) {
            removeHandler(handler);
        }
        handlers.clear();
    }
}
 
Example 6
Source Project: gwt-material   Source File: MaterialDropDown.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addSelectionHandler(final SelectionHandler<Widget> handler) {
    return addHandler((SelectionHandler<Widget>) event -> {
        Widget widget = event.getSelectedItem();
        if (widget instanceof HasEnabled && ((HasEnabled) widget).isEnabled() && isEnabled()) {
            handler.onSelection(event);
        }
    }, SelectionEvent.getType());
}
 
Example 7
Source Project: gwt-material-addins   Source File: MaterialStep.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addSelectionHandler(final SelectionHandler<MaterialStep> handler) {
    return this.addHandler(new SelectionHandler<MaterialStep>() {
        @Override
        public void onSelection(SelectionEvent<MaterialStep> event) {
            if (isEnabled()) {
                handler.onSelection(event);
            }
        }
    }, SelectionEvent.getType());
}
 
Example 8
Source Project: gwt-material   Source File: MaterialValueBox.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addGestureStartHandler(final GestureStartHandler handler) {
    return valueBoxBase.addGestureStartHandler(event -> {
        if (isEnabled()) {
            handler.onGestureStart(event);
        }
    });
}
 
Example 9
Source Project: gwt-material-addins   Source File: MaterialAutoComplete.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addFocusHandler(FocusHandler handler) {
    return itemBox.addHandler(focusEvent -> {
        if (isEnabled()) {
            handler.onFocus(focusEvent);
        }
    }, FocusEvent.getType());
}
 
Example 10
Source Project: gwt-material-addins   Source File: MaterialAutoComplete.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(final ValueChangeHandler<List<? extends Suggestion>> handler) {
    return addHandler(new ValueChangeHandler<List<? extends Suggestion>>() {
        @Override
        public void onValueChange(ValueChangeEvent<List<? extends Suggestion>> event) {
            if (isEnabled()) {
                handler.onValueChange(event);
            }
        }
    }, ValueChangeEvent.getType());
}
 
Example 11
Source Project: consulo   Source File: WidgetComboBox.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addBlurHandler(BlurHandler handler) {
  return addHandler(handler, BlurEvent.getType());
}
 
Example 12
Source Project: consulo   Source File: ComboBoxSelectItem.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addFocusHandler(FocusHandler handler) {
  return addDomHandler(handler, FocusEvent.getType());
}
 
Example 13
Source Project: unitime   Source File: FilterBox.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
	return addHandler(handler, ValueChangeEvent.getType());
}
 
Example 14
Source Project: gwt-material-addins   Source File: GroupToggleButton.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addSelectionHandler(SelectionHandler<T> selectionHandler) {
    return addHandler(selectionHandler, SelectionEvent.getType());
}
 
Example 15
Source Project: bitcoin-transaction-explorer   Source File: HeadingWidget.java    License: MIT License 4 votes vote down vote up
@Override
public HandlerRegistration addClickHandler(final ClickHandler handler) {
  return addDomHandler(handler, ClickEvent.getType());
}
 
Example 16
Source Project: consulo   Source File: WidgetComboBox.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) {
  return addHandler(handler, KeyDownEvent.getType());
}
 
Example 17
@Override
public HandlerRegistration addFocusHandler(FocusHandler handler) {
	return this.compositeFocusHelper.addFocusHandler(handler);
}
 
Example 18
Source Project: gwt-material-addins   Source File: MaterialStepper.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addStartHandler(StartEvent.StartHandler handler) {
    return addHandler(handler, StartEvent.TYPE);
}
 
Example 19
Source Project: unitime   Source File: AriaSuggestBox.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addFocusHandler(FocusHandler handler) {
	return addHandler(handler, FocusEvent.getType());
}
 
Example 20
@Override
public HandlerRegistration addConnectorHierarchyChangeHandler(ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler handler) {
  return null;
}
 
Example 21
Source Project: gwt-material   Source File: MaterialRange.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addInputChangeHandler(InputChangeEvent.InputChangeHandler handler) {
    return addHandler(handler, InputChangeEvent.getType());
}
 
Example 22
Source Project: gwtbootstrap3-extras   Source File: TagsInputBase.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addItemRemovedHandler(final ItemRemovedHandler<T> handler) {
    return addHandler(handler, ItemRemovedEvent.getType());
}
 
Example 23
Source Project: unitime   Source File: EventAdd.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<List<RelatedObjectInterface>> handler) {
	return addHandler(handler, ValueChangeEvent.getType());
}
 
Example 24
Source Project: unitime   Source File: FilterBox.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addKeyUpHandler(KeyUpHandler handler) {
	return iFilter.addKeyUpHandler(handler);
}
 
Example 25
Source Project: gwt-material-addins   Source File: ScreenKeyboard.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addChangeHandler(ChangeEvent.ChangeHandler handler) {
    return addHandler(handler, ChangeEvent.getType());
}
 
Example 26
Source Project: incubator-retired-wave   Source File: ClickableDivPanel.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
  return addDomHandler(handler, MouseOverEvent.getType());
}
 
Example 27
Source Project: gwt-material   Source File: MaterialWidget.java    License: Apache License 2.0 4 votes vote down vote up
public void removeHandler(HandlerRegistration handler) {
    getHandlerRegistry().removeHandler(handler);
}
 
Example 28
Source Project: calendar-component   Source File: FocusableHTML.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) {
    return addDomHandler(handler, KeyPressEvent.getType());
}
 
Example 29
@Override
public HandlerRegistration addDragEndHandler(DragEndHandler handler) {
	return this.addBitlessDomHandler(handler, DragEndEvent.getType());
}
 
Example 30
Source Project: consulo   Source File: ComboBoxSelectItem.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public HandlerRegistration addKeyUpHandler(KeyUpHandler handler) {
  return addDomHandler(handler, KeyUpEvent.getType());
}