Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ There are three search modes to choose from that determines the frequency of sea

- `EXPLICIT` (default): event is fired when search button is clicked or when ENTER key is pressed.
- `DEBOUNCE`: event is fired when typing stops for a set time.
- `EXPLICIT`: event is fired at each key press while typing.
- `EAGER`: event is fired at each key press while typing.

```Java
searchBox.setSearchMode(SearchMode.DEBOUNCE);
Expand Down
28 changes: 19 additions & 9 deletions src/main/java/org/vaadin/addons/searchbox/SearchBox.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
package org.vaadin.addons.searchbox;

import java.util.Optional;

import org.vaadin.addons.autocomplete.AutocompleteExtension;
import org.vaadin.addons.autocomplete.converter.SuggestionCaptionConverter;
import org.vaadin.addons.autocomplete.converter.SuggestionValueConverter;
import org.vaadin.addons.autocomplete.generator.SuggestionGenerator;
import org.vaadin.addons.searchbox.event.SearchEvent;
import org.vaadin.addons.searchbox.event.SearchListener;

import com.vaadin.server.Resource;
import com.vaadin.shared.Registration;
import com.vaadin.shared.ui.ValueChangeMode;
Expand All @@ -18,6 +9,14 @@
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.TextField;
import com.vaadin.ui.themes.ValoTheme;
import org.vaadin.addons.autocomplete.AutocompleteExtension;
import org.vaadin.addons.autocomplete.converter.SuggestionCaptionConverter;
import org.vaadin.addons.autocomplete.converter.SuggestionValueConverter;
import org.vaadin.addons.autocomplete.generator.SuggestionGenerator;
import org.vaadin.addons.searchbox.event.SearchEvent;
import org.vaadin.addons.searchbox.event.SearchListener;

import java.util.Optional;

/**
* Search Box component with autocomplete functionality.
Expand Down Expand Up @@ -289,6 +288,17 @@ public void setButtonJoined(boolean joined) {
}
}

/**
* Adds one or more style names to searchBox layout by using one or multiple
* parameters.
*
* @param styles
* the style name or style names to be added to the searchBox layout
*/
public void addSearchBoxLayoutStyleNames(String... styles) {
searchBoxLayout.addStyleNames(styles);
}

private void doLayout() {
searchBoxLayout.removeAllComponents();
searchBoxLayout.removeStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
Expand Down