All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fife.tmm.OpenAction Maven / Gradle / Ivy

Go to download

An application to easily create syntax highlighting for custom languages in RSyntaxTextArea.

The newest version!
package org.fife.tmm;

import java.awt.event.ActionEvent;

import org.fife.ui.app.AppAction;
import org.fife.ui.rtextfilechooser.RTextFileChooser;


/**
 * Loads a TokenMakerMaker specification from an XML file.
 *
 * @author Robert Futrell
 * @version 1.0
 */
class OpenAction extends AppAction {


	/**
	 * Constructor.
	 *
	 * @param app The parent application.
	 */
	OpenAction(TokenMakerMaker app) {
		super(app, app.getResourceBundle(), "Open");
		setIcon(app.getIcon("/open.gif"));
	}


	@Override
	public void actionPerformed(ActionEvent e) {
		TokenMakerMaker app = getApplication();
		RTextFileChooser chooser = app.getFileChooser();
		int rc = chooser.showOpenDialog(app);
		if (rc!=RTextFileChooser.APPROVE_OPTION) {
			return;
		}
		app.openFile(chooser.getSelectedFile());
	}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy