diff --git a/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/Bundle.properties b/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/Bundle.properties index 376e4777d..dbf82e97d 100644 --- a/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/Bundle.properties +++ b/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/Bundle.properties @@ -4,3 +4,6 @@ OpenIDE-Module-Long-Description=\ OpenIDE-Module-Name=Welcome Screen OpenIDE-Module-Short-Description=The jMonkeyEngine GDE Welcome Screen WelcomeScreenTopComponent.jTextPane1.border.title=Latest jMonkeyEngine News +WelcomeScreenTopComponent.http.link=http://jmonkeyengine.org/wiki/doku.php/sdk:welcome:3_0rc3?do=export_xhtmlbody +WelcomeScreenTopComponent.rss.link=http://jmonkeyengine.org/feed/rdf/ +WelcomeScreenTopComponent.local.link=nbres:/com/jme3/gde/core/docs/core-about.html diff --git a/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.form b/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.form index db4dc27b2..549d36eb4 100644 --- a/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.form +++ b/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.form @@ -87,6 +87,7 @@ + diff --git a/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.java b/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.java index 1a9093330..59d7953a5 100644 --- a/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.java +++ b/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.java @@ -9,7 +9,6 @@ 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; @@ -41,7 +40,7 @@ preferredID = "WelcomeScreenTopComponent") }) 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"); + private final RssFeedParser parser = new RssFeedParser(org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.rss.link"));//"http://www.chip.de/rss/rss_tests.xml"); public WelcomeScreenTopComponent() { initComponents(); @@ -49,7 +48,7 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp jScrollPane2.getViewport().setOpaque(false); jScrollPane3.setOpaque(false); jScrollPane3.getViewport().setOpaque(false); - + setName(Bundle.CTL_WelcomeScreenTopComponent()); setToolTipText(Bundle.HINT_WelcomeScreenTopComponent()); @@ -58,23 +57,6 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp 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(); } /** @@ -99,7 +81,7 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp jScrollPane3.setOpaque(false); jTextPane1.setEditable(false); - jTextPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.jTextPane1.border.title"))); // NOI18N + jTextPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.jTextPane1.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Lucida Grande", 1, 13))); // NOI18N jTextPane1.setFont(new java.awt.Font("Lucida Grande", 2, 12)); // NOI18N jTextPane1.setForeground(new java.awt.Color(0, 0, 204)); jTextPane1.setCaretColor(new java.awt.Color(255, 255, 255)); @@ -146,7 +128,6 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JEditorPane jEditorPane1; private javax.swing.JPanel jPanel1; @@ -157,7 +138,16 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp @Override public void componentOpened() { - // TODO add custom code on component opening + try { + jEditorPane1.setPage(new URL(org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.http.link"))); + } catch (IOException ex) { + try { + jEditorPane1.setPage(new URL(org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.local.link"))); + } catch (IOException ex1) { + Exceptions.printStackTrace(ex1); + } + } + parser.updateFeed(); } @Override diff --git a/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/rss/RssFeedParser.java b/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/rss/RssFeedParser.java index dd87a746d..61cc0426f 100644 --- a/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/rss/RssFeedParser.java +++ b/sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/rss/RssFeedParser.java @@ -62,24 +62,24 @@ public class RssFeedParser { public void run() { List msgs = feed.getMessages(); try { + doc.remove(0, doc.getLength()); for (FeedMessage feedMessage : msgs) { - //AttributeSet set = new SimpleAttributeSet(); ekit.insertHTML(doc, doc.getLength(), "

" + feedMessage.getTitle() - + "", + + "

", 0, 0, - HTML.Tag.H3); + null); // ekit.insertHTML(doc, doc.getLength(), // "

" // + feedMessage.getDescription() -// + "", +// + "

", // 0, // 0, -// HTML.Tag.P); +// null); ekit.insertHTML(doc, doc.getLength(), "
", 0,