Allow plugins to register search operators
|Reported by:||joshdoe||Owned by:||joshdoe|
|Keywords:||search operator plugin||Cc:||joshdoe|
At least #5905 and #6232 require the functionality for plugins to register search operators that can be used in the search dialog. Relevant code changes would be in org.openstreetmap.josm.actions.search.SearchCompiler. Currently an if-else structure handles operators in parseFactor(). This could perhaps be changed so that all operators (really subclasses of Match) provide another method to return the name for the operator, or when registering operators the name would be provided. This of course means that SearchCompiler should have a method like addOperator() which will append the new operator to a list, which both core and plugins can use. This function should check for name conflicts and modify the new operator name by appending an integer. The Match class should also require the operator to return a short (and possibly a long) description which can be used for generating help.
Does this sound like a reasonable implementation? I wouldn't want to adversely impact performance of course.
Change History (25)
comment:2 follow-up: ↓ 4 Changed 4 years ago by joshdoe
- Owner changed from team to joshdoe
- Status changed from new to needinfo
comment:3 Changed 4 years ago by stoecker
- Summary changed from Allow plugins to register search operators to [patch] Allow plugins to register search operators
comment:6 in reply to: ↑ 5 ; follow-up: ↓ 7 Changed 4 years ago by bastiK
comment:17 Changed 4 years ago by bastiK
- Resolution set to fixed
- Status changed from needinfo to closed