/** * Returns the find popup menu. * * @see #setFindPopupMenu(JPopupMenu) * @return the find popup menu */ public JPopupMenu getFindPopupMenu() { return NativeSearchFieldSupport.getFindPopupMenu(this); }
private boolean isNativeSearchField() { return NativeSearchFieldSupport.isNativeSearchField(searchField); }
public static boolean isNativeSearchField(JTextField txt) { return isSearchField(txt) && isNativeSearchFieldSupported(); }
@Override public void propertyChange(PropertyChangeEvent evt) { JTextField txt = (JTextField) evt.getSource(); // Leopard hack to make appear correctly in search variant when // changing LnF. setSearchField(txt, isSearchField(txt)); } }
&& NativeSearchFieldSupport.isNativeSearchField(txtField); NativeSearchFieldSupport.setSearchField(lbl, NativeSearchFieldSupport .isSearchField(txtField)); NativeSearchFieldSupport.setFindPopupMenu(lbl, NativeSearchFieldSupport .getFindPopupMenu(txtField));
public boolean isUseNativeSearchFieldIfPossible() { return NativeSearchFieldSupport.isSearchField(this); }
/** * Install a recent the searches popup menu returned by * {@link #createPopupMenu(JXSearchField)} on <code>searchField</code>. * Also registers an {@link ActionListener} on <code>searchField</code> * and adds the search string to the list of recent searches whenever a * {@link ActionEvent} is received. * * Uses {@link NativeSearchFieldSupport} to achieve compatibility with the native * search field support provided by the Mac Look And Feel since Mac OS 10.5. * * @param searchField * the search field to install a recent searches popup menu on */ public void install(JTextField searchField) { searchField.addActionListener(this); NativeSearchFieldSupport.setFindPopupMenu(searchField, createPopupMenu(searchField)); }
/** * Sets the action that is invoked, when the user presses the 'Esc' key or * clicks the cancel button. * * @param cancelAction */ public final void setCancelAction(ActionListener cancelAction) { NativeSearchFieldSupport.setCancelAction(this, cancelAction); }
/** * Sets the action that is invoked when the enter key is pressed or the find * button is clicked. * * @return the find action */ public final void setFindAction(ActionListener findAction) { NativeSearchFieldSupport.setFindAction(this, findAction); }
public void setUseNativeSearchFieldIfPossible(boolean useNativeSearchFieldIfPossible) { TextUIWrapper.getDefaultWrapper().uninstall(this); NativeSearchFieldSupport.setSearchField(this, useNativeSearchFieldIfPossible); TextUIWrapper.getDefaultWrapper().install(this, true); updateUI(); }
/** * Returns the cancel action, or an instance of {@link ClearAction}, if * none has been set. * * @return the cancel action */ public final ActionListener getCancelAction() { ActionListener a = NativeSearchFieldSupport.getCancelAction(this); if (a == null) { a = new ClearAction(); } return a; }
/** * Returns the action that is invoked when the enter key is pressed or the * find button is clicked. If no action has been set, a new instance of * {@link FindAction} will be returned. * * @return the find action */ public final ActionListener getFindAction() { ActionListener a = NativeSearchFieldSupport.getFindAction(this); if (a == null) { a = new FindAction(); } return a; }
&& NativeSearchFieldSupport.isNativeSearchField(txtField); NativeSearchFieldSupport.setSearchField(lbl, NativeSearchFieldSupport .isSearchField(txtField)); NativeSearchFieldSupport.setFindPopupMenu(lbl, NativeSearchFieldSupport .getFindPopupMenu(txtField));
@Override public void propertyChange(PropertyChangeEvent evt) { JTextField txt = (JTextField) evt.getSource(); // Leopard hack to make appear correctly in search variant when // changing LnF. setSearchField(txt, isSearchField(txt)); } }
public boolean isUseNativeSearchFieldIfPossible() { return NativeSearchFieldSupport.isSearchField(this); }
/** * Install a recent the searches popup menu returned by * {@link #createPopupMenu(JXSearchField)} on <code>searchField</code>. * Also registers an {@link ActionListener} on <code>searchField</code> * and adds the search string to the list of recent searches whenever a * {@link ActionEvent} is received. * * Uses {@link NativeSearchFieldSupport} to achieve compatibility with the native * search field support provided by the Mac Look And Feel since Mac OS 10.5. * * @param searchField * the search field to install a recent searches popup menu on */ public void install(JTextField searchField) { searchField.addActionListener(this); NativeSearchFieldSupport.setFindPopupMenu(searchField, createPopupMenu(searchField)); }
/** * Sets the action that is invoked, when the user presses the 'Esc' key or * clicks the cancel button. * * @param cancelAction */ public final void setCancelAction(ActionListener cancelAction) { NativeSearchFieldSupport.setCancelAction(this, cancelAction); }
/** * Sets the action that is invoked when the enter key is pressed or the find * button is clicked. * * @return the find action */ public final void setFindAction(ActionListener findAction) { NativeSearchFieldSupport.setFindAction(this, findAction); }
public void setUseNativeSearchFieldIfPossible(boolean useNativeSearchFieldIfPossible) { TextUIWrapper.getDefaultWrapper().uninstall(this); NativeSearchFieldSupport.setSearchField(this, useNativeSearchFieldIfPossible); TextUIWrapper.getDefaultWrapper().install(this, true); updateUI(); }
/** * Returns the cancel action, or an instance of {@link ClearAction}, if * none has been set. * * @return the cancel action */ public final ActionListener getCancelAction() { ActionListener a = NativeSearchFieldSupport.getCancelAction(this); if (a == null) { a = new ClearAction(); } return a; }