01: /*
02: * Replaceable.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.interfaces;
13:
14: /**
15: *
16: * @author support@sql-workbench.net
17: */
18: public interface Replaceable
19:
20: {
21: /**
22: * Initiate the replace Dialog
23: */
24: void replace();
25:
26: /**
27: * Find and highlight the first occurance of the String
28: * @return true if an occurance was found
29: */
30: int findFirst(String aValue, boolean ignoreCase, boolean wholeWord,
31: boolean useRegex);
32:
33: /**
34: * Find and highlight the next occurance of the expression
35: * initially found with findFirst()
36: *
37: * If findFirst() has not been called before, -1 should be returned.
38: */
39: int findNext();
40:
41: /**
42: * Replace the currently highlighted (=found) text with the given value
43: */
44: boolean replaceCurrent(String aReplacement, boolean useRegex);
45:
46: /**
47: * Find and replace the next occurance.
48: * Only valid if findFirst() was called.
49: * @return true if an occurance was found
50: */
51: boolean replaceNext(String aReplacement, boolean useRegex);
52:
53: /**
54: * Find and replace all occurances of the given value
55: * with replacement.
56: * @return the number of occurances replaced
57: */
58: int replaceAll(String value, String replacement,
59: boolean selectedText, boolean ignoreCase,
60: boolean wholeWord, boolean useRegex);
61:
62: boolean isTextSelected();
63: }
|