![JAR search and dependency download from the Maven repository](/logo.png)
org.fife.rsta.ui.search.SearchUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rstaui Show documentation
Show all versions of rstaui Show documentation
RSTAUI is an add-on library for RSyntaxTextArea that provides pre-build dialog boxes commonly needed in text editing applications.
/*
* 09/20/2013
*
* SearchUtil - Utility methods for this package.
*
* This library is distributed under a modified BSD license. See the included
* RSyntaxTextArea.License.txt file for details.
*/
package org.fife.rsta.ui.search;
/**
* Utility methods for this package.
*
* @author Robert Futrell
* @version 1.0
*/
final class SearchUtil {
/**
* Private constructor to prevent instantiation.
*/
private SearchUtil() {
}
/**
* Formats an error message from a find/replace button enable result for
* use in a tool tip. This assumes the error (if any) came from a
* PatternSyntaxException
.
*
* @param res The result.
* @return The tool tip, or null
if no error message was
* specified in res
.
*/
public static String getToolTip(FindReplaceButtonsEnableResult res) {
String tooltip = res.getError();
if (tooltip!=null && tooltip.indexOf('\n')>-1) {
tooltip = tooltip.replaceFirst("\\\n", "
");
tooltip = "" + tooltip;
}
return tooltip;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy