Examples of HighlightsSequence


Examples of org.netbeans.spi.editor.highlighting.HighlightsSequence

        }
       
        HighlightsContainer bh = HighlightingManager.getInstance(pane).getBottomHighlights();
        //HighlightsContainer th = HighlightingManager.getInstance(pane).getTopHighlights();
       
        HighlightsSequence bhs = bh.getHighlights(start, end);
        //HighlightsSequence ths = th.getHighlights(start, end);       

        final FontColorSettings fcs = MimeLookup.getLookup(
            MimePath.get(pane.getContentType())).lookup(FontColorSettings.class);

        default_fcolor = (Color) fcs.getTokenFontColors("default").getAttribute(StyleConstants.Foreground);
       // default_fcolor = pane.getForeground();
      //  Color test = (Color) pane.getFont().getAttributes().get(StyleConstants.Foreground);

        String colorTblStr = "{\\colortbl;";
        colorTblStr += processColorToken(default_fcolor);
        //colorTblStr += processColorToken(default_bcolor);

        while (bhs.moveNext()) {
            AttributeSet attr = bhs.getAttributes();
            final Color fc = (Color) attr.getAttribute(StyleConstants.Foreground);
          //  final Color bc = (Color) attr.getAttribute(StyleConstants.Background);
            if (fc != null) colorTblStr += processColorToken(fc);
        }
View Full Code Here

Examples of org.netbeans.spi.editor.highlighting.HighlightsSequence

        }
       
        HighlightsContainer bh = HighlightingManager.getInstance(pane).getBottomHighlights();
  //      HighlightsContainer th = HighlightingManager.getInstance(pane).getTopHighlights();
       
        HighlightsSequence bhs = bh.getHighlights(start, end);
//        HighlightsSequence ths = th.getHighlights(start, end);
       
    //    default_bcolor = pane.getBackground();
       
        int token_end_prev = -2;
        StringBuilder rtfContent = new StringBuilder("");
       
        while (bhs.moveNext()) {
            try {
                int token_start = bhs.getStartOffset();
                int token_end = bhs.getEndOffset();
               
                String token = pane.getText(token_start, token_end - token_start);
               
                if (token_start > token_end_prev && token_end_prev >= 0) {
                    String token_miss = pane.getText(token_end_prev, token_start-token_end_prev);
                    processToken(token_miss, null, rtfContent);
                }
                processToken(token, bhs.getAttributes(), rtfContent);
                token_end_prev = token_end;
            } catch (BadLocationException ex) {
                Exceptions.printStackTrace(ex);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.