📄 searchtoolbaraction.java
字号:
/*
* SearchToolBarAction.java - Toggles the visibility of the QuickSearch toolbar.
*/
package org.fife.rtext;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.KeyStroke;
/**
* Action used by an <code>RText</code> to toggle the visibility of
* the QuickSearch toolbar.
*/
class SearchToolBarAction extends AbstractAction {
private RText rtext;
/*****************************************************************************/
/**
* Constructor.
*
* @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 rtext The <code>RText</code>.
*/
public SearchToolBarAction(String text, ImageIcon icon, String desc,
Integer mnemonic, KeyStroke accelerator,
RText rtext) {
super(text, icon);
putValue(ACCELERATOR_KEY, accelerator);
putValue(SHORT_DESCRIPTION, desc);
putValue(MNEMONIC_KEY, mnemonic);
this.rtext = rtext;
}
/*****************************************************************************/
/**
* Callback routine called when user uses this component.
*
* @param e The action event.
*/
public void actionPerformed(ActionEvent e) {
// The source must be the "QuickSearch bar" menu item.
JCheckBoxMenuItem item = (JCheckBoxMenuItem)e.getSource();
rtext.getSearchToolBar().setVisible(item.isSelected());
}
/*****************************************************************************/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -