NativeSearchFieldSupport { public static boolean isSearchField(JTextField txt) { return MAC_SEARCH_VARIANT.equals(txt.getClientProperty(MAC_TEXT_FIELD_VARIANT_PROPERTY)); }  static boolean isNativeSearchFieldSupported(); static void setSearchField(JTextField txt, boolean isSearchField); static boolean isSearchField(JTextField txt); static boolean isNativeSearchField(JTextField txt); static void setFindPopupMenu(JTextField txt, JPopupMenu popupMenu); static JPopupMenu getFindPopupMenu(JTextField txt); static void setFindAction(JTextField txt, ActionListener findAction); static ActionListener getFindAction(JTextField txt); static void setCancelAction(JTextField txt, ActionListener cancelAction); static ActionListener getCancelAction(JTextField txt); static final String FIND_POPUP_PROPERTY; static final String FIND_ACTION_PROPERTY; static final String MAC_SEARCH_VARIANT; static final String MAC_TEXT_FIELD_VARIANT_PROPERTY; static final String CANCEL_ACTION_PROPERTY; }
@Test public void testIsSearchField() throws Exception { NativeSearchFieldSupport.setSearchField(tf, true); Assert.assertTrue(NativeSearchFieldSupport.isSearchField(tf)); NativeSearchFieldSupport.setSearchField(tf, false); Assert.assertFalse(NativeSearchFieldSupport.isSearchField(tf)); }