org.fife.rtext.plugins.tools.ToolsPrefs 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.
/*
* 02/26/2010
*
* ToolsPrefs.java - Preferences for the tools plugin.
* Copyright (C) 2010 Robert Futrell
* http://fifesoft.com/rtext
* Licensed under a modified BSD license.
* See the included license file for details.
*/
package org.fife.rtext.plugins.tools;
import java.io.IOException;
import java.io.InputStream;
import javax.swing.KeyStroke;
import org.fife.ui.app.Prefs;
import org.fife.ui.dockablewindows.DockableWindow;
/**
* Preferences for the tools plugin.
*
* @author Robert Futrell
* @version 0.8
*/
public class ToolsPrefs extends Prefs {
/**
* Whether the GUI plugin window is active (visible).
*/
public boolean windowVisible;
/**
* The location of the dockable tool output window.
*/
public int windowPosition;
/**
* Key stroke that toggles the task window's visibility.
*/
public KeyStroke windowVisibilityAccelerator;
/**
* Accelerator for the "New Tool..." action.
*/
public KeyStroke newToolAccelerator;
/**
* Accelerator for the "Edit Tools..." action.
*/
public KeyStroke editToolsAccelerator;
/**
* Overridden to validate the task identifiers value.
*/
public void load(InputStream in) throws IOException {
super.load(in);
// Ensure window position is valid.
if (!DockableWindow.isValidPosition(windowPosition)) {
windowPosition = DockableWindow.BOTTOM;
}
}
/**
* {@inheritDoc}
*/
public void setDefaults() {
windowVisible = false;
windowPosition = DockableWindow.BOTTOM;
windowVisibilityAccelerator = null;
newToolAccelerator = null;
editToolsAccelerator = null;
}
}