ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.vci.client.omd.btm.ui;
 
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
 
import com.vci.client.LogonApplication;
import com.vci.client.omd.btm.wrapper.BtmItemWrapper;
import com.vci.client.ui.swing.VCIOptionPane;
 
public class SetIndexActionListener implements ActionListener{
    private JTree btmTree;
    public SetIndexActionListener(JTree btmTree){
        this.btmTree = btmTree;
    }
    
    @Override
    public void actionPerformed(ActionEvent e) {
        DefaultMutableTreeNode seletionNode = (DefaultMutableTreeNode) btmTree.getLastSelectedPathComponent();
        if(seletionNode==null){
            VCIOptionPane.showMessage(LogonApplication.frame, "请选择业务类型节点");
            return;
        }
        String btName = "";
        Object userObject = seletionNode.getUserObject();
        if(userObject instanceof String){
            VCIOptionPane.showMessage(LogonApplication.frame, "请选择业务类型节点");
            return;
        }
        if(userObject instanceof BtmItemWrapper){
            btName = ((BtmItemWrapper)userObject).btmItem.name;
        }
        SetIndexDialog sid = new SetIndexDialog(userObject,btName);
    }
 
}