Changeset 25682 for main/trunk/gli/src


Ignore:
Timestamp:
2012-05-28T23:44:13+12:00 (12 years ago)
Author:
davidb
Message:

Changed to using RSyntaxTextArea to get coloured highlighting and other goodies for the Greenstone3 format manager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/Format4gs3Manager.java

    r25610 r25682  
    3333import javax.xml.parsers.DocumentBuilderFactory;
    3434
     35import org.fife.ui.rsyntaxtextarea.*;
     36
    3537import org.greenstone.gatherer.Configuration;
    3638import org.greenstone.gatherer.DebugStream;
     
    297299
    298300            editor_textarea = new NumberedJTextArea();
     301
     302                /* Fields specific to RSyntaxQuery inherited class */
     303            editor_textarea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
     304            editor_textarea.setBracketMatchingEnabled(true);
     305            editor_textarea.setAnimateBracketMatching(true);
     306            editor_textarea.setAntiAliasingEnabled(true);
     307            editor_textarea.setAutoIndentEnabled(true);
     308            editor_textarea.setPaintMarkOccurrencesBorder(false);
     309           
     310            /* Standard fields to JTextArea */
    299311            editor_textarea.setOpaque(false);
    300312            editor_textarea.setBackground(Configuration.getColor("coloring.editable_background", false));
     
    824836         * A textarea with the line number next to each line of the text
    825837         */
    826         public class NumberedJTextArea extends JTextArea
     838        public class NumberedJTextArea extends RSyntaxTextArea /*JTextArea*/
    827839        {
    828840            public void paintComponent(Graphics g)
     
    832844                g.setColor(Color.white);
    833845                g.fillRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
     846
     847                super.paintComponent(g);
     848
    834849                if (rectangle.x < insets.left)
    835850                {
     
    860875                        line_number_start_point++;
    861876                    }
    862                 }
    863                 super.paintComponent(g);
     877                }               
    864878            }
    865879
Note: See TracChangeset for help on using the changeset viewer.