X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2Fcache%2FAppCache.java;h=111a99bc7923b59073b776d2cdce660941284980;hb=ddaf8294122cf6dd080339726113f9f54175f413;hp=92013415c2bf5ae5e094fcf2a04386942d59a4ca;hpb=0ce95d9c8581b19c1d636f67f67dd670e41f1ca9;p=jalview.git diff --git a/src/jalview/io/cache/AppCache.java b/src/jalview/io/cache/AppCache.java index 9201341..111a99b 100644 --- a/src/jalview/io/cache/AppCache.java +++ b/src/jalview/io/cache/AppCache.java @@ -5,9 +5,6 @@ import java.util.Hashtable; 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; @@ -44,11 +41,10 @@ public class AppCache implements AppCacheI @Override public void updateCache(Cacheable cacheable) { - JComboBox cacheComboBox = cacheable.getCacheComboBox(); + CacheBoxI 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()) { @@ -58,7 +54,6 @@ public class AppCache implements AppCacheI } String lastSearch = userInput; - nextFocusableComponent.requestFocusInWindow(); if (cacheComboBox.getItemCount() > 0) { cacheComboBox.removeAllItems();