- CacheBoxI<String> cacheComboBox = cacheable.getCacheComboBox();
- String cacheKey = cacheable.getCacheKey();
- cacheComboBox.looseFocus();
- String userInput = cacheComboBox.getUserInput();
-
- if (userInput != null && !userInput.isEmpty())
- {
- LinkedHashSet<String> foundCache = getAllCachedItemsFor(cacheable);
- foundCache.add(userInput);
- cacheItems.put(cacheKey, foundCache);
- }
-
- String lastSearch = userInput;
- if (cacheComboBox.getItemCount() > 0)
- {
- cacheComboBox.removeAllItems();
- }
-
- Set<String> cacheItems = getAllCachedItemsFor(cacheable);
- if (cacheItems != null && !cacheItems.isEmpty())
- {
- for (String cacheItem : cacheItems)
- {
- cacheComboBox.addItem(cacheItem);
- }
- }
-
- if (!lastSearch.isEmpty())
- {
- cacheComboBox.setSelectedItem(lastSearch);
- cacheComboBox.requestFocus();
- }
- else
- {
- cacheable.initCache();
- cacheComboBox.addItem("");
- cacheComboBox.setSelectedItem("");
- }
- }
-
- @Override
- public void initCache(Cacheable cacheable)
- {
- String separatedStr = Cache.getProperty(cacheable.getCacheKey());