Java 类org.eclipse.jface.text.source.AnnotationPainter 实例源码

项目:bts    文件:EgyTextTranslationPart.java   
private void configureEditorDrawingStrategies(AnnotationPainter painter2) {
        // Sentence
        ITextStyleStrategy strategy = new org.eclipse.jface.text.source.AnnotationPainter.HighlightingStrategy();
        painter2.addTextStyleStrategy(BTSSentenceAnnotation.TYPE + ".highlighted", strategy);
        painter2.setAnnotationTypeColor(BTSSentenceAnnotation.TYPE + ".highlighted",
                BTSUIConstants.COLOR_SENTENCE);
        painter2.addAnnotationType(BTSSentenceAnnotation.TYPE + ".highlighted", BTSSentenceAnnotation.TYPE);

        ITextStyleStrategy strategy2 = new org.eclipse.jface.text.source.AnnotationPainter.HighlightingStrategy();
        painter2.addTextStyleStrategy(BTSSentenceAnnotation.TYPE, strategy2);
        painter2.setAnnotationTypeColor(BTSSentenceAnnotation.TYPE,
                BTSUIConstants.COLOR_SENTENCE);
        painter2.addAnnotationType(BTSSentenceAnnotation.TYPE, BTSSentenceAnnotation.TYPE);

//      // comment
//              CommentDrawingStrategy commentStrategy = new CommentDrawingStrategy();
//              painter2.addDrawingStrategy(BTSModelAnnotation.TYPE, commentStrategy);
//              painter2.setAnnotationTypeColor(BTSModelAnnotation.TYPE,
//                      BTSUIConstants.COLOR_SENTENCE);
//              painter2.addAnnotationType(BTSModelAnnotation.TYPE,
//                      BTSModelAnnotation.TYPE);

    }