import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
private static final int INPUT_LIMIT = 2;
- private static final int LEFT_BOARDER_WIDTH = 2;
+ private static final int LEFT_BOARDER_WIDTH = 18;
private String cacheKey;
.split(AppCache.CACHE_DELIMITER));
LinkedHashSet<String> foundCacheItems = appCache
- .getAllCachedItemsFor(cacheKey);// cacheItems.get(cacheKey);
+ .getAllCachedItemsFor(cacheKey);
if (foundCacheItems == null)
{
foundCacheItems = new LinkedHashSet<String>();
pnlDefaultCache.setBorder(BorderFactory.createEmptyBorder(0,
LEFT_BOARDER_WIDTH, 0, 0));
txtDefaultCacheSize.setPreferredSize(new Dimension(45, 20));
+ txtDefaultCacheSize.setFont(new java.awt.Font("Verdana", 0, 12));
lblDefaultCacheSize.setText(MessageManager
.getString("label.default_cache_size"));
+ lblDefaultCacheSize.setFont(new java.awt.Font("Verdana", 0, 12));
// Force input to accept only Integer entries up to length - INPUT_LIMIT
txtDefaultCacheSize.setDocument(new PlainDocument()
{
}
}
});
+ txtDefaultCacheSize.addKeyListener(new java.awt.event.KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent e)
+ {
+ if (e.getKeyCode() == KeyEvent.VK_ENTER)
+ {
+ e.consume();
+ updateCache();
+ closePopup();
+ }
+ }
+ });
+
txtDefaultCacheSize.setText(appCache.getCacheLimit(cacheKey));
pnlDefaultCache.add(lblDefaultCacheSize);
+ menuItemClearCache.setFont(new java.awt.Font("Verdana", 0, 12));
pnlDefaultCache.add(txtDefaultCacheSize);
menuItemClearCache.setText(MessageManager
.getString("action.clear_cached_items"));
add(popup);
}
+ private void closePopup()
+ {
+ popup.setVisible(false);
+ popup.transferFocus();
+ }
+
/**
* Answers true if input text is an integer
*