1 17 18 package Raptor.listeners; 19 20 import java.util.*; 21 22 import Jmc.baseGui.*; 23 import Jmc.commonGui.*; 24 import Jmc.model.*; 25 import Jmc.baseTools.*; 26 27 import Raptor.model.*; 28 29 30 39 public class quickEdit_li implements base_guiListener 40 { 41 44 public quickEdit_li() 45 { 46 } 47 48 58 public void pcmf_execListener(base_guiObj xParam) throws Exception 59 { 60 base_appl_if l_appl = xParam.pcmf_getAppl(); 61 raptor_mainModel l_model = (raptor_mainModel)l_appl.pcmf_getGuiObj().pcmf_getModel(); 62 63 base_treeNode l_mVal = l_model.getPem_treeNodeSelection(); 64 65 if (l_mVal != null && l_mVal instanceof base_multipleModelValue_if == false) 66 { 67 base_singleModelValue_if l_iv = (base_singleModelValue_if)l_mVal.pcmf_getValue(); 68 69 if (l_iv.pcmf_getValue() != null && l_iv.pcmf_getValue().equals(xParam.pcmf_getValue().toString())) 70 { 71 xParam.pcmf_setBgColor("white"); 72 return; 73 } 74 75 if (l_iv.pcmf_getUiMap() != null && l_iv.pcmf_getUiMap() instanceof base_comboBox_if) 76 { 77 if (((base_comboBox_if)l_iv.pcmf_getUiMap()).pcmf_getValues().get(xParam.pcmf_getValue().toString()) == null) 78 { 79 xParam.pcmf_setBgColor("red"); 80 String l_values = ""; 81 82 Iterator l_it = ((base_comboBox_if)l_iv.pcmf_getUiMap()).pcmf_getValues().keySet().iterator(); 83 while (l_it.hasNext()) 84 { 85 l_values += l_it.next().toString(); 86 if (l_it.hasNext()) 87 l_values +=", "; 88 } 89 90 l_model.pcmf_addMessage("- parameter error, must be: " + l_values, raptor_mainModel.RAPTOR_ERROR); 91 return; 92 } 93 } 94 95 Object l_ret = l_iv.pcmf_setValueValidate(xParam.pcmf_getValue().toString()); 96 97 if (l_ret != null && l_ret.equals(xParam.pcmf_getValue()) == false) 98 xParam.pcmf_setBgColor("white"); 99 else 100 { 101 xParam.pcmf_setBgColor("red"); 102 l_model.pcmf_addMessage("- parameter error", raptor_mainModel.RAPTOR_ERROR); 103 return; 104 } 105 106 l_iv.pcmf_model2UI(); 107 l_model.pcmf_createAutoWdgPreview(); 108 l_appl.pcmf_getGuiObj().pcmf_repaint(); 109 } 110 } 111 } 112 | Popular Tags |