import java.util.LinkedHashSet;
import java.util.Set;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-
public class AppCache implements AppCacheI
{
private static AppCache instance = null;
@Override
public void updateCache(Cacheable cacheable)
{
- JComboBox<String> cacheComboBox = cacheable.getCacheComboBox();
+ CacheBoxI<String> cacheComboBox = cacheable.getCacheComboBox();
String cacheKey = cacheable.getCacheKey();
- JComponent nextFocusableComponent = cacheable.getNextFocusableElement();
- String userInput = cacheComboBox.getEditor().getItem() == null ? ""
- : cacheComboBox.getEditor().getItem().toString().trim();
+ cacheComboBox.looseFocus();
+ String userInput = cacheComboBox.getUserInput();
if (userInput != null && !userInput.isEmpty())
{
}
String lastSearch = userInput;
- nextFocusableComponent.requestFocusInWindow();
if (cacheComboBox.getItemCount() > 0)
{
cacheComboBox.removeAllItems();