📄 linenumberaction.java
字号:
/*
* LineNumberAction.java - Action to enable/disable line numbers in RText.
*/
package org.fife.rtext;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import javax.swing.KeyStroke;
/**
* Action used by an <code>AbstractMainView</code> to enable viewing
* line numbers for the open documents.
*/
class LineNumberAction extends AbstractAction {
private RText owner;
/*****************************************************************************/
/**
* Creates a new <code>LineNumberAction</code>.
*
* @param text The text associated with the action.
* @param icon The icon associated with the action.
* @param desc The description of the action (used in tooltips???).
* @param mnemonic The mnemonic for the action.
* @param accelerator The accelerator key for the action.
* @param owner The rtext window that owns this action.
*/
public LineNumberAction(String text, ImageIcon icon, String desc,
Integer mnemonic, KeyStroke accelerator, RText owner) {
super(text, icon);
putValue(ACCELERATOR_KEY, accelerator);
putValue(SHORT_DESCRIPTION, desc);
putValue(MNEMONIC_KEY, mnemonic);
this.owner = owner;
}
/*****************************************************************************/
// Callback routine called when user uses this component.
public void actionPerformed(ActionEvent e) {
AbstractMainView mainView = owner.getMainView();
mainView.setLineNumbersEnabled(!mainView.getLineNumbersEnabled());
}
/*****************************************************************************/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -