@Override public void setMode(Mode mode) { if (mode == Mode.SINGLE_LINE) { delegate.setMode(ExpandingTextBoxMode.SINGLE_LINE); } else { delegate.setMode(ExpandingTextBoxMode.MULTI_LINE); } }
@Override public void setPrimitiveDataStyleName(Optional<String> styleName) { checkNotNull(styleName); if (lastStyleName.isPresent()) { delegate.getSuggestBox().removeStyleName(lastStyleName.get()); } lastStyleName = styleName; if (styleName.isPresent()) { delegate.getSuggestBox().addStyleName(styleName.get()); } }
@Override public HandlerRegistration addSelectionHandler(final SelectionHandler<EntitySuggestion> handler) { final HandlerRegistration handlerReg = addHandler(handler, SelectionEvent.getType()); final HandlerRegistration delegateReg = delegate.addSelectionHandler( new SelectionHandler<SuggestOracle.Suggestion>() { @Override public void onSelection(SelectionEvent<SuggestOracle.Suggestion> event) { SuggestOracle.Suggestion suggestion = event.getSelectedItem(); if (suggestion instanceof EntitySuggestion) { SelectionEvent.fire( PrimitiveDataEditorViewImpl.this, (EntitySuggestion) suggestion); } } }); return new HandlerRegistration() { @Override public void removeHandler() { handlerReg.removeHandler(); delegateReg.removeHandler(); } }; }
@Override public void setAnchorTitle(String title) { delegate.setAnchorTitle(title); }
@Override public void setAnchorVisible(boolean b) { delegate.setAnchorVisible(b); }
@Override public void setAutoSelectSuggestions(boolean autoSelectSuggestions) { delegate.setAutoSelectSuggestions(autoSelectSuggestions); }
@Override public void setSuggestOracle(SuggestOracle oracle) { delegate.setOracle(oracle); }
@Override public HandlerRegistration addFocusHandler(FocusHandler handler) { return delegate.addFocusHandler(handler); }
@Override public void setText(String text) { delegate.setText(text); }
@Override public String getText() { return delegate.getText(); }
@Override public void setPlaceholder(String placeholder) { delegate.setPlaceholder(placeholder); }
@Override public String getPlaceholder() { return delegate.getPlaceholder(); }
@Override public HandlerRegistration addKeyUpHandler(KeyUpHandler handler) { return delegate.addKeyUpHandler(handler); }
@Override public HandlerRegistration addAnchorClickedHandler(AnchorClickedHandler handler) { return delegate.addAnchorClickedHandler(handler); }
@Override public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) { return delegate.addValueChangeHandler(handler); }
@Override public boolean isEnabled() { return delegate.isEnabled(); }
@Override public void setEnabled(boolean enabled) { delegate.setEnabled(enabled); }