📄 menuhandler.java
字号:
/* * Created on 24-feb-2004 * * To change the template for this generated file go to Window - Preferences - * Java - Code Generation - Code and Comments */package javatunnel.gui;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.*;import javatunnel.*;/** * @author utopio * * To change the template for this generated type comment go to Window - * Preferences - Java - Code Generation - Code and Comments */public class MenuHandler implements ActionListener { JFrame parent; public MenuHandler(JFrame frame) { parent = frame; } /* * (non-Javadoc) * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent action) { if (action.getActionCommand().equals("Exit")) { Engine.cleanHostsFile(); parent.dispose(); System.exit(0); } if (action.getActionCommand().equals("Redirect")) { System.out.println("Creando redirect"); new NewRedirectDialog(parent); } if (action.getActionCommand().equals("SSL Proxy")) { System.out.println("Creando SSL Proxy"); new NewSSLProxyDialog(parent); } if (action.getActionCommand().equals("Stop")) { System.out.println("Peticion de parada"); stop(); } } private void stop() { if (GraphicalClient.list.getSelectedIndices().length == 1) { Worker selected = (Worker) GraphicalClient.list.getSelectedValue(); selected.shutdownWorker(); ((DefaultListModel) GraphicalClient.list.getModel()).removeElement(selected); //just in case we remove all the list elements and the splitPane colapses to the list side GraphicalClient.splitPane.setDividerLocation(200); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -