📄 parentpopupmenu.java
字号:
package com.icbcsdc.ddlexp.ui.popMenu;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLNode;
import com.icbcsdc.ddlexp.ui.TreeFrame;
/**
* @author zhangyc
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
public class ParentPopupMenu extends PopupMenu {
JMenuItem expDDLItem =null;
JMenuItem refreshItem =null;
JPopupMenu popup = new JPopupMenu();
TreeFrame parent=null;
/**
* Constructor for ParentPopupMenu.
* @param node
*/
public ParentPopupMenu(TreeFrame parent,XMLNode node) {
super(node);
this.parent=parent;
}
protected void init(){
expDDLItem=new JMenuItem("Export "+this.node.getName());
refreshItem=new JMenuItem("Refresh "+this.node.getName());
expDDLItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
expDDL();
}
});
refreshItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
refreshNode();
}
});
popup.add(expDDLItem);
popup.add(refreshItem);
}
/**
* @see com.icbcsdc.ddlexp.ui.popMenu.PopupMenu#getJPopupMenu()
*/
public JPopupMenu getJPopupMenu() {
init();
return popup;
}
public void expDDL(){
parent.getSelectedTree().selectedNodeExport();
}
public void refreshNode(){
parent.getSelectedTree().selectedNodeRefresh();
}
/**
* Returns the parent.
* @return TreeFrame
*/
public TreeFrame getTreeFrame() {
return parent;
}
public static void main(String[] args) {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -