<commit_before>/*
 * CQLDesignerPanel.java
 *
 * Created on May 16, 2006, 3:18 PM
 */

package edu.duke.cabig.catrip.gui.panels;


import edu.duke.cabig.catrip.gui.components.CPanel;
import java.awt.Color;
import java.awt.Font;
import javax.swing.text.PlainDocument;
import org.bounce.text.xml.XMLEditorKit;
import org.bounce.text.xml.XMLStyleConstants;


/**
 *
 * @author  <NAME>
 */
public class CQLDesignerPanel extends CPanel {
    
    /** Creates new form CQLDesignerPanel */
    public CQLDesignerPanel() {
        initComponents();
        init();
    }
    
    private void init(){
        XMLEditorKit kit = new XMLEditorKit( true);
        kit.setWrapStyleWord( true);
        kit.setLineWrappingEnabled( true);
        getDcqlQueryEditorPane().getDocument().putProperty( PlainDocument.tabSizeAttribute, new Integer(4));
        kit.setStyle( XMLStyleConstants.ATTRIBUTE_NAME, new Color( 128, 0, 128), Font.PLAIN);
        kit.setStyle( XMLStyleConstants.ATTRIBUTE_VALUE, new Color( 128, 0, 255), Font.BOLD);
        kit.setStyle( XMLStyleConstants.ELEMENT_VALUE, new Color(0,0,0), Font.BOLD);
        kit.setStyle( XMLStyleConstants.ELEMENT_NAME, new Color(128,0,128), Font.PLAIN);
        getDcqlQueryEditorPane().setEditable(false);
        getDcqlQueryEditorPane().setEditorKit(kit);
    }
    
    public javax.swing.JEditorPane getDcqlQueryEditorPane() {
        return dcqlQueryEditorPane;
    }
    
    public void setDcqlQueryText(String cqlTxt) {
        getDcqlQueryEditorPane().setText(cqlTxt);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents<commit_msg>Added few custom colors in XML view.<commit_after>/*
 * CQLDesignerPanel.java
 *
 * Created on May 16, 2006, 3:18 PM
 */

package edu.duke.cabig.catrip.gui.panels;


import edu.duke.cabig.catrip.gui.components.CPanel;
import java.awt.Color;
import java.awt.Font;
import javax.swing.text.PlainDocument;
import org.bounce.text.xml.XMLEditorKit;
import org.bounce.text.xml.XMLStyleConstants;


/**
 *
 * @author  <NAME>
 */
public class CQLDesignerPanel extends CPanel {
    
    /** Creates new form CQLDesignerPanel */
    public CQLDesignerPanel() {
        initComponents();
        init();
    }
    
    private void init(){
        XMLEditorKit kit = new XMLEditorKit( true);
        kit.setWrapStyleWord( true);
        kit.setLineWrappingEnabled( true);
        getDcqlQueryEditorPane().getDocument().putProperty( PlainDocument.tabSizeAttribute, new Integer(4));
        kit.setStyle( XMLStyleConstants.ATTRIBUTE_NAME, new Color( 0,128,0), Font.PLAIN);
        kit.setStyle( XMLStyleConstants.ATTRIBUTE_VALUE, new Color( 128, 0, 255), Font.BOLD);
        kit.setStyle( XMLStyleConstants.ELEMENT_VALUE, new Color(0,0,0), Font.BOLD);
        kit.setStyle( XMLStyleConstants.ELEMENT_NAME, new Color(128, 0, 128), Font.PLAIN);
        getDcqlQueryEditorPane().setEditable(false);
        getDcqlQueryEditorPane().setEditorKit(kit);
    }
    
    public javax.swing.JEditorPane getDcqlQueryEditorPane() {
        return dcqlQueryEditorPane;
    }
    
    public void setDcqlQueryText(String cqlTxt) {
        getDcqlQueryEditorPane().setText(cqlTxt);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
{'fraction_non_alphanumeric': 0.11081298631607191, 'fraction_numerical': 0.017708612825328682, 'mean_word_length': 3.2752293577981653, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4632140', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1186, 'n_words': 261}