class LiveSearchDropDown implements IsWidget {

    public void init(LiveSearchService<TYPE> searchService,
                     LiveSearchSelectionHandler<TYPE> selectionHandler) {
        this.searchService = searchService;
        this.selectionHandler = selectionHandler;

        selectionHandler.setLiveSearchSelectionCallback(this::onItemSelected);

        view.setClearSelectionMessage(selectionHandler.isMultipleSelection());

        if (searchService instanceof EntryCreationLiveSearchService) {

            view.setNewInstanceEnabled(true);

            EntryCreationLiveSearchService<TYPE, ?> creationService = (EntryCreationLiveSearchService<TYPE, ?>) searchService;

            EntryCreationEditor<TYPE> editor = creationService.getEditor();

            if (creationService.getEditor() instanceof InlineCreationEditor) {
                InlineCreationEditor<TYPE> inlineEditor = (InlineCreationEditor<TYPE>) editor;
                inlineEditor.init(this::addNewItem, view::restoreFooter);
                onAddItemPressed = () -> view.showNewItemEditor(inlineEditor);
            } else if (creationService.getEditor() instanceof ModalCreationEditor) {
                ModalCreationEditor<TYPE> modalEditor = (ModalCreationEditor<TYPE>) editor;
                modalEditor.init(this::addNewItem, () -> {});
                onAddItemPressed = () -> modalEditor.show();
            }
        } else {
            view.setNewInstanceEnabled(false);
        }
    }

    @Inject public  LiveSearchDropDown(View view,
                              ManagedInstance<LiveSearchSelectorItem<TYPE>> liveSearchSelectorItems);

}