PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/org/gjt/sp/jedit/options/PrintOptionPane.java

#
Java | 115 lines | 65 code | 14 blank | 36 comment | 0 complexity | 654a8a4197c0eb9c5b85d3f5936dcbc5 MD5 | raw file
  1/*
  2 * PrintOptionPane.java - Printing options panel
  3 * :tabSize=8:indentSize=8:noTabs=false:
  4 * :folding=explicit:collapseFolds=1:
  5 *
  6 * Copyright (C) 2000, 2002 Slava Pestov
  7 *
  8 * This program is free software; you can redistribute it and/or
  9 * modify it under the terms of the GNU General Public License
 10 * as published by the Free Software Foundation; either version 2
 11 * of the License, or any later version.
 12 *
 13 * This program is distributed in the hope that it will be useful,
 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16 * GNU General Public License for more details.
 17 *
 18 * You should have received a copy of the GNU General Public License
 19 * along with this program; if not, write to the Free Software
 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 21 */
 22
 23package org.gjt.sp.jedit.options;
 24
 25//{{{ Imports
 26import javax.swing.*;
 27import org.gjt.sp.jedit.gui.FontSelector;
 28import org.gjt.sp.jedit.*;
 29//}}}
 30
 31public class PrintOptionPane extends AbstractOptionPane
 32{
 33	//{{{ PrintOptionPane constructor
 34	public PrintOptionPane()
 35	{
 36		super("print");
 37	} //}}}
 38
 39	//{{{ _init() method
 40	protected void _init()
 41	{
 42		/* Font */
 43		font = new FontSelector(jEdit.getFontProperty("print.font"));
 44		addComponent(jEdit.getProperty("options.print.font"),font);
 45
 46		/* Header */
 47		printHeader = new JCheckBox(jEdit.getProperty("options.print"
 48			+ ".header"));
 49		printHeader.setSelected(jEdit.getBooleanProperty("print.header"));
 50		addComponent(printHeader);
 51
 52		/* Footer */
 53		printFooter = new JCheckBox(jEdit.getProperty("options.print"
 54			+ ".footer"));
 55		printFooter.setSelected(jEdit.getBooleanProperty("print.footer"));
 56		addComponent(printFooter);
 57
 58		/* Line numbering */
 59		printLineNumbers = new JCheckBox(jEdit.getProperty("options.print"
 60			+ ".lineNumbers"));
 61		printLineNumbers.setSelected(jEdit.getBooleanProperty("print.lineNumbers"));
 62		addComponent(printLineNumbers);
 63
 64		/* Color */
 65		color = new JCheckBox(jEdit.getProperty("options.print"
 66			+ ".color"));
 67		color.setSelected(jEdit.getBooleanProperty("print.color"));
 68		addComponent(color);
 69
 70		/* Tab size */
 71		String[] tabSizes = { "2", "4", "8" };
 72		tabSize = new JComboBox(tabSizes);
 73		tabSize.setEditable(true);
 74		tabSize.setSelectedItem(jEdit.getProperty("print.tabSize"));
 75		addComponent(jEdit.getProperty("options.print.tabSize"),tabSize);
 76
 77		addSeparator("options.print.workarounds");
 78
 79		/* Spacing workaround */
 80		glyphVector = new JCheckBox(jEdit.getProperty(
 81			"options.print.glyphVector"));
 82		glyphVector.setSelected(jEdit.getBooleanProperty("print.glyphVector"));
 83		addComponent(glyphVector);
 84
 85		/* Force 1.3 print dialog */
 86		force13 = new JCheckBox(jEdit.getProperty(
 87			"options.print.force13"));
 88		force13.setSelected(jEdit.getBooleanProperty("print.force13"));
 89		addComponent(force13);
 90	} //}}}
 91
 92	//{{{ _save() method
 93	protected void _save()
 94	{
 95		jEdit.setFontProperty("print.font",font.getFont());
 96		jEdit.setBooleanProperty("print.header",printHeader.isSelected());
 97		jEdit.setBooleanProperty("print.footer",printFooter.isSelected());
 98		jEdit.setBooleanProperty("print.lineNumbers",printLineNumbers.isSelected());
 99		jEdit.setBooleanProperty("print.color",color.isSelected());
100		jEdit.setProperty("print.tabSize",(String)tabSize.getSelectedItem());
101		jEdit.setBooleanProperty("print.glyphVector",glyphVector.isSelected());
102		jEdit.setBooleanProperty("print.force13",force13.isSelected());
103	} //}}}
104
105	//{{{ Private members
106	private FontSelector font;
107	private JCheckBox printHeader;
108	private JCheckBox printFooter;
109	private JCheckBox printLineNumbers;
110	private JCheckBox color;
111	private JComboBox tabSize;
112	private JCheckBox glyphVector;
113	private JCheckBox force13;
114	//}}}
115}