public void showEditor(InlineCreationEditor editor) { view.show(editor.getElement()); }
@Override public void showNewItemEditor(InlineCreationEditor editor) { editor.clear(); liveSearchFooter.showEditor(editor); }
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); } }
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); } }
public void showEditor(InlineCreationEditor editor) { view.show(editor.getElement()); }
@Override public void showNewItemEditor(InlineCreationEditor editor) { editor.clear(); liveSearchFooter.showEditor(editor); }
@Before public void init() { when(editor.getElement()).thenReturn(editorElement); footer = new LiveSearchFooter(view); footer.init(onNewEntry, onReset); }