package jalview.io.cache;
import jalview.bin.Cache;
-import jalview.bin.Jalview;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public JvCacheableInputBox(String newCacheKey)
{
super();
- if (Jalview.isJS())
+ if (Platform.isJS())
{
textField = new JTextField();
return;
*/
public void updateCache()
{
- if (Jalview.isJS())
+ if (Platform.isJS())
{
return;
}
*/
public void persistCache()
{
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
appCache.persistCache(cacheKey);
}
*/
public String getUserInput()
{
- if (Jalview.isJS())
+ if (Platform.isJS())
{
return textField.getText().trim();
}
public JComponent getComponent()
{
- return Jalview.isJS() ? textField : comboBox;
+ return Platform.isJS() ? textField : comboBox;
}
public void addActionListener(ActionListener actionListener)
{
- if (Jalview.isJS())
+ if (Platform.isJS())
{
textField.addActionListener(actionListener);
}
public void addDocumentListener(DocumentListener listener)
{
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
((JTextComponent) comboBox.getEditor().getEditorComponent())
.getDocument().addDocumentListener(listener);
public void addFocusListener(FocusListener focusListener)
{
- if (Jalview.isJS())
+ if (Platform.isJS())
{
textField.addFocusListener(focusListener);
}
public void addKeyListener(KeyListener kl)
{
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
comboBox.getEditor().getEditorComponent().addKeyListener(kl);
}
public void setEditable(boolean b)
{
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
comboBox.setEditable(b);
}
public void setPrototypeDisplayValue(String string)
{
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
comboBox.setPrototypeDisplayValue(string);
}
public void setSelectedItem(String userInput)
{
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
comboBox.setSelectedItem(userInput);
}
public boolean isPopupVisible()
{
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
return comboBox.isPopupVisible();
}
public void addCaretListener(CaretListener caretListener)
{
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
((JTextComponent) comboBox.getEditor().getEditorComponent())
.addCaretListener(caretListener);
public void addItem(String item)
{
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
comboBox.addItem(item);
}