本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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));
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}