本文整理汇总了Java中org.eclipse.jface.text.BadPositionCategoryException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java BadPositionCategoryException.printStackTrace方法的具体用法?Java BadPositionCategoryException.printStackTrace怎么用?Java BadPositionCategoryException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.text.BadPositionCategoryException
的用法示例。
在下文中一共展示了BadPositionCategoryException.printStackTrace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: debugPrint
import org.eclipse.jface.text.BadPositionCategoryException; //导入方法依赖的package包/类
/**
* For printing out debugging information
* (TypedPosition)
* @param msg
*/
public void debugPrint(String msg) {
System.out.println("Debug print " + msg);
System.out.println("Start comment offset: " + pcalStartCommentOffset
+ "; Start: (" + pcalStartOffset + ", " + pcalStartLength +
"); End comment: (" + pcalEndCommentOffset + ", "
+ pcalEndCommentLength + ")") ;
Position[] positions = null;
try {
positions = fDocument.getPositions(fPositionCategory);
} catch (BadPositionCategoryException e1) {
System.out.println("Can't get positions") ;
e1.printStackTrace();
return ;
}
for (int i = 0; i < positions.length; i++) {
try {
TypedPosition position = (TypedPosition) positions[i] ;
System.out.println("Position " + i + ": (" + position.getOffset()
+ ", " + position.getLength() + ") type: "
+ position.getType() + (position.isDeleted?" DELETED":""));
System.out.println(" `" +
fDocument.get(position.getOffset(), position.getLength()) + "'") ;
} catch (Exception e) {
System.out.println("Item " + i + " Exception: " + e.getMessage()) ;
}
}
IRegion result = createRegion();
if (result == null) {
System.out.println("Returned null");
} else {
System.out.println("Returned (" + result.getOffset() + ", "
+ result.getLength() + ")") ;
}
}