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


Java TextProcessor类代码示例

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


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

示例1: isValidPrefix

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
@Override
protected boolean isValidPrefix(String prefix) {
  String word = TextProcessor.deprocess(getDisplayString());
  if (isInJavadoc()) {
    int idx = word.indexOf("{@link "); // $NON-NLS-1$
    if (idx == 0) {
      word = word.substring(7);
    } else {
      idx = word.indexOf("{@value "); // $NON-NLS-1$
      if (idx == 0) {
        word = word.substring(8);
      }
    }
  } else if (word.indexOf("this.") != -1) { // $NON-NLS-1$
    word = word.substring(word.indexOf("this.") + 5); // $NON-NLS-1$
  }
  return isPrefix(prefix, word);
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:JavaCompletionProposal.java

示例2: isValidPrefix

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
@Override
protected boolean isValidPrefix(String prefix) {
  if (super.isValidPrefix(prefix)) return true;

  String word = TextProcessor.deprocess(getDisplayString());
  if (fProposal.getKind() == CompletionProposal.CONSTRUCTOR_INVOCATION) {
    int start =
        word.indexOf(JavaElementLabels.CONCAT_STRING) + JavaElementLabels.CONCAT_STRING.length();
    word = word.substring(start);
    return isPrefix(prefix, word) || isPrefix(prefix, new String(fProposal.getName()));
  }

  if (isInJavadoc()) {
    int idx = word.indexOf("{@link "); // $NON-NLS-1$
    if (idx == 0) {
      word = word.substring(7);
    } else {
      idx = word.indexOf("{@value "); // $NON-NLS-1$
      if (idx == 0) {
        word = word.substring(8);
      }
    }
  }
  return isPrefix(prefix, word);
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:JavaMethodCompletionProposal.java

示例3: markLTR

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
/**
 * Adds special marks so that that the given styled string is readable in a BiDi environment.
 * 
 * @param styledString the styled string
 * @return the processed styled string
 * @since 3.4
 */
public static StyledString markLTR(StyledString styledString) {
	
	/*
	 * NOTE: For performance reasons we do not call  markLTR(styledString, null)
	 */
	
	if (!USE_TEXT_PROCESSOR)
		return styledString;

	String inputString= styledString.getString();
	String string= TextProcessor.process(inputString);
	if (string != inputString)
		insertMarks(styledString, inputString, string);
	return styledString;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:Strings.java

示例4: addCalls

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
/**
 * Adds the specified {@link TreeItem}'s text to the StringBuffer.
 * 
 * @param item the tree item
 * @param indent the indent size
 * @param buf the string buffer
 */
private void addCalls(TreeItem item, int indent, StringBuffer buf) {
	for (int i= 0; i < indent; i++) {
		buf.append(INDENTATION);
	}

	buf.append(TextProcessor.deprocess(item.getText()));
	buf.append('\n');

	if (item.getExpanded()) {
		TreeItem[] items= item.getItems();
		for (int i= 0; i < items.length; i++) {
			addCalls(items[i], indent + 1, buf);
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:CopyCallHierarchyAction.java

示例5: getQualifiedName

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
private String getQualifiedName(Object element) throws JavaModelException {
	if (element instanceof IResource)
		return ((IResource)element).getFullPath().toString();

	if (element instanceof IJarEntryResource)
		return ((IJarEntryResource)element).getFullPath().toString();

	if (element instanceof LogicalPackage)
		return ((LogicalPackage)element).getElementName();

	if (element instanceof IJavaProject || element instanceof IPackageFragmentRoot || element instanceof ITypeRoot) {
		IResource resource= ((IJavaElement)element).getCorrespondingResource();
		if (resource != null)
			return getQualifiedName(resource);
	}

	if (element instanceof IBinding)
		return BindingLabelProvider.getBindingLabel((IBinding)element, LABEL_FLAGS);

	return TextProcessor.deprocess(JavaElementLabels.getTextLabel(element, LABEL_FLAGS));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:CopyQualifiedNameAction.java

示例6: isValidPrefix

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
@Override
protected boolean isValidPrefix(String prefix) {
	String word= TextProcessor.deprocess(getDisplayString());
	if (isInJavadoc()) {
		int idx = word.indexOf("{@link "); //$NON-NLS-1$
		if (idx==0) {
			word = word.substring(7);
		} else {
			idx = word.indexOf("{@value "); //$NON-NLS-1$
			if (idx==0) {
				word = word.substring(8);
			}
		}
	} else if (word.indexOf("this.") != -1) { //$NON-NLS-1$
		word= word.substring(word.indexOf("this.") + 5); //$NON-NLS-1$
	}
	return isPrefix(prefix, word);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:JavaCompletionProposal.java

示例7: isValidPrefix

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
@Override
protected boolean isValidPrefix(String prefix) {
	if (super.isValidPrefix(prefix))
		return true;

	if (fProposal.getKind() == CompletionProposal.METHOD_NAME_REFERENCE) {
		// static imports - includes package & type name
		StringBuffer buf= new StringBuffer();
		buf.append(Signature.toCharArray(fProposal.getDeclarationSignature()));
		buf.append('.');
		buf.append(TextProcessor.deprocess(getDisplayString()));
		return isPrefix(prefix, buf.toString());
	}

	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:LazyJavaCompletionProposal.java

示例8: isValidPrefix

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
@Override
protected boolean isValidPrefix(String prefix) {
	if (super.isValidPrefix(prefix))
		return true;

	String word= TextProcessor.deprocess(getDisplayString());
	if (fProposal.getKind() == CompletionProposal.CONSTRUCTOR_INVOCATION) {
		int start= word.indexOf(JavaElementLabels.CONCAT_STRING) + JavaElementLabels.CONCAT_STRING.length();
		word= word.substring(start);
		return isPrefix(prefix, word) || isPrefix(prefix, new String(fProposal.getName()));
	}

	if (isInJavadoc()) {
		int idx = word.indexOf("{@link "); //$NON-NLS-1$
		if (idx==0) {
			word = word.substring(7);
		} else {
			idx = word.indexOf("{@value "); //$NON-NLS-1$
			if (idx==0) {
				word = word.substring(8);
			}
		}
	}
	return isPrefix(prefix, word);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:JavaMethodCompletionProposal.java

示例9: select

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
@Override
public boolean select(Viewer viewer, Object parentElement, Object element)
{
    PatternMatcher matcher = getMatcher();

    if (matcher == null || !(viewer instanceof TreeViewer))
    {
        return true;
    }

    TreeViewer treeViewer = (TreeViewer) viewer;

    String matchName = getText(element, treeViewer);
    matchName = TextProcessor.deprocess(matchName);

    if (matchName != null
            && matcher.matches(matchName)
            && (isOpenable(element)
                    || !(element instanceof TreeParent)))
    {
        return true;
    }

    return hasUnfilteredChild(treeViewer, element);
}
 
开发者ID:anjlab,项目名称:eclipse-tapestry5-plugin,代码行数:26,代码来源:AbstractTapestryContextInformation.java

示例10: markLTR

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
/**
 * Adds special marks so that that the given styled string is readable in a BiDi environment.
 *
 * @param styledString the styled string
 * @return the processed styled string
 * @since 3.4
 */
public static StyledString markLTR(StyledString styledString) {

	/*
	 * NOTE: For performance reasons we do not call  markLTR(styledString, null)
	 */

	if (!USE_TEXT_PROCESSOR)
		return styledString;

	String inputString= styledString.getString();
	String string= TextProcessor.process(inputString);
	if (string != inputString)
		insertMarks(styledString, inputString, string);
	return styledString;
}
 
开发者ID:fabioz,项目名称:eclipse.spellchecker,代码行数:23,代码来源:Strings.java

示例11: copyToClipboard

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
private void copyToClipboard(String text, Shell shell) {
	text = TextProcessor.deprocess(text);
	Clipboard clipboard = new Clipboard(shell.getDisplay());
	try {
		copyToClipboard(clipboard, text, shell);
	} finally {
		clipboard.dispose();
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:10,代码来源:CopyToClipboardAction.java

示例12: select

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
	StringMatcher matcher = getMatcher();
	if (matcher == null || !(viewer instanceof TreeViewer))
		return true;
	TreeViewer treeViewer = (TreeViewer) viewer;

	String matchName = ((ILabelProvider) treeViewer.getLabelProvider()).getText(element);
	matchName = TextProcessor.deprocess(matchName);
	if (matchName != null && matcher.match(matchName))
		return true;

	return hasUnfilteredChild(treeViewer, element);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:QuickOutlinePopup.java

示例13: markLTR

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
/**
 * Adds special marks so that that the given styled string is readable in a BiDi environment.
 *
 * @param styledString the styled string
 * @return the processed styled string
 * @since 3.4
 */
public static StyledString markLTR(StyledString styledString) {

  /*
   * NOTE: For performance reasons we do not call  markLTR(styledString, null)
   */

  if (!USE_TEXT_PROCESSOR) return styledString;

  String inputString = styledString.getString();
  String string = TextProcessor.process(inputString);
  if (string != inputString) insertMarks(styledString, inputString, string);
  return styledString;
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:Strings.java

示例14: markJavaElementLabelLTR

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
/**
 * Adds special marks so that that the given styled Java element label is readable in a BiDi
 * environment.
 *
 * @param styledString the styled string
 * @return the processed styled string
 * @since 3.6
 */
public static StyledString markJavaElementLabelLTR(StyledString styledString) {
  if (!USE_TEXT_PROCESSOR) return styledString;

  String inputString = styledString.getString();
  String string = TextProcessor.process(inputString, JAVA_ELEMENT_DELIMITERS);
  if (string != inputString) insertMarks(styledString, inputString, string);
  return styledString;
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:Strings.java

示例15: isValidPrefix

import org.eclipse.osgi.util.TextProcessor; //导入依赖的package包/类
@Override
protected boolean isValidPrefix(String prefix) {
  if (super.isValidPrefix(prefix)) return true;

  if (fProposal.getKind() == CompletionProposal.METHOD_NAME_REFERENCE) {
    // static imports - includes package & type name
    StringBuffer buf = new StringBuffer();
    buf.append(Signature.toCharArray(fProposal.getDeclarationSignature()));
    buf.append('.');
    buf.append(TextProcessor.deprocess(getDisplayString()));
    return isPrefix(prefix, buf.toString());
  }

  return false;
}
 
开发者ID:eclipse,项目名称:che,代码行数:16,代码来源:LazyJavaCompletionProposal.java


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