1 22 23 package org.gjt.sp.jedit.options; 24 25 import javax.swing.*; 27 import org.gjt.sp.jedit.gui.FontSelector; 28 import org.gjt.sp.jedit.*; 29 31 public class PrintOptionPane extends AbstractOptionPane 32 { 33 public PrintOptionPane() 35 { 36 super("print"); 37 } 39 protected void _init() 41 { 42 43 font = new FontSelector(jEdit.getFontProperty("print.font")); 44 addComponent(jEdit.getProperty("options.print.font"),font); 45 46 47 printHeader = new JCheckBox(jEdit.getProperty("options.print" 48 + ".header")); 49 printHeader.setSelected(jEdit.getBooleanProperty("print.header")); 50 addComponent(printHeader); 51 52 53 printFooter = new JCheckBox(jEdit.getProperty("options.print" 54 + ".footer")); 55 printFooter.setSelected(jEdit.getBooleanProperty("print.footer")); 56 addComponent(printFooter); 57 58 59 printLineNumbers = new JCheckBox(jEdit.getProperty("options.print" 60 + ".lineNumbers")); 61 printLineNumbers.setSelected(jEdit.getBooleanProperty("print.lineNumbers")); 62 addComponent(printLineNumbers); 63 64 65 color = new JCheckBox(jEdit.getProperty("options.print" 66 + ".color")); 67 color.setSelected(jEdit.getBooleanProperty("print.color")); 68 addComponent(color); 69 70 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 78 79 printFolds = new JCheckBox(jEdit.getProperty("options.print" 80 + ".folds")); 81 printFolds.setSelected(jEdit.getBooleanProperty("print.folds",true)); 82 addComponent(printFolds); 83 84 addSeparator("options.print.workarounds"); 85 86 87 glyphVector = new JCheckBox(jEdit.getProperty( 88 "options.print.glyphVector")); 89 glyphVector.setSelected(jEdit.getBooleanProperty("print.glyphVector")); 90 addComponent(glyphVector); 91 92 93 force13 = new JCheckBox(jEdit.getProperty( 94 "options.print.force13")); 95 force13.setSelected(jEdit.getBooleanProperty("print.force13")); 96 addComponent(force13); 97 } 99 protected void _save() 101 { 102 jEdit.setFontProperty("print.font",font.getFont()); 103 jEdit.setBooleanProperty("print.header",printHeader.isSelected()); 104 jEdit.setBooleanProperty("print.footer",printFooter.isSelected()); 105 jEdit.setBooleanProperty("print.lineNumbers",printLineNumbers.isSelected()); 106 jEdit.setBooleanProperty("print.color",color.isSelected()); 107 jEdit.setProperty("print.tabSize",(String )tabSize.getSelectedItem()); 108 jEdit.setBooleanProperty("print.glyphVector",glyphVector.isSelected()); 109 jEdit.setBooleanProperty("print.force13",force13.isSelected()); 110 jEdit.setBooleanProperty("print.folds",printFolds.isSelected()); 111 } 113 private FontSelector font; 115 private JCheckBox printHeader; 116 private JCheckBox printFooter; 117 private JCheckBox printLineNumbers; 118 private JCheckBox printFolds; 119 private JCheckBox color; 120 private JComboBox tabSize; 121 private JCheckBox glyphVector; 122 private JCheckBox force13; 123 } 125 | Popular Tags |