1 16 17 package packager.listeners; 18 19 import Jmc.baseGui.*; 20 import Jmc.baseTools.*; 21 import Jmc.commonGui.*; 22 import Jmc.model.*; 23 24 import java.util.*; 25 26 import packager.model.*; 27 28 38 62 public class AddFile_li implements base_guiListener 63 { 64 73 public void pcmf_execListener(base_guiObj xParam) throws Exception 74 { 75 base_table_if l_stable = (base_table_if)base_registredObject.pcmf_getObjByName("sourceTable"); 77 78 MainModel l_model = (MainModel)xParam.pcmf_getAppl().pcmf_getGuiObj().pcmf_getModel(); 80 81 base_appl_if l_appl = xParam.pcmf_getAppl(); 83 84 if (l_model.pcmf_getTarget() == null || l_model.pcmf_getTarget().pcmf_getValue().toString().trim().equals("")) 86 { 87 90 104 base_treeNode l_message = (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_newModelValue("errorMsg", false); 105 l_message.pcmf_setName("selection"); 106 l_message.pcmf_setValue("no copy target selected"); 107 108 l_model.pcmf_addMessage(l_message); 110 return; 111 } 112 113 base_multipleModelValue_if l_node = null; 115 base_singleModelValue_if l_target = null; 116 base_singleModelValue_if l_source = null; 117 base_singleModelValue_if l_type = null; 118 119 ArrayList l_select = l_stable.pcmf_getSelectedTableRows(); 121 Iterator l_it = l_select.iterator(); 122 ArrayList l_row = null; 123 124 if (l_it.hasNext() == false) 126 { 127 base_treeNode l_message = (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_newModelValue("errorMsg", false); 129 l_message.pcmf_setName("selection"); 130 l_message.pcmf_setValue("no copy source selected"); 131 132 l_model.pcmf_addMessage(l_message); 133 return; 134 } 135 do 136 { 137 l_row = (ArrayList)l_it.next(); 139 l_node = (base_multipleModelValue_if)l_appl.pcmf_getGuiObj().pcmf_newModelValue("copyNode", true); 140 l_target = (base_singleModelValue_if)l_node.pcmf_getModelValue("target"); 141 l_source = (base_singleModelValue_if)l_node.pcmf_getModelValue("source"); 142 l_type = (base_singleModelValue_if)l_node.pcmf_getModelValue("type"); 143 144 l_target.pcmf_setValueValidate(l_model.pcmf_getTarget()); 145 l_source.pcmf_setValueValidate(l_row.get(0)); 146 147 l_type.pcmf_setValueValidate(((base_modelValue_if)l_model.pcmf_getTarget()).pcmf_getMyTemplate()); 148 149 l_model.pcmf_addCopyNode(l_node); 150 } 151 while (l_it.hasNext()); 152 153 l_model.pcmf_updateTargetView(); 155 } 156 } 157 | Popular Tags |