当前位置: 首页>>代码示例>>Java>>正文


Java PatternConstructor类代码示例

本文整理汇总了Java中org.eclipse.search.internal.core.text.PatternConstructor的典型用法代码示例。如果您正苦于以下问题:Java PatternConstructor类的具体用法?Java PatternConstructor怎么用?Java PatternConstructor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PatternConstructor类属于org.eclipse.search.internal.core.text包,在下文中一共展示了PatternConstructor类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateRegex

import org.eclipse.search.internal.core.text.PatternConstructor; //导入依赖的package包/类
private boolean validateRegex() {
  if (fIsRegExCheckbox.getSelection()) {
    try {
      PatternConstructor.createPattern(fPattern.getText(), fIsCaseSensitive, true);
    } catch (PatternSyntaxException e) {
      String locMessage = e.getLocalizedMessage();
      int i = 0;
      while (i < locMessage.length() && "\n\r".indexOf(locMessage.charAt(i)) == -1) { //$NON-NLS-1$
        i++;
      }
      statusMessage(true, locMessage.substring(0, i)); // only take first line
      return false;
    }
    statusMessage(false, ""); //$NON-NLS-1$
  } else {
    statusMessage(false, "(* = any string, ? = any character, \\ = escape for literals: * ? \\)");
  }
  return true;
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:20,代码来源:GoSearchPage.java

示例2: createPattern

import org.eclipse.search.internal.core.text.PatternConstructor; //导入依赖的package包/类
/**
 * Creates a pattern for the given search string and the given options.
 *
 * @param pattern the search pattern. If <code>isRegex</code> is:
 *     <ul>
 *       <li><code>false</code>: a string including '*' and '?' wildcards and '\' for escaping the
 *           literals '*', '?' and '\'
 *       <li><code>true</code>: a regex as specified by {@link Pattern} plus "\R" denoting a line
 *           delimiter (platform independent)
 *     </ul>
 *
 * @param isRegex <code>true</code> if the given string follows the {@link Pattern} including "\R"
 * @param isCaseSensitive Set to <code>true</code> to create a case insensitive pattern
 * @return the created pattern
 * @throws PatternSyntaxException if "\R" is at an illegal position
 * @see Pattern
 * @since 3.8
 */
public static Pattern createPattern(String pattern, boolean isCaseSensitive, boolean isRegex)
    throws PatternSyntaxException {
  return PatternConstructor.createPattern(pattern, isRegex, true, isCaseSensitive, false);
}
 
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:TextSearchEngine.java

示例3: createSearchPattern

import org.eclipse.search.internal.core.text.PatternConstructor; //导入依赖的package包/类
/**
 * Create a default search pattern taking into consideration case sensitivity and regular expression settings
 * 
 * @return
 */
public Pattern createSearchPattern()
{
	return PatternConstructor.createPattern(searchText.getText(), lastCaseSensitiveState, lastRegularExpressionState);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:10,代码来源:SearchComposite.java


注:本文中的org.eclipse.search.internal.core.text.PatternConstructor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。