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.common.PathHandle; 30 import org.enhydra.tool.common.wizard.TBWizardPanel; 31 32 import javax.swing.JPanel ; 34 import java.io.File ; 35 import java.lang.ref.WeakReference ; 36 import java.util.ResourceBundle ; 37 38 44 public class ArchivePanel extends TBWizardPanel { 45 private WeakReference wizardRef = null; 46 47 51 public ArchivePanel() { 52 super(); 53 } 54 55 62 public String getPageTitle() { 63 return "ARCHIVE PAGE TITLE"; 64 } 65 66 73 public void readPlan(JarPlan plan) throws ArchiveException { 74 ArchiveException e = 75 new ArchiveException("ArchivePanel::readPlan"); 77 e.printStackTrace(); 78 throw e; 79 } 80 81 88 public void writePlan(JarPlan plan) throws ArchiveException { 89 ArchiveException e = 90 new ArchiveException("ArchivePanel::writePlan"); 92 e.printStackTrace(); 93 throw e; 94 } 95 96 103 public void validatePlan() throws ArchiveException { 104 ArchiveException e = 105 new ArchiveException("ArchivePanel::validatePlan"); 107 e.printStackTrace(); 108 throw e; 109 } 110 111 protected String getWorkingRoot() { 112 String root = null; 113 if (getWizard() == null) { 114 root = System.getProperty("user.dir"); 115 } else { 116 root = getWizard().getWorkingRoot(); 117 } 118 return root; 119 } 120 121 protected void setWorkingRoot(String root) { 122 if (getWizard() != null) { 123 getWizard().setWorkingRoot(root); 124 } 125 } 126 127 protected void preparePanel() {} 128 129 protected ArchiveWizard getWizard() { 130 ArchiveWizard wizard = null; 131 132 if (wizardRef != null) { 133 wizard = (ArchiveWizard) wizardRef.get(); 134 } 135 return wizard; 136 } 137 138 protected void setWizard(ArchiveWizard wizard) { 139 wizardRef = new WeakReference (wizard); 140 } 141 142 143 } 144 | Popular Tags |