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 26 32 public class CategoryTab 33 extends BluePrintsTabPanel 34 { 35 36 public CategoryTab(BluePrintsPanel bluePrintsPanel) { 37 super(bluePrintsPanel); 38 initComponents(); 39 } 40 41 46 private void initComponents() { 48 categoryBrowser = new HtmlBrowserWithScrollPosition(); 49 50 setLayout(new java.awt.BorderLayout ()); 51 52 add(categoryBrowser, java.awt.BorderLayout.CENTER); 53 54 } 55 57 58 private javax.swing.JPanel categoryBrowser; 60 62 public void setScrollPosition(int scrollPosition) { 63 ((HtmlBrowserWithScrollPosition)categoryBrowser). 64 setScrollPosition(scrollPosition); 65 } 66 67 public int getScrollPosition() { 68 return ((HtmlBrowserWithScrollPosition)categoryBrowser). 69 getScrollPosition(); 70 } 71 72 public void updateTab() { 73 Nbcategory category = bluePrintsPanel.getSelectedCategory(); 74 Nbsolution solution = bluePrintsPanel.getSelectedArticle(); 75 if(solution == null) { 76 String articleURLString = BluePrintsPanel.CATALOG_RESOURCES_URL 77 + "/descriptions/category-" + category.getId() + ".html"; BpcatalogLocalizedResource htmlrsc = 79 new BpcatalogLocalizedResource(articleURLString, "html"); 80 URL articleURL = htmlrsc.getResourceURL(); 81 ((HtmlBrowserWithScrollPosition)categoryBrowser).setURL( 82 articleURL); 83 } 84 } 85 } 86 | Popular Tags |