Community
Participate
Working Groups
1) Open search dialog 2) Choose plug-in search tab 3) Limit to "All" 4) External Scope to "All" 5) search for something 6) Re-open search dialog bug: Search dialog displays file search. bug: selecting plug-in tab resets changes made in steps 3&4
That's PDE search, sorry for the delay.
I don't think this is related to PDE. This happens to me all the time with the regular search dialog, without even having PDE installed. The dialog also forgets the search type, and much worse, the search scope (selected resources/workspace/all projects), when you're just using Java/Text file searches. I think this setting/default dialog preference should also survive Eclipse restarts. Or we need a completely different GUI for file searches - I think it's very common to try out searching for something, and then change that search string, and the current process is very annoying.
(In reply to comment #0) > bug: Search dialog displays file search. You should file a bug against Platform/Search. > bug: selecting plug-in tab resets changes made in steps 3&4 Actually, not exactly. If you expand the search combo, you'll find the previously executed queries, and as soon as you'll have selected an old 'pattern', the whole query will be displayed in UI again. But, unfortunately, the list is not persisted on disk and thus lost when you restart Eclipse. That would be fair enough to: 1. Select the first item (if there is any) of the combo when the search page is activated 2. Persist the 'QueryData' array using IDialogSettings
Attaching a Mylyn context. Implementing the persistency mechanism is pretty straightforward.
Created attachment 122010 [details] mylyn/context/zip
(In reply to comment #3) > (In reply to comment #0) > > bug: Search dialog displays file search. > > You should file a bug against Platform/Search. Well, you should *not* ;-) See 33710.
*** Bug 299235 has been marked as a duplicate of this bug. ***
I have looked into fixing this and came up with a few options. The main constraint is that the key-value IDialogSettings only supports strings and arrays of strings as values. Here are some ways I have thought of saving the array of QueryData objects: 1) For each QueryData property, have an array of string values. The value at each index for that array represents the value of that property of the QueryData object at that index in the previousQueries array. I.E keys such as previousQueries-text, previousQueries-limit which would each contain an array of string values. 2) Mix the position data into the key. For each item in the previousQueries array there would be one key for each attribute. For example, the key previousQueries-text-2 would contain the text attribute for the second element of the previousQueries array. This allows the usage of the built in retrieval methods for integers and other primitive types. It is less clean but it is easier to implement. 3) Implement methods on the QueryData class to serialize it to and from a string. Then only one key would be needed that would contain an array of QueryData strings. This appears to be the cleanest method but has some pitfalls such as escaping text from the search terms so that odd queries don't mess up the serialization. Java serialization can not be used because it does not work on nested classes. Any thoughts on which method I should implement? Are there any other methods of saving the data that you can think of?
I thought of a solution to the string escaping problem with my option #3 in my previous comment. The search queries can't contain newlines so I store the string as a series of values separated by newlines. I have implemented code that saves the state of the previousQueries array and restores it on startup. The only problem at the moment is that the array of IWorkingSets needs to be serialized into the string. IWorkingSet inherits IPersistableElement but I am not sure how the persistence works and how I can properly restore the selected working sets.
Created attachment 221526 [details] My changes to PluginSearchPage.java I added code to store the names of the selected working sets and restore them. This patch implements full, working persistence for the PDE search page.
Created attachment 221527 [details] mylyn/context/zip
PDE committer time is very limited, but I will try to review your patch for 4.3.
A superior solution would be what JDT does for their search page. They store the various settings as independant properties in a dialog settings. Then for each previous search pattern a new settings section is created. That way you can take advantage of the error checking built into the dialog/preferences API.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
This bug has been marked as stalebug a while ago without any further interaction. If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard flag.
This bug was marked as stalebug a while ago. Marking as worksforme. If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard tag.