1 2 24 package org.enhydra.tool.archive.wizard; 25 26 import org.enhydra.tool.archive.ArchiveException; 28 import org.enhydra.tool.archive.JarPlan; 29 import org.enhydra.tool.archive.WarPlan; 30 31 import java.awt.*; 33 import java.beans.Beans ; 34 import java.io.File ; 35 import javax.swing.*; 36 37 public class LibraryPanel extends ArchivePanel { 39 private BorderLayout layoutMain = null; 40 private OneColumnFileSelector selectorPanel = null; 41 42 public LibraryPanel() { 43 try { 44 jbInit(); 45 } catch (Exception ex) { 46 ex.printStackTrace(); 47 } 48 } 49 50 public void readPlan(JarPlan plan) throws ArchiveException { 51 selectorPanel.setSelections(plan.getLibFiles()); 52 } 53 54 public void writePlan(JarPlan plan) throws ArchiveException { 55 plan.setLibFiles(selectorPanel.getSelections()); 56 } 57 58 public String getPageTitle() { 59 return "Libraries"; 60 } 61 62 public String getInstructions() { 63 StringBuffer buf = new StringBuffer (); 64 65 buf.append("Select libraries to include in archive"); 66 return buf.toString(); 67 } 68 69 protected void setWizard(ArchiveWizard wizard) { 71 super.setWizard(wizard); 72 selectorPanel.setWizard(wizard); 73 } 74 75 private void jbInit() throws Exception { 76 layoutMain = 77 (BorderLayout) Beans.instantiate(getClass().getClassLoader(), 78 BorderLayout.class.getName()); 79 selectorPanel = 80 (OneColumnFileSelector) Beans.instantiate(getClass().getClassLoader(), 81 OneColumnFileSelector.class.getName()); 82 this.setLayout(layoutMain); 83 this.add(selectorPanel, BorderLayout.CENTER); 84 } 85 86 } 87 | Popular Tags |