1 package com.genimen.djeneric.tools.generator.ui; 2 3 import java.awt.event.ActionEvent ; 4 import java.awt.event.ActionListener ; 5 6 import javax.swing.JCheckBox ; 7 8 import com.genimen.djeneric.tools.generator.util.ProjectProperties; 9 import com.genimen.djeneric.tools.generator.util.Template; 10 11 public class TemplateCheckBox extends JCheckBox implements ActionListener 12 { 13 private static final long serialVersionUID = 1L; 14 Template _template; 15 ProjectProperties _projectProperties; 16 String _propertyKey; 17 18 public TemplateCheckBox(Template template, ProjectProperties props) 19 { 20 super(template.getModuleName()); 21 _template = template; 22 _projectProperties = props; 23 24 _propertyKey = template.getModuleName(); 25 setSelected(props.isTemplateEnabled(_propertyKey)); 26 27 addActionListener(this); 28 setToolTipText(_template.getLocation()); 29 } 30 31 public void actionPerformed(ActionEvent e) 32 { 33 _projectProperties.enableTemplate(_propertyKey, isSelected()); 34 } 35 36 public Template getTemplate() 37 { 38 return _template; 39 } 40 } | Popular Tags |