1 2 24 package org.enhydra.tool.codegen.wizard; 25 26 import org.enhydra.tool.ToolBoxInfo; 28 import org.enhydra.tool.codegen.CodeGen; 29 import org.enhydra.tool.codegen.ProjectOptionSet; 30 import org.enhydra.tool.codegen.GeneratorOption; 31 import org.enhydra.tool.codegen.GeneratorException; 32 import org.enhydra.tool.codegen.ValidationException; 33 34 import javax.swing.*; 36 import javax.swing.border.*; 37 import javax.swing.event.*; 38 import java.awt.*; 39 import java.awt.event.ActionEvent ; 40 import java.awt.event.ActionListener ; 41 import java.beans.*; 42 import java.io.File ; 43 import java.io.FileFilter ; 44 import java.util.ResourceBundle ; 45 46 51 public class ProjectOptionPanel3 extends CodeGenPanel { 52 53 56 59 transient public JPanel panelCheck; 60 61 64 transient public JCheckBox checkCLI; 65 66 transient private GridBagLayout layoutMain; 68 transient private GridBagLayout layoutDest; 69 transient private JPanel panelFiller; 70 71 75 public ProjectOptionPanel3() { 76 try { 77 jbInit(); 78 pmInit(); 79 } catch (Exception ex) { 80 ex.printStackTrace(); 81 } 82 } 83 84 91 public void readOptionSet() throws GeneratorException { 92 GeneratorOption option = null; 93 94 option = getOptionSet().lookup(ProjectOptionSet.NOCLI); 96 checkCLI.setSelected(!option.isValue()); 97 98 } 99 100 107 public void writeOptionSet() throws GeneratorException { 108 boolean bVal = false; 109 String sVal = new String (); 110 111 bVal = checkCLI.isSelected(); 113 getOptionSet().lookup(ProjectOptionSet.NOCLI).setValue(!bVal); 114 } 115 116 124 public void validateOptionSet() throws ValidationException {} 125 126 132 public String getPageTitle() { 133 return res.getString("Supplemental_Files"); 134 } 135 136 143 public String getInstructions() { 144 StringBuffer buf = new StringBuffer (); 145 146 buf.append(res.getString("InstructSub1")); 147 buf.append(res.getString("InstructSub2")); 148 buf.append(res.getString("InstructSub3")); 149 return buf.toString(); 150 } 151 152 private void jbInit() throws Exception { 156 panelCheck = (JPanel) Beans.instantiate(getClass().getClassLoader(), 157 JPanel.class.getName()); 158 layoutDest = 159 (GridBagLayout) Beans.instantiate(getClass().getClassLoader(), 160 GridBagLayout.class.getName()); 161 layoutMain = 162 (GridBagLayout) Beans.instantiate(getClass().getClassLoader(), 163 GridBagLayout.class.getName()); 164 panelFiller = (JPanel) Beans.instantiate(getClass().getClassLoader(), 165 JPanel.class.getName()); 166 checkCLI = (JCheckBox) Beans.instantiate(getClass().getClassLoader(), 167 JCheckBox.class.getName()); 168 panelCheck.setLayout(layoutDest); 169 checkCLI.setSelected(true); 170 checkCLI.setText(res.getString("Create_CLI")); 171 panelCheck.add(checkCLI, 172 new GridBagConstraints(0, 0, 1, 1, 0.1, 0.1, 173 GridBagConstraints.WEST, 174 GridBagConstraints.HORIZONTAL, 175 new Insets(5, 10, 2, 5), 0, 0)); 176 this.setLayout(layoutMain); 177 this.add(panelCheck, 178 new GridBagConstraints(0, 1, 2, 1, 0.1, 0.1, 179 GridBagConstraints.CENTER, 180 GridBagConstraints.BOTH, 181 new Insets(5, 5, 5, 5), 0, 0)); 182 this.add(panelFiller, 183 new GridBagConstraints(0, 2, 2, 1, 0.4, 0.4, 184 GridBagConstraints.CENTER, 185 GridBagConstraints.BOTH, 186 new Insets(0, 0, 0, 0), 0, 0)); 187 } 188 189 private void pmInit() { 190 checkCLI.setSelected(true); 191 } 192 193 } 194 | Popular Tags |