1 19 20 package org.netbeans.modules.javawebstart; 21 22 import java.util.Map ; 23 24 import javax.swing.JComponent ; 25 26 import org.netbeans.api.project.Project; 27 28 import org.netbeans.modules.java.j2seproject.api.J2SERunConfigProvider; 29 import org.netbeans.modules.java.j2seproject.api.J2SEPropertyEvaluator; 30 31 import org.netbeans.modules.javawebstart.ui.customizer.JWSCustomizerPanel; 32 33 import org.netbeans.spi.project.support.ant.PropertyEvaluator; 34 35 39 public class J2SERunConfigProviderImpl implements J2SERunConfigProvider { 40 41 public J2SERunConfigProviderImpl() {} 42 43 public JComponent createComponent(Project p, J2SERunConfigProvider.ConfigChangeListener listener) { 44 J2SEPropertyEvaluator j2sePropEval = p.getLookup().lookup(J2SEPropertyEvaluator.class); 45 PropertyEvaluator evaluator = j2sePropEval.evaluator(); 46 String enabled = evaluator.getProperty("jnlp.enabled"); 47 JWSCustomizerPanel.runComponent.addListener(listener); 48 if ("true".equals(enabled)) { 49 JWSCustomizerPanel.runComponent.setCheckboxEnabled(true); 50 JWSCustomizerPanel.runComponent.setHintVisible(false); 51 } else { 52 JWSCustomizerPanel.runComponent.setCheckboxEnabled(false); 53 JWSCustomizerPanel.runComponent.setHintVisible(true); 54 } 55 return JWSCustomizerPanel.runComponent; 56 } 57 58 public void configUpdated(Map <String ,String > m) { 59 if ((m.get("$target.run") != null) && (m.get("$target.debug") != null)) { 60 JWSCustomizerPanel.runComponent.setCheckboxSelected(true); 61 } else { 62 JWSCustomizerPanel.runComponent.setCheckboxSelected(false); 63 } 64 } 65 66 } 67 | Popular Tags |