1 16 17 package packager.listeners; 18 19 import Jmc.baseGui.*; 20 import Jmc.baseTools.*; 21 import Jmc.commonGui.*; 22 23 import packager.model.*; 24 25 38 public class AddZip_li implements base_guiListener 39 { 40 49 public void pcmf_execListener(base_guiObj xParam) throws Exception 50 { 51 base_treeView_if l_targetTree = (base_treeView_if)base_registredObject.pcmf_getObjByName("targetTree"); 52 base_optionDlg_if l_dlg = (base_optionDlg_if)base_registredObject.pcmf_getObjByName("optDlg1"); 53 base_appl_if l_appl = xParam.pcmf_getAppl(); 54 String l_name = l_dlg.pcmf_getGuiObj().pcmf_getValue().toString(); 55 MainModel l_model = (MainModel)xParam.pcmf_getAppl().pcmf_getGuiObj().pcmf_getModel(); 56 57 try 58 { 59 base_treeNode l_node = (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_newModelValue("newcontainer", false); 60 base_treeNode l_select = (base_treeNode)l_targetTree.pcmf_getValue(); 61 if (l_select != null) 62 { 63 if (l_select.pcmf_getSubNode(l_name) != null) 64 { 65 base_treeNode l_message = (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_newModelValue("errorMsg", false); 66 l_message.pcmf_setName("insert"); 67 l_message.pcmf_setValue("similar node is already available"); 68 69 l_model.pcmf_addMessage(l_message); 70 return; 71 } 72 l_node.pcmf_setValue("new zip://" + l_model.pcmf_getTarget().pcmf_getValue().toString() + "\\" + l_name); 73 l_select.pcmf_addNode(l_name, l_node); 74 l_select.pcmf_unhide(); 75 }; 76 77 l_targetTree.pcmf_repaint(); 78 } 79 catch (Exception e) 80 { 81 base_treeNode l_message = (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_newModelValue("errorMsg", false); 82 l_message.pcmf_setName("selection"); 83 l_message.pcmf_setValue("no insert parent selected"); 84 85 l_model.pcmf_addMessage(l_message); 86 return; 87 }; 88 89 }; 90 } 91 | Popular Tags |