org.fife.rtext.SearchToolBarAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rtext Show documentation
Show all versions of rtext Show documentation
RText is a powerful, cross-platform programmer's text editor written in Java. It is designed
to be easy to use, highly customizable and flexible. Part of RText's design is for the source code
to be simple, easy to understand, and well documented, so that other programmers can look into its
inner-workings and figure out how RText ticks with ease. A good place to start (besides the source
code) is the Javadoc for all classes used in the project.
/*
* 01/16/2005
*
* SearchToolBarAction.java - Toggles the visibility of the QuickSearch toolbar.
* Copyright (C) 2005 Robert Futrell
* http://fifesoft.com/rtext
* Licensed under a modified BSD license.
* See the included license file for details.
*/
package org.fife.rtext;
import java.awt.event.ActionEvent;
import javax.swing.JCheckBoxMenuItem;
import org.fife.ui.app.StandardAction;
/**
* Action used by an RText
to toggle the visibility of
* the QuickSearch toolbar.
*
* @author Robert Futrell
* @version 1.0
*/
class SearchToolBarAction extends StandardAction {
/**
* Constructor.
*
* @param rtext The parent RText
application.
*/
public SearchToolBarAction(RText rtext) {
super(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 rtext = (RText)getApplication();
rtext.getSearchToolBar().setVisible(item.isSelected());
}
}