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.internal.ServiceOptionSet; 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 ServiceOptionPanel3 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 transient private JCheckBox checkMBean; 71 72 76 public ServiceOptionPanel3() { 77 try { 78 jbInit(); 79 pmInit(); 80 } catch (Exception ex) { 81 ex.printStackTrace(); 82 } 83 } 84 85 92 public void readOptionSet() throws GeneratorException { 93 GeneratorOption option = null; 94 95 option = getOptionSet().lookup(ServiceOptionSet.NOCLI); 97 checkCLI.setSelected(!option.isValue()); 98 99 option = getOptionSet().lookup(ServiceOptionSet.MBEAN); 101 checkMBean.setSelected(option.isValue()); 102 103 104 } 105 106 113 public void writeOptionSet() throws GeneratorException { 114 boolean bool = false; 115 116 bool = checkCLI.isSelected(); 118 getOptionSet().lookup(ServiceOptionSet.NOCLI).setValue(!bool); 119 120 bool = checkMBean.isSelected(); 122 getOptionSet().lookup(ServiceOptionSet.MBEAN).setValue(bool); 123 124 125 } 126 127 135 public void validateOptionSet() throws ValidationException {} 136 137 143 public String getPageTitle() { 144 return res.getString("Supplemental_Files"); 145 } 146 147 154 public String getInstructions() { 155 StringBuffer buf = new StringBuffer (); 156 157 buf.append("The build.xml lets you compile the service source files "); 158 buf.append("and build an archive with the "); 159 buf.append("<eas_root>/bin/ant script. "); 160 buf.append("Select MBeans support to provide you service with "); 161 buf.append("qualifiers for the Lutris EAS management infrastructure."); 162 return buf.toString(); 163 } 164 165 private void jbInit() throws Exception { 169 panelCheck = (JPanel) Beans.instantiate(getClass().getClassLoader(), 170 JPanel.class.getName()); 171 layoutDest = 172 (GridBagLayout) Beans.instantiate(getClass().getClassLoader(), 173 GridBagLayout.class.getName()); 174 layoutMain = 175 (GridBagLayout) Beans.instantiate(getClass().getClassLoader(), 176 GridBagLayout.class.getName()); 177 panelFiller = (JPanel) Beans.instantiate(getClass().getClassLoader(), 178 JPanel.class.getName()); 179 checkCLI = (JCheckBox) Beans.instantiate(getClass().getClassLoader(), 180 JCheckBox.class.getName()); 181 checkMBean = 182 (JCheckBox) Beans.instantiate(getClass().getClassLoader(), 183 JCheckBox.class.getName()); 184 185 panelCheck.setLayout(layoutDest); 186 checkCLI.setSelected(true); 187 checkCLI.setText("Generate build.xml to compile with ant"); 188 checkMBean.setSelected(true); 189 checkMBean.setText("Generate MBean support classes"); 190 191 panelCheck.add(checkCLI, 192 new GridBagConstraints(0, 0, 1, 1, 0.1, 0.1, 193 GridBagConstraints.WEST, 194 GridBagConstraints.HORIZONTAL, 195 new Insets(5, 10, 2, 5), 0, 0)); 196 panelCheck.add(checkMBean, new GridBagConstraints(0, 1, 1, 1, 0.1, 0.1 197 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 10, 2, 5), 0, 0)); 198 199 this.setLayout(layoutMain); 200 this.add(panelCheck, 201 new GridBagConstraints(0, 1, 2, 1, 0.1, 0.1, 202 GridBagConstraints.CENTER, 203 GridBagConstraints.BOTH, 204 new Insets(5, 5, 5, 5), 0, 0)); 205 this.add(panelFiller, 206 new GridBagConstraints(0, 2, 2, 1, 0.4, 0.4, 207 GridBagConstraints.CENTER, 208 GridBagConstraints.BOTH, 209 new Insets(0, 0, 0, 0), 0, 0)); 210 } 211 212 private void pmInit() { 213 checkCLI.setSelected(true); 214 checkMBean.setSelected(true); 215 } 216 217 } 218 | Popular Tags |