1 14 15 package org.quickserver.net.qsadmin.gui; 16 17 import java.awt.event.ActionListener ; 18 import java.awt.event.ActionEvent ; 19 20 public class SimpleActionListener implements ActionListener { 21 private SimpleCommand sm; 22 private MainCommandPanel mcp; 23 private QSAdminMain qsadminMain; 24 25 public SimpleActionListener(QSAdminMain qsadminMain, SimpleCommand sm, 26 MainCommandPanel mcp) { 27 this.qsadminMain = qsadminMain; 28 this.sm = sm; 29 this.mcp = mcp; 30 } 31 public void actionPerformed(ActionEvent e) { 32 Thread performer = new Thread (new Runnable () { 33 public void run() { 34 sm.setTarget(mcp.getTarget()); 35 boolean multiLine = sm.getMultiLineResponse().equals("yes"); 36 if(qsadminMain.getServerVersionNo()>=sm.getVersionNo()) { 37 qsadminMain.sendCommunication(sm.getSimpleCommand(), 38 multiLine, true); 39 } else { 40 qsadminMain.getGUI().setResponse("-ERR "+"Host does not support this command"); 41 } 42 } 43 }, "QsAdminGUI-SimpleThread"); 44 performer.start(); 45 } 46 } 47 | Popular Tags |