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);
|
}
|
|
}
|