📄 rtextactioninfo.java
字号:
/*
* RTextActionInfo.java - Information on the actions owned by RText.
*/
package org.fife.rtext;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
/**
* An interface containing all information about RText's actions.<p>
*
* Note that these actions do NOT include those owned by
* <code>AbstractMainView</code>.<p>
*
* Since RText extends <code>AbstractGUIApplication</code>, its
* actions are kept in a hash map. Thus, this interface contains the keys
* for all actions, an array of those keys for looping, and the default
* values for accelerators for all of the actions.<p>
*
* @author Robert Futrell
* @verison 0.1
*/
interface RTextActionInfo {
// Constants specifying the available actions (for getAction).
public static final String NEW_ACTION = "newAction";
public static final String OPEN_ACTION = "openAction";
public static final String OPEN_NEWWIN_ACTION = "openNewWinAction";
public static final String OPEN_REMOTE_ACTION = "openRemoteAction";
public static final String SAVE_ACTION = "saveAction";
public static final String SAVE_AS_ACTION = "saveAsAction";
public static final String SAVE_WEBPAGE_ACTION = "saveWebPageAction";
public static final String SAVE_ALL_ACTION = "saveAllAction";
public static final String TIME_DATE_ACTION = "timeDateAction";
public static final String LINE_NUMBER_ACTION = "lineNumberAction";
public static final String HELP_ACTION = "helpAction";
public static final String ABOUT_ACTION = "aboutAction";
public static final String OPTIONS_ACTION = "optionsAction";
/**
* The names of all actions in an array. Note that the order of these
* action names MUST be kept in-synch with the default accelerators
* array below.
*/
public static final String[] actionNames = {
NEW_ACTION,
OPEN_ACTION,
OPEN_NEWWIN_ACTION,
OPEN_REMOTE_ACTION,
SAVE_ACTION,
SAVE_AS_ACTION,
SAVE_WEBPAGE_ACTION,
SAVE_ALL_ACTION,
TIME_DATE_ACTION,
LINE_NUMBER_ACTION,
HELP_ACTION,
ABOUT_ACTION,
OPTIONS_ACTION,
};
static final int defaultModifier = Toolkit.getDefaultToolkit().
getMenuShortcutKeyMask();
/**
* The default accelerator for all RText actions. Note that this
* array MUST be kept in-synch with the actionNames array
* above.
*/
public static final KeyStroke[] defaultActionAccelerators = {
KeyStroke.getKeyStroke(KeyEvent.VK_N, defaultModifier),
KeyStroke.getKeyStroke(KeyEvent.VK_O, defaultModifier),
KeyStroke.getKeyStroke(KeyEvent.VK_I, defaultModifier),
null,
KeyStroke.getKeyStroke(KeyEvent.VK_S, defaultModifier),
null,
null,
null,
KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0),
KeyStroke.getKeyStroke(KeyEvent.VK_1, defaultModifier),
KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0),
null,
null,
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -