设计器右键插件demo。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1011 B

package com.fr.plugin.designer;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UndoableAction;
import com.fr.design.mainframe.FormDesigner;
import com.fr.general.Inter;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* 注意表单和参数面板的右键扩展必须是UndoableAction的子类
*/
public class MyCutAction extends UndoableAction {
public MyCutAction(FormDesigner t) {
this.setName(Inter.getLocText("M_Edit-Cut"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
}
@Override
public void actionPerformed(ActionEvent e) {
System.out.println("3333333");
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
return false;
}
@Override
public void prepare4Undo() {
}
}