Java Doc for SearchAndReplace.java in  » Swing-Library » jEdit » org » gjt » sp » jedit » search » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » jEdit » org.gjt.sp.jedit.search 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.gjt.sp.jedit.search.SearchAndReplace

SearchAndReplace
public class SearchAndReplace (Code)
Class that implements regular expression and literal search within jEdit buffers.

There are two main groups of methods in this class:

  • Property accessors - for changing search and replace settings.
  • Actions - for performing search and replace.
The "HyperSearch" and "Keep dialog" features, as reflected in checkbox options in the search dialog, are not handled from within this class. If you wish to have these options set before the search dialog appears, make a prior call to either or both of the following:
 jEdit.setBooleanProperty("search.hypersearch.toggle",true);
 jEdit.setBooleanProperty("search.keepDialog.toggle",true);
If you are not using the dialog to undertake a search or replace, you may call any of the search and replace methods (including SearchAndReplace.hyperSearch(View) ) without concern for the value of these properties.
author:
   Slava Pestov
author:
   John Gellene (API documentation)
version:
   $Id: SearchAndReplace.java 10894 2007-10-15 16:11:39Z mediumnet $




Method Summary
public static  StringescapeRegexp(String str, boolean multiline)
     Escapes characters with special meaning in a regexp.
public static  booleanfind(View view)
     Finds the next occurrence of the search string.
public static  booleanfind(View view, Buffer buffer, int start)
     Finds the next instance of the search string in the specified buffer.
public static  booleanfind(View view, Buffer buffer, int start, boolean firstTime, boolean reverse)
     Finds the next instance of the search string in the specified buffer.
public static  booleangetAutoWrapAround()
     Returns the state of the auto wrap around flag.
public static  booleangetBeanShellReplace()
     Returns the state of the BeanShell replace flag.
public static  booleangetIgnoreCase()
     Returns the state of the ignore case flag.
public static  booleangetRegexp()
     Returns the state of the regular expression flag.
public static  StringgetReplaceString()
     Returns the current replacement string.
public static  booleangetReverseSearch()
     Returns the state of the reverse search flag.
public static  SearchFileSetgetSearchFileSet()
     Returns the current search file set.
public static  SearchMatchergetSearchMatcher()
     Returns the current search string matcher.
public static  StringgetSearchString()
     Returns the current search string.
public static  booleangetSmartCaseReplace()
     Returns if the replacement string will assume the same case as each specific occurrence of the search string.
static  voidhandleError(Component comp, Exception e)
    
public static  booleanhyperSearch(View view)
     Performs a HyperSearch.
public static  booleanhyperSearch(View view, boolean selection)
     Performs a HyperSearch.
public static  voidload()
     Loads search and replace state from the properties.
public static  booleanreplace(View view)
     Replaces the current selection with the replacement string.
public static  booleanreplace(View view, Buffer buffer, int start, int end)
     Replaces text in the specified range with the replacement string.
public static  booleanreplaceAll(View view)
     Replaces all occurrences of the search string with the replacement string.
public static  booleanreplaceAll(View view, boolean dontOpenChangedFiles)
     Replaces all occurrences of the search string with the replacement string.
public static  voidsave()
     Saves search and replace state to the properties.
public static  voidsetAutoWrapAround(boolean wrap)
     Sets the state of the auto wrap around flag.
public static  voidsetBeanShellReplace(boolean beanshell)
     Sets the state of the BeanShell replace flag.
public static  voidsetIgnoreCase(boolean ignoreCase)
     Sets the ignore case flag.
public static  voidsetRegexp(boolean regexp)
     Sets the state of the regular expression flag.
public static  voidsetReplaceString(String replace)
     Sets the current replacement string.
public static  voidsetReverseSearch(boolean reverse)
     Determines whether a reverse search will conducted from the current position to the beginning of a buffer.
public static  voidsetSearchFileSet(SearchFileSet fileset)
     Sets the current search file set.
public static  voidsetSearchMatcher(SearchMatcher matcher)
     Sets a custom search string matcher.
public static  voidsetSearchString(String search)
     Sets the current search string.



Method Detail
escapeRegexp
public static String escapeRegexp(String str, boolean multiline)(Code)
Escapes characters with special meaning in a regexp.
Parameters:
  multiline - Should \n be escaped?
since:
   jEdit 4.3pre1



find
public static boolean find(View view)(Code)
Finds the next occurrence of the search string.
Parameters:
  view - The view True if the operation was successful, false otherwise



find
public static boolean find(View view, Buffer buffer, int start) throws Exception(Code)
Finds the next instance of the search string in the specified buffer.
Parameters:
  view - The view
Parameters:
  buffer - The buffer
Parameters:
  start - Location where to start the search



find
public static boolean find(View view, Buffer buffer, int start, boolean firstTime, boolean reverse) throws Exception(Code)
Finds the next instance of the search string in the specified buffer.
Parameters:
  view - The view
Parameters:
  buffer - The buffer
Parameters:
  start - Location where to start the search
Parameters:
  firstTime - See SearchMatcher.nextMatch(CharSequencebooleanbooleanbooleanboolean).
since:
   jEdit 4.1pre7



getAutoWrapAround
public static boolean getAutoWrapAround()(Code)
Returns the state of the auto wrap around flag.
since:
   jEdit 3.2pre2



getBeanShellReplace
public static boolean getBeanShellReplace()(Code)
Returns the state of the BeanShell replace flag. True if the replace string is a BeanShell expression
since:
   jEdit 3.2pre2



getIgnoreCase
public static boolean getIgnoreCase()(Code)
Returns the state of the ignore case flag. True if searches should be case insensitive,false otherwise



getRegexp
public static boolean getRegexp()(Code)
Returns the state of the regular expression flag. True if regular expression searches should be performed



getReplaceString
public static String getReplaceString()(Code)
Returns the current replacement string.



getReverseSearch
public static boolean getReverseSearch()(Code)
Returns the state of the reverse search flag. True if searches should go backwards,false otherwise



getSearchFileSet
public static SearchFileSet getSearchFileSet()(Code)
Returns the current search file set.



getSearchMatcher
public static SearchMatcher getSearchMatcher() throws Exception(Code)
Returns the current search string matcher. a SearchMatcher or null if there is no search or if the matcher can match empty String
exception:
  IllegalArgumentException - if regular expression searchis enabled, the search string or replacement string is invalid
since:
   jEdit 4.1pre7



getSearchString
public static String getSearchString()(Code)
Returns the current search string.



getSmartCaseReplace
public static boolean getSmartCaseReplace()(Code)
Returns if the replacement string will assume the same case as each specific occurrence of the search string.
since:
   jEdit 4.2pre10



handleError
static void handleError(Component comp, Exception e)(Code)



hyperSearch
public static boolean hyperSearch(View view)(Code)
Performs a HyperSearch.
Parameters:
  view - The view
since:
   jEdit 2.7pre3



hyperSearch
public static boolean hyperSearch(View view, boolean selection)(Code)
Performs a HyperSearch.
Parameters:
  view - The view
Parameters:
  selection - If true, will only search in the current selection.Note that the file set must be the current buffer file set for thisto work.
since:
   jEdit 4.0pre1



load
public static void load()(Code)
Loads search and replace state from the properties.



replace
public static boolean replace(View view)(Code)
Replaces the current selection with the replacement string.
Parameters:
  view - The view True if the operation was successful, false otherwise



replace
public static boolean replace(View view, Buffer buffer, int start, int end)(Code)
Replaces text in the specified range with the replacement string.
Parameters:
  view - The view
Parameters:
  buffer - The buffer
Parameters:
  start - The start offset
Parameters:
  end - The end offset True if the operation was successful, false otherwise



replaceAll
public static boolean replaceAll(View view)(Code)
Replaces all occurrences of the search string with the replacement string.
Parameters:
  view - The view



replaceAll
public static boolean replaceAll(View view, boolean dontOpenChangedFiles)(Code)
Replaces all occurrences of the search string with the replacement string.
Parameters:
  view - The view
Parameters:
  dontOpenChangedFiles - Whether to open changed files or to autosave them quietly



save
public static void save()(Code)
Saves search and replace state to the properties.



setAutoWrapAround
public static void setAutoWrapAround(boolean wrap)(Code)
Sets the state of the auto wrap around flag.
Parameters:
  wrap - If true, the 'continue search from start' dialogwill not be displayed
since:
   jEdit 3.2pre2



setBeanShellReplace
public static void setBeanShellReplace(boolean beanshell)(Code)
Sets the state of the BeanShell replace flag.
Parameters:
  beanshell - True if the replace string is a BeanShell expression
since:
   jEdit 3.2pre2



setIgnoreCase
public static void setIgnoreCase(boolean ignoreCase)(Code)
Sets the ignore case flag.
Parameters:
  ignoreCase - True if searches should be case insensitive,false otherwise



setRegexp
public static void setRegexp(boolean regexp)(Code)
Sets the state of the regular expression flag.
Parameters:
  regexp - True if regular expression searches should beperformed



setReplaceString
public static void setReplaceString(String replace)(Code)
Sets the current replacement string.
Parameters:
  replace - The new replacement string



setReverseSearch
public static void setReverseSearch(boolean reverse)(Code)
Determines whether a reverse search will conducted from the current position to the beginning of a buffer. Note that reverse search and regular expression search is mutually exclusive; enabling one will disable the other.
Parameters:
  reverse - True if searches should go backwards,false otherwise



setSearchFileSet
public static void setSearchFileSet(SearchFileSet fileset)(Code)
Sets the current search file set.
Parameters:
  fileset - The file set to perform searches in
See Also:   AllBufferSet
See Also:   CurrentBufferSet
See Also:   DirectoryListSet



setSearchMatcher
public static void setSearchMatcher(SearchMatcher matcher)(Code)
Sets a custom search string matcher. Note that calling SearchAndReplace.setSearchString(String) , SearchAndReplace.setIgnoreCase(boolean) , or SearchAndReplace.setRegexp(boolean) will reset the matcher to the default.



setSearchString
public static void setSearchString(String search)(Code)
Sets the current search string.
Parameters:
  search - The new search string



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.