001 package echopoint;
002
003 import java.util.ResourceBundle;
004
005 import echopoint.internal.TextField;
006 import echopoint.model.AutoLookupSelectModel;
007
008 public class AutoLookupSelectField extends TextField {
009
010 private static final long serialVersionUID = 1L;
011
012 protected ResourceBundle resourceBundle;
013 private String key;
014 private String searchVal;
015 public static final String PROPERTY_KEY = "key";
016 public static final String PROPERTY_SEARCH_VAL = "searchVal";
017
018 /**
019 * Creates a new <code>AutoLookupSelectField</code>.
020 */
021 public AutoLookupSelectField() {
022 super();
023 // Add design-time configured components.
024 initComponents();
025 }
026
027
028 /**
029 * Configures initial state of component.
030 * WARNING: AUTO-GENERATED METHOD.
031 * Contents will be overwritten.
032 */
033 private void initComponents() {
034
035 }
036
037 public static final String PROPERTY_AUTO_LOOKUP_MODEL = "autoLookupModel";
038 // public static final String PROPERTY_POPUP_PROPERTIES = "popupProperties";
039 // public static final String PROPERTY_ENTRY_PROPERTIES = "entryProperties";
040 // public static final String PROPERTY_ENTRY_ROLLOVER_PROPERTIES = "entryRolloverProperties";
041 // public static final String PROPERTY_SEARCH_BAR_PROPERTIES = "searchBarProperties";
042 // public static final String PROPERTY_SEARCH_BAR_ROLLOVER_PROPERTIES = "searchBarRolloverProperties";
043 public static final String PROPERTY_SEARCH_BAR_ICON = "searchBarIcon";
044 public static final String PROPERTY_SEARCH_BAR_SEARCHING_ICON = "searchBarSearchingIcon";
045 public static final String PROPERTY_SEARCH_BAR_TEXT = "searchBarText";
046 public static final String PROPERTY_SEARCH_BAR_SHOWN = "searchBarShown";
047 public static final String PROPERTY_SEARCH_BAR_SEARCHING_TEXT = "searchBarSearchingText";
048 public static final String PROPERTY_NO_MATCHING_OPTION_TEXT = "noMatchingOptionText";
049
050
051 public AutoLookupSelectModel getAutoLookupModel() {
052 return (AutoLookupSelectModel) get(PROPERTY_AUTO_LOOKUP_MODEL);
053 }
054
055 public void setAutoLookupModel(AutoLookupSelectModel autoLookupModel) {
056 set(PROPERTY_AUTO_LOOKUP_MODEL, autoLookupModel);
057 }
058
059
060 public void setKey(String key) {
061 String oldValue = this.key;
062 this.key = key;
063 firePropertyChange(PROPERTY_KEY, oldValue, key);
064 }
065
066
067 public String getKey() {
068 return key;
069 }
070
071
072 public void setSearchVal(String searchVal) {
073 String oldValue = this.searchVal;
074 this.searchVal = searchVal;
075 firePropertyChange(PROPERTY_SEARCH_VAL, oldValue, searchVal);
076 }
077
078
079 public String getSearchVal() {
080 return searchVal;
081 }
082
083 @Override
084 public void processInput(String inputName, Object inputValue) {
085 super.processInput(inputName, inputValue);
086 if (PROPERTY_KEY.equals(inputName)) {
087 setKey((String)inputValue);
088 }else if (PROPERTY_SEARCH_VAL.equals(inputName)) {
089 setSearchVal((String)inputValue);
090 }
091 }
092 }