1 23 24 package org.gjt.sp.jedit.options; 25 26 import javax.swing.*; 28 import java.awt.*; 29 import org.gjt.sp.jedit.gui.*; 30 import org.gjt.sp.jedit.*; 31 33 public class GutterOptionPane extends AbstractOptionPane 34 { 35 public GutterOptionPane() 37 { 38 super("gutter"); 39 } 41 public void _init() 43 { 44 45 lineNumbersEnabled = new JCheckBox(jEdit.getProperty( 46 "options.gutter.lineNumbers")); 47 lineNumbersEnabled.setSelected(jEdit.getBooleanProperty( 48 "view.gutter.lineNumbers")); 49 addComponent(lineNumbersEnabled); 50 51 52 gutterFont = new FontSelector( 53 jEdit.getFontProperty("view.gutter.font", 54 new Font("Monospaced",Font.PLAIN,10))); 55 56 addComponent(jEdit.getProperty("options.gutter.font"),gutterFont); 57 58 59 addComponent(jEdit.getProperty("options.gutter.foreground"), 60 gutterForeground = new ColorWellButton( 61 jEdit.getColorProperty("view.gutter.fgColor")), 62 GridBagConstraints.VERTICAL); 63 64 65 addComponent(jEdit.getProperty("options.gutter.background"), 66 gutterBackground = new ColorWellButton( 67 jEdit.getColorProperty("view.gutter.bgColor")), 68 GridBagConstraints.VERTICAL); 69 70 71 75 76 77 90 91 92 gutterCurrentLineHighlightEnabled = new JCheckBox(jEdit.getProperty( 93 "options.gutter.currentLineHighlight")); 94 gutterCurrentLineHighlightEnabled.setSelected(jEdit.getBooleanProperty( 95 "view.gutter.highlightCurrentLine")); 96 addComponent(gutterCurrentLineHighlightEnabled, 97 gutterCurrentLineHighlight = new ColorWellButton( 98 jEdit.getColorProperty("view.gutter.currentLineColor")), 99 GridBagConstraints.VERTICAL); 100 101 102 gutterHighlightInterval = new JTextField(jEdit.getProperty( 103 "view.gutter.highlightInterval"),3); 104 105 Box gutterHighlightBox = new Box(BoxLayout.X_AXIS); 106 gutterHighlightBox.add(new JLabel(jEdit.getProperty( 107 "options.gutter.interval-1"))); 108 gutterHighlightBox.add(Box.createHorizontalStrut(3)); 109 gutterHighlightBox.add(gutterHighlightInterval); 110 gutterHighlightBox.add(Box.createHorizontalStrut(3)); 111 gutterHighlightBox.add(new JLabel(jEdit.getProperty( 112 "options.gutter.interval-2"))); 113 gutterHighlightBox.add(Box.createHorizontalStrut(12)); 114 115 addComponent(gutterHighlightBox,gutterHighlightColor 116 = new ColorWellButton(jEdit.getColorProperty( 117 "view.gutter.highlightColor")), 118 GridBagConstraints.VERTICAL); 119 120 121 gutterStructureHighlightEnabled = new JCheckBox(jEdit.getProperty( 122 "options.gutter.structureHighlight")); 123 gutterStructureHighlightEnabled.setSelected(jEdit.getBooleanProperty( 124 "view.gutter.structureHighlight")); 125 addComponent(gutterStructureHighlightEnabled, 126 gutterStructureHighlight = new ColorWellButton( 127 jEdit.getColorProperty("view.gutter.structureHighlightColor")), 128 GridBagConstraints.VERTICAL); 129 130 131 gutterMarkerHighlightEnabled = new JCheckBox(jEdit.getProperty( 132 "options.gutter.markerHighlight")); 133 gutterMarkerHighlightEnabled.setSelected(jEdit.getBooleanProperty( 134 "view.gutter.markerHighlight")); 135 addComponent(gutterMarkerHighlightEnabled, 136 gutterMarkerHighlight = new ColorWellButton( 137 jEdit.getColorProperty("view.gutter.markerColor")), 138 GridBagConstraints.VERTICAL); 139 140 141 addComponent(jEdit.getProperty("options.gutter.foldColor"), 142 gutterFoldMarkers = new ColorWellButton( 143 jEdit.getColorProperty("view.gutter.foldColor")), 144 GridBagConstraints.VERTICAL); 145 146 147 addComponent(jEdit.getProperty("options.gutter.focusBorderColor"), 148 gutterFocusBorder = new ColorWellButton( 149 jEdit.getColorProperty("view.gutter.focusBorderColor")), 150 GridBagConstraints.VERTICAL); 151 152 153 addComponent(jEdit.getProperty("options.gutter.noFocusBorderColor"), 154 gutterNoFocusBorder = new ColorWellButton( 155 jEdit.getColorProperty("view.gutter.noFocusBorderColor")), 156 GridBagConstraints.VERTICAL); 157 } 159 public void _save() 161 { 162 jEdit.setBooleanProperty("view.gutter.lineNumbers", lineNumbersEnabled 163 .isSelected()); 164 165 jEdit.setFontProperty("view.gutter.font",gutterFont.getFont()); 166 jEdit.setColorProperty("view.gutter.fgColor",gutterForeground 167 .getSelectedColor()); 168 jEdit.setColorProperty("view.gutter.bgColor",gutterBackground 169 .getSelectedColor()); 170 171 187 188 jEdit.setBooleanProperty("view.gutter.highlightCurrentLine", 189 gutterCurrentLineHighlightEnabled.isSelected()); 190 jEdit.setColorProperty("view.gutter.currentLineColor", 191 gutterCurrentLineHighlight.getSelectedColor()); 192 jEdit.setProperty("view.gutter.highlightInterval", 193 gutterHighlightInterval.getText()); 194 jEdit.setColorProperty("view.gutter.highlightColor", 195 gutterHighlightColor.getSelectedColor()); 196 197 jEdit.setBooleanProperty("view.gutter.structureHighlight", 198 gutterStructureHighlightEnabled.isSelected()); 199 jEdit.setColorProperty("view.gutter.structureHighlightColor", 200 gutterStructureHighlight.getSelectedColor()); 201 jEdit.setBooleanProperty("view.gutter.markerHighlight", 202 gutterMarkerHighlightEnabled.isSelected()); 203 jEdit.setColorProperty("view.gutter.markerColor", 204 gutterMarkerHighlight.getSelectedColor()); 205 jEdit.setColorProperty("view.gutter.foldColor", 206 gutterFoldMarkers.getSelectedColor()); 207 jEdit.setColorProperty("view.gutter.focusBorderColor", 208 gutterFocusBorder.getSelectedColor()); 209 jEdit.setColorProperty("view.gutter.noFocusBorderColor", 210 gutterNoFocusBorder.getSelectedColor()); 211 } 213 private FontSelector gutterFont; 215 private ColorWellButton gutterForeground; 216 private ColorWellButton gutterBackground; 217 private JTextField gutterHighlightInterval; 218 private ColorWellButton gutterHighlightColor; 219 private JCheckBox lineNumbersEnabled; 220 private JCheckBox gutterCurrentLineHighlightEnabled; 221 private ColorWellButton gutterCurrentLineHighlight; 222 private JCheckBox gutterStructureHighlightEnabled; 223 private ColorWellButton gutterStructureHighlight; 224 private JCheckBox gutterMarkerHighlightEnabled; 225 private ColorWellButton gutterMarkerHighlight; 226 private ColorWellButton gutterFoldMarkers; 227 private ColorWellButton gutterFocusBorder; 228 private ColorWellButton gutterNoFocusBorder; 229 } 231 | Popular Tags |