Stop search event firing from SearchableBar

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Stop search event firing from SearchableBar

Postby anujaj » Wed Sep 29, 2010 8:30 am

Hi,
I have a SearchableBar (associated with code editor) each in one tab of tabbed pane.
The search text of the bar from current pane should be shown by default, in the search bar of any other tab when enabled/changed.

I have implemented the same by storing the getSearchingText() under this listener
searchable.addSearchableListener(new SearchableListener () {
public void serachableEventFired(SearchableEvent arg0) {
searchStr = searchableBar.getSearchingText(); } });

and then setting the same text in
tabbedPane.addChangeListener(new ChangeListener() {
public void stateChanged(ChangedEvent e) {
searchable.setSearchingText(searchStr); }});

Though the search string got from last tab is correctly displayed in the new tab,
somehow the search event is simultaneously fired also in the new selected tab.
Can this search event firing be controlled (in fact, stopped)
and only the search text appears in the new tab, so that actual search
does not happen by itself but only when user wishes to do so.

Any help in this direction is appreciated.
Thanks
anujaj
 
Posts: 2
Joined: Mon Sep 20, 2010 12:41 am

Re: Stop search event firing from SearchableBar

Postby JIDE Support » Wed Sep 29, 2010 9:22 am

Please remove the document listeners of the JTextField#getDocument() inside SearchableBar before you invoke setSearchingText() then add those document listeners back thereafter. You could get the instance of the JTextField by overriding SearchableBar#setSearchingText(). In this case, you will not get the Searchable event fired. However, you will not get the Searchable work as well.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: Google [Bot] and 58 guests