/*
* Copyright (C) 2012 Marta Rodr�guez, Teresa de Salas, Ana Vargas
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
* http://www.gnu.org/licenses/.
*/
import javax.swing.JLabel;
import org.gjt.sp.jedit.AbstractOptionPane;
import org.gjt.sp.jedit.jEdit;
import org.gjt.sp.jedit.gui.ColorWellButton;
/**
* Class for plugin options
*
* @author Marta Rodr�guez
* @author Teresa de Salas
* @author Ana Vargas
*
*/
public class SplitOptionPane extends AbstractOptionPane {
private static final long serialVersionUID = -2138566306346206591L;
/**
* property for default color
*/
public static final String PROP_DEFAULT_COLOR = "plugin.SplitPlugin.defaultColor";
/**
* default color for highlighted words
*/
private ColorWellButton defaultColor;
/**
* constructor
*/
public SplitOptionPane() {
super(SplitPlugin.NAME);
}
/**
* this method creates and arrange the components of
* the option pane and initialize the option data displayed to the user.
*/
protected void _init(){
JLabel defaultColorLabel = new JLabel(jEdit.getProperty(PROP_DEFAULT_COLOR + ".text"));
defaultColor = new ColorWellButton(jEdit.getColorProperty(PROP_DEFAULT_COLOR));
addComponent(defaultColorLabel,defaultColor);
}
/**
* called when the options dialog's "ok" button is clicked.
*/
protected void _save(){
jEdit.setColorProperty(PROP_DEFAULT_COLOR, defaultColor.getSelectedColor());
}
}