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 DesignTab 33 extends BluePrintsTabPanel 34 { 35 36 37 public DesignTab(BluePrintsPanel bluePrintsPanel) { 38 super(bluePrintsPanel); 39 initComponents(); 40 } 41 42 47 private void initComponents() { 49 designBrowser = new HtmlBrowserWithScrollPosition(); 50 51 setLayout(new java.awt.BorderLayout ()); 52 53 add(designBrowser, java.awt.BorderLayout.CENTER); 54 55 } 56 58 59 private javax.swing.JPanel designBrowser; 61 63 public void setScrollPosition(int scrollPosition) { 64 ((HtmlBrowserWithScrollPosition)designBrowser). 65 setScrollPosition(scrollPosition); 66 } 67 68 public int getScrollPosition() { 69 return ((HtmlBrowserWithScrollPosition)designBrowser). 70 getScrollPosition(); 71 } 72 73 public void updateTab() { 74 Nbcategory category = bluePrintsPanel.getSelectedCategory(); 75 Nbsolution solution = bluePrintsPanel.getSelectedArticle(); 76 if(solution != null) { 77 Nbwriteup writeup = solution.getNbwriteup(); 78 if((writeup.getDesigndocPath() != null) && (! writeup.getDesigndocPath().trim().equals(""))){ 79 String designURLString = BluePrintsPanel.CATALOG_RESOURCES_URL 80 + "/" + writeup.getDesigndocPath(); BpcatalogLocalizedResource htmlrsc = 82 new BpcatalogLocalizedResource(designURLString, "html"); 83 URL designURL = htmlrsc.getResourceURL(); 84 87 ((HtmlBrowserWithScrollPosition)designBrowser).setURL( 88 designURL); 89 } 90 } 91 } 92 } 93 | Popular Tags |