Skip to content

Commit

Permalink
Merge pull request #12798 from riverwanderer/editor-search-regex-reva…
Browse files Browse the repository at this point in the history
…mp-radiobuttons-prev

Editor search revamp: more options and enhanced navigation
  • Loading branch information
uckelman authored Dec 8, 2023
2 parents c9e198d + 56c1e36 commit ba041fc
Show file tree
Hide file tree
Showing 7 changed files with 900 additions and 307 deletions.
1,119 changes: 839 additions & 280 deletions vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java

Large diffs are not rendered by default.

43 changes: 30 additions & 13 deletions vassal-app/src/main/resources/VASSAL/i18n/Editor.properties
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,38 @@ Editor.save=Save
Editor.save_as=Save as...
Editor.search=Search...
Editor.search_string=String to find
Editor.search_next=Find next
Editor.search_prev=Prev
Editor.search_prevTip=PgUp
Editor.search_next=Next
Editor.search_nextTip=PgDn
Editor.search_case=Exact case
Editor.search_regex=Regular Expression
Editor.search_advanced=Advanced search
Editor.search_names=Match names
Editor.search_types=Match [Class names]
Editor.search_traits=Match trait descriptions
Editor.search_expressions=Match expressions and fields
Editor.search_properties=Match property names
Editor.search_keys=Match key commands
Editor.search_menus=Match UI text
Editor.search_messages=Match message formats
Editor.search_optLabel=Type:
Editor.search_optRegex=Regular Expression
Editor.search_optNormal=Normal
Editor.search_optWord=Start of word
Editor.search_scopeLabel=Scope:
Editor.search_simple=Basic
Editor.search_full=Full
Editor.search_advanced=Advanced Filters
Editor.search_filters=Match on:
Editor.search_names=Component names & descriptions
Editor.search_types=[Class names]
Editor.search_traits=Trait descriptions
Editor.search_expressions=Expressions and fields
Editor.search_properties=Property names
Editor.search_matches=%1$s. Matches in
Editor.search_keys=Key commands
Editor.search_menus=UI text
Editor.search_messages=Message formats
Editor.search_all_off=Warning - all field flags unchecked - turning on 'Match Names'
Editor.search_none_found=Search string not found:
Editor.search_count= Matches found for search string:
Editor.search_none_found=Search string not found: %1$s
Editor.search_noWord_match=No match found for word search starting %1$s
Editor.search_noRegex_match=No match found for Regular Expression %1$s
Editor.search_count=%1$s items match on search string %2$s
Editor.search_countRegex=%1$s items match on Regular Expression %2$s
Editor.search_countWord=%1$s items match at a word boundary starting %2$s
Editor.search_badRegex=Search string is not a valid Regular Expression: %1$s
Editor.search_badWord=Pattern Syntax Error in Editor Search word start: %1$s
Editor.edit_extension=Edit extension
Editor.new_extension=New extension
Editor.cant_cut_ancestor_to_child=Can't paste a cut ancestor to its own child.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@

VASSAL's Module Editor has a powerful Search facility to find components and pieces in a number of different ways.

The default search is to search for everything, but the Advanced Searh options can be used to limit the type of search performed.
The default scope is a simple search that targets the names and descriptions of module components. Options can be used to search through all module data or to limit the search to data types of interest. Special search types offer additional flexibility.

Initiate a search with the "Next" button [PgDn] and repeat this to advance the output item by item. The "Prev" button [PgUp] allows you to return to the previous item.

Search output indicates the number of items (traits and components) found and details each in order, positioning the editor on the found item. Traits are reported with a prefix indicating the line number of the trait within the found item (sample output below). Matched strings are high-lighted.

Note that a search will continue from the last item found and will wrap-around, until you restart the editing session.

'''''

Expand All @@ -18,32 +24,33 @@ The default search is to search for everything, but the Advanced Searh options c
[width="100%",cols="50%a,^50%a",]
|===
a|

===== Type
Search may be normal, start of word or https://en.wikipedia.org/wiki/Regular_expression[Regular Expression]. "Start of word" uses a pre-formatted regular expression to find matches on words or phrases starting with the search string.

===== Exact Case
Force an Exact case search (i.e. abc is different to ABC).

===== Regular Expression
The specified search string is a https://en.wikipedia.org/wiki/Regular_expression[Regular Expression]. In the simplest example, a search for ABC will find matches that equate wholly to "ABC", and lower or mixed case variants (unless _Exact Case_ is checked as well).

===== Advanced Search
Show the advanced search options. All search options are on in a simple search. The advanced options allow you to turn off options to narrow your search.
===== Scope
Choose from a basic search of component and piece names, a full search of all supported data or use "advanced filters" to select specific data types. Note that there are a few data fields that search does not check.

===== Match names
Match against the names of components or pieces.
===== Match component names & descriptions
Match against the names and descriptions of components and pieces.

===== Match [class names]
Match against the Java Class Name of components.
===== Match [Class names]
Match against the Java Class Name of components (in the editor these are the names in square brackets).

===== Match trait descriptions
Match against text recorded in the description fields of traits.

===== Match expressions and fields
Match against Beanshell expressions defined in piece traits.
Match against expressions defined in piece traits, both legacy and Beanshell.

===== Match property names
Match against the names of Properties provided by piece traits.

===== Match key commands
Match against Key Commands defied in piece traits. You can search against user defined Named Key Strokes, or for the standard name of defined Key Strokes (e.g., Ctrl-C).
Match against Key Commands defined in piece traits. You can search against user defined Named Key Strokes, or for the standard name of defined Key Strokes (e.g., Ctrl+C or Alt+Shift+C).

===== Match UI text

Expand All @@ -52,12 +59,22 @@ Match against the Menu Text provided for piece trait right-click menus.
===== Match message formats
Match against the Formatted Strings defined in piece traits.


.Basic
|image:images/search_basic.png[]

_Basic Search._
_Basic Search_



image:images/search_advanced.png[]

_Advanced Search._
_Advanced Filters._


image:images/search_output.png[]

_Sample Output._

|===

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ba041fc

Please sign in to comment.