source: josm/trunk/src/org/openstreetmap/josm/tools/template_engine/SearchExpressionCondition.java@ 7005

Last change on this file since 7005 was 4282, checked in by jttt, 13 years ago

Allow to specify custom pattern for marker text labels

File size: 888 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools.template_engine;
3
4import org.openstreetmap.josm.actions.search.SearchCompiler.Match;
5
6public class SearchExpressionCondition implements TemplateEntry {
7
8 private final Match condition;
9 private final TemplateEntry text;
10
11 public SearchExpressionCondition(Match condition, TemplateEntry text) {
12 this.condition = condition;
13 this.text = text;
14 }
15
16 @Override
17 public void appendText(StringBuilder result, TemplateEngineDataProvider dataProvider) {
18 text.appendText(result, dataProvider);
19 }
20
21 @Override
22 public boolean isValid(TemplateEngineDataProvider dataProvider) {
23 return dataProvider.evaluateCondition(condition);
24 }
25
26 @Override
27 public String toString() {
28 return condition.toString() + " '" + text.toString() + "'";
29 }
30
31}
Note: See TracBrowser for help on using the repository browser.