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 37 48 public class AddFolder_li implements base_guiListener 49 { 50 59 public void pcmf_execListener(base_guiObj xParam) throws Exception 60 { 61 base_treeView_if l_targetTree = (base_treeView_if)base_registredObject.pcmf_getObjByName("targetTree"); 62 base_optionDlg_if l_dlg = (base_optionDlg_if)base_registredObject.pcmf_getObjByName("optDlg2"); 63 base_appl_if l_appl = xParam.pcmf_getAppl(); 64 String l_name = l_dlg.pcmf_getGuiObj().pcmf_getValue().toString(); 65 MainModel l_model = (MainModel)xParam.pcmf_getAppl().pcmf_getGuiObj().pcmf_getModel(); 66 67 try 68 { 69 base_treeNode l_node = (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_newModelValue("newfolder", false); 70 base_treeNode l_select = (base_treeNode)l_targetTree.pcmf_getValue(); 71 if (l_select != null) 72 { 73 if (l_select.pcmf_getSubNode(l_name) != null) 74 { 75 base_treeNode l_message = (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_newModelValue("errorMsg", false); 76 l_message.pcmf_setName("insert"); 77 l_message.pcmf_setValue("similar node is already available"); 78 79 l_model.pcmf_addMessage(l_message); 80 return; 81 } 82 l_node.pcmf_setValue("new folder://" + l_model.pcmf_getTarget().pcmf_getValue().toString() + "\\" + l_name); 83 l_select.pcmf_addNode(l_name, l_node); 84 l_select.pcmf_unhide(); 85 }; 86 87 l_targetTree.pcmf_repaint(); 88 } 89 catch (Exception e) 90 { 91 base_treeNode l_message = (base_treeNode)l_appl.pcmf_getGuiObj().pcmf_newModelValue("errorMsg", false); 92 l_message.pcmf_setName("selection"); 93 l_message.pcmf_setValue("no insert parent selected"); 94 95 l_model.pcmf_addMessage(l_message); 96 return; 97 }; 98 } 99 } 100 | Popular Tags |