📄 popupactionmenuitem.java
字号:
package org.jawin.browser.popup;
import javax.swing.JMenuItem;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.jawin.browser.tree.TypeDataTree;
/**
* A JMenuItem that knows how to display and handle PopupAction
* instances.
*
* <p>Title: Jawin Code Generation GUI</p>
* <p>Description: GUI for exploring type libraries and generating Java code</p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: Open Source Incentive</p>
*
* @author Josh Passenger
* @version 1.0
*/
public class PopupActionMenuItem extends JMenuItem
{
private PopupAction popupAction = null;
public PopupActionMenuItem(PopupAction newPopupAction)
{
popupAction = newPopupAction;
setText(popupAction.getDisplay());
registerListeners();
}
/**
* Register a listeners so that when this menu item is clicked,
* the popupAction fires
*/
private void registerListeners()
{
addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
popupAction.performAction(PopupManager.getInstance().getSelectedBaseData());
};
});
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -