1 19 20 package org.netbeans.modules.j2ee.blueprints.ui; 21 22 import java.net.URL ; 23 import org.netbeans.modules.j2ee.blueprints.catalog.bpcatalogxmlparser.Nbcategory; 24 import org.netbeans.modules.j2ee.blueprints.catalog.bpcatalogxmlparser.Nbsolution; 25 import org.netbeans.modules.j2ee.blueprints.catalog.bpcatalogxmlparser.Nbwriteup; 26 27 32 public class SolutionTab 33 extends BluePrintsTabPanel 34 { 35 36 public SolutionTab(BluePrintsPanel bluePrintsPanel) { 37 super(bluePrintsPanel); 38 initComponents(); 39 } 40 41 46 private void initComponents() { 48 solutionBrowser = new HtmlBrowserWithScrollPosition(); 49 50 setLayout(new java.awt.BorderLayout ()); 51 52 add(solutionBrowser, java.awt.BorderLayout.CENTER); 53 54 } 55 57 58 private javax.swing.JPanel solutionBrowser; 60 62 public void setScrollPosition(int scrollPosition) { 63 ((HtmlBrowserWithScrollPosition)solutionBrowser). 64 setScrollPosition(scrollPosition); 65 } 66 67 public int getScrollPosition() { 68 return ((HtmlBrowserWithScrollPosition)solutionBrowser). 69 getScrollPosition(); 70 } 71 72 public void updateTab() { 73 Nbcategory category = bluePrintsPanel.getSelectedCategory(); 74 Nbsolution solution = bluePrintsPanel.getSelectedArticle(); 75 if(solution != null) { 76 Nbwriteup writeup = solution.getNbwriteup(); 77 String articleURLString = BluePrintsPanel.CATALOG_RESOURCES_URL 78 + "/" + writeup.getArticlePath(); BpcatalogLocalizedResource htmlrsc = 80 new BpcatalogLocalizedResource(articleURLString, "html"); 81 URL articleURL = htmlrsc.getResourceURL(); 82 85 ((HtmlBrowserWithScrollPosition)solutionBrowser).setURL( 86 articleURL); 87 } 88 } 89 } 90 | Popular Tags |