<commit_before>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jme3.gde.welcome;

import com.jme3.gde.welcome.rss.RssFeedParser;
import java.io.IOException;
import java.net.URL;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.html.StyleSheet;
import org.netbeans.api.settings.ConvertAsProperties;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.HtmlBrowser.URLDisplayer;
import org.openide.util.Exceptions;
import org.openide.windows.TopComponent;
import org.openide.util.NbBundle.Messages;

/**
 * Top component which displays something.
 */
@ConvertAsProperties(
    dtd = "-//com.jme3.gde.welcome//WelcomeScreen//EN",
autostore = false)
@TopComponent.Description(
    preferredID = "WelcomeScreenTopComponent",
//iconBase="SET/PATH/TO/ICON/HERE", 
persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "editor", openAtStartup = true)
@ActionID(category = "Window", id = "com.jme3.gde.welcome.WelcomeScreenTopComponent")
@ActionReference(path = "Menu/Window" /*, position = 333 */)
@TopComponent.OpenActionRegistration(
    displayName = "#CTL_WelcomeScreenAction",
preferredID = "WelcomeScreenTopComponent")
@Messages({
    "CTL_WelcomeScreenAction=WelcomeScreen",
    "CTL_WelcomeScreenTopComponent=WelcomeScreen Window",
    "HINT_WelcomeScreenTopComponent=This is a WelcomeScreen window"
})
public final class WelcomeScreenTopComponent extends TopComponent implements HyperlinkListener {

    private final RssFeedParser parser = new RssFeedParser("http://jmonkeyengine.org/feed/rdf/");//"http://www.chip.de/rss/rss_tests.xml");

    public WelcomeScreenTopComponent() {
        initComponents();
        jScrollPane2.setOpaque(false);
        jScrollPane2.getViewport().setOpaque(false);
        jScrollPane3.setOpaque(false);
        jScrollPane3.getViewport().setOpaque(false);
        
        setName(Bundle.CTL_WelcomeScreenTopComponent());
        setToolTipText(Bundle.HINT_WelcomeScreenTopComponent());

        jTextPane1.setEditorKit(parser.getEditorKit());
        jTextPane1.setDocument(parser.getDocument());
        jTextPane1.addHyperlinkListener(this);
//        jEditorPane2.addHyperlinkListener(this);

//        StyleSheet sheet = new StyleSheet();
//        sheet.addRule("background-color: transparent;");
//        parser.getEditorKit().setStyleSheet(sheet);
        
        try {
            jEditorPane1.setPage(new URL("http://jmonkeyengine.org/wiki/doku.php/sdk:welcome?do=export_xhtmlbody"));
//                jEditorPane1.setPage(new URL("nbres:/com/jme3/gde/core/docs/core-about.html"));
        } catch (IOException ex) {
            try {
                jEditorPane1.setPage(new URL("nbres:/com/jme3/gde/core/docs/core-about.html"));
            } catch (IOException ex1) {
                Exceptions.printStackTrace(ex1);
            }
        }
//        jEditorPane2.setBackground(new Color(0, 0, 0, 128));
//        jTextPane1.setBackground(new Color(0, 0, 0, 128));
        parser.updateFeed();
    }<commit_msg>SDK: - add listener for hyperlinks in main welcome doc<commit_after>/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jme3.gde.welcome;

import com.jme3.gde.welcome.rss.RssFeedParser;
import java.io.IOException;
import java.net.URL;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.html.StyleSheet;
import org.netbeans.api.settings.ConvertAsProperties;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.HtmlBrowser.URLDisplayer;
import org.openide.util.Exceptions;
import org.openide.windows.TopComponent;
import org.openide.util.NbBundle.Messages;

/**
 * Top component which displays something.
 */
@ConvertAsProperties(
    dtd = "-//com.jme3.gde.welcome//WelcomeScreen//EN",
autostore = false)
@TopComponent.Description(
    preferredID = "WelcomeScreenTopComponent",
//iconBase="SET/PATH/TO/ICON/HERE", 
persistenceType = TopComponent.PERSISTENCE_ALWAYS)
@TopComponent.Registration(mode = "editor", openAtStartup = true)
@ActionID(category = "Window", id = "com.jme3.gde.welcome.WelcomeScreenTopComponent")
@ActionReference(path = "Menu/Window" /*, position = 333 */)
@TopComponent.OpenActionRegistration(
    displayName = "#CTL_WelcomeScreenAction",
preferredID = "WelcomeScreenTopComponent")
@Messages({
    "CTL_WelcomeScreenAction=WelcomeScreen",
    "CTL_WelcomeScreenTopComponent=WelcomeScreen Window",
    "HINT_WelcomeScreenTopComponent=This is a WelcomeScreen window"
})
public final class WelcomeScreenTopComponent extends TopComponent implements HyperlinkListener {

    private final RssFeedParser parser = new RssFeedParser("http://jmonkeyengine.org/feed/rdf/");//"http://www.chip.de/rss/rss_tests.xml");

    public WelcomeScreenTopComponent() {
        initComponents();
        jScrollPane2.setOpaque(false);
        jScrollPane2.getViewport().setOpaque(false);
        jScrollPane3.setOpaque(false);
        jScrollPane3.getViewport().setOpaque(false);
        
        setName(Bundle.CTL_WelcomeScreenTopComponent());
        setToolTipText(Bundle.HINT_WelcomeScreenTopComponent());

        jTextPane1.setEditorKit(parser.getEditorKit());
        jTextPane1.setDocument(parser.getDocument());
        jTextPane1.addHyperlinkListener(this);
        jEditorPane1.addHyperlinkListener(this);

//        StyleSheet sheet = new StyleSheet();
//        sheet.addRule("background-color: transparent;");
//        parser.getEditorKit().setStyleSheet(sheet);
        
        try {
            jEditorPane1.setPage(new URL("http://jmonkeyengine.org/wiki/doku.php/sdk:welcome?do=export_xhtmlbody"));
//                jEditorPane1.setPage(new URL("nbres:/com/jme3/gde/core/docs/core-about.html"));
        } catch (IOException ex) {
            try {
                jEditorPane1.setPage(new URL("nbres:/com/jme3/gde/core/docs/core-about.html"));
            } catch (IOException ex1) {
                Exceptions.printStackTrace(ex1);
            }
        }
//        jEditorPane2.setBackground(new Color(0, 0, 0, 128));
//        jTextPane1.setBackground(new Color(0, 0, 0, 128));
        parser.updateFeed();
    }
{'fraction_non_alphanumeric': 0.12478390696212478, 'fraction_numerical': 0.011315417256011316, 'mean_word_length': 3.8102796674225248, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '6205799', 'n_tokens_mistral': 2004, 'n_tokens_neox': 1925, 'n_words': 298}