PageRenderTime 79ms CodeModel.GetById 48ms app.highlight 19ms RepoModel.GetById 7ms app.codeStats 0ms

/bundles/plugins-trunk/Console/console/options/SystemOptionPane.java

#
Java | 106 lines | 80 code | 20 blank | 6 comment | 0 complexity | 7df22d9a6888c5f469c2fb71205f8dec MD5 | raw file
  1package console.options;
  2
  3import javax.swing.JCheckBox;
  4import javax.swing.JComboBox;
  5import javax.swing.JSeparator;
  6import javax.swing.JTextField;
  7import javax.swing.SwingConstants;
  8
  9import org.gjt.sp.jedit.AbstractOptionPane;
 10import org.gjt.sp.jedit.jEdit;
 11
 12import console.gui.Label;
 13
 14/** Console options pertaining to the System shell */
 15public class SystemOptionPane extends AbstractOptionPane
 16{
 17	private JComboBox prefix;
 18	private JCheckBox clearBeforeExecute;
 19	private JCheckBox rememberCWD;
 20	private JCheckBox nodeselect;
 21	private JCheckBox mergeError;
 22	private JCheckBox showExitStatus;
 23//	private JCheckBox pvselect;
 24	private JCheckBox pvchange;
 25	private JTextField pathDirs ;
 26	private JCheckBox pathDirsAppend;
 27	
 28
 29	public SystemOptionPane()
 30	{
 31		super("console.system");
 32	}
 33	protected void _init()
 34	{
 35
 36		prefix = new JComboBox();
 37		prefix.setEditable(true);
 38		
 39		prefix.addItem(jEdit.getProperty("console.shell.prefix", "osdefault"));
 40		prefix.addItem("osdefault");
 41		prefix.addItem("none");
 42		prefix.addItem(jEdit.getProperty("console.shell.prefix.bash"));
 43		prefix.addItem(jEdit.getProperty("console.shell.prefix.cmd"));
 44		prefix.addItem(jEdit.getProperty("console.shell.prefix.tcsh"));		
 45		prefix.addItem(jEdit.getProperty("console.shell.prefix.command"));
 46		Label prefixLabel = new Label("options.console.general.shellprefix");
 47		addComponent(prefixLabel, prefix);
 48		
 49		Label pathLabel = new Label("options.console.general.pathdirs");
 50		pathDirs = new JTextField(jEdit.getProperty("console.shell.pathdirs"));
 51		addComponent(pathLabel, pathDirs);
 52
 53		pathDirsAppend = new JCheckBox(jEdit.getProperty("options.console.general.pathdirs.append"));
 54		pathDirsAppend.setSelected(jEdit.getBooleanProperty("console.shell.pathdirs.append"));
 55		addComponent(pathDirsAppend);
 56		
 57		rememberCWD = new JCheckBox(jEdit.getProperty("options.console.general.rememberCWD"));
 58		rememberCWD.setSelected(jEdit.getBooleanProperty("console.rememberCWD"));
 59		addComponent(rememberCWD);	
 60
 61		clearBeforeExecute = new JCheckBox(jEdit.getProperty("options.console.system.clearBeforeExecute"));
 62		clearBeforeExecute.setSelected(jEdit.getBooleanProperty("console.clearBeforeExecute"));
 63		addComponent(clearBeforeExecute);	
 64		
 65		showExitStatus = new JCheckBox();
 66		showExitStatus.setText(jEdit.getProperty("options.console.general.showExitStatus"));
 67		showExitStatus.setSelected(jEdit.getBooleanProperty("console.processrunner.showExitStatus", true));
 68		addComponent(showExitStatus);
 69
 70		
 71		mergeError = new JCheckBox();
 72		mergeError.setText(jEdit.getProperty("options.console.general.mergeError"));
 73		mergeError.setToolTipText(jEdit.getProperty("options.console.general.mergeError.tooltip"));
 74		mergeError.setSelected(jEdit.getBooleanProperty("console.processrunner.mergeError", true));
 75		addComponent(mergeError);
 76		
 77		addComponent(new JSeparator(SwingConstants.HORIZONTAL));
 78		addSeparator("options.console.general.changedir");
 79		nodeselect = new JCheckBox(jEdit.getProperty("options.console.general.changedir.nodeselect"));
 80		nodeselect.setSelected(jEdit.getBooleanProperty("console.changedir.nodeselect"));		
 81		pvchange = new JCheckBox(jEdit.getProperty("options.console.general.changedir.pvchange"));
 82		pvchange.setSelected(jEdit.getBooleanProperty("console.changedir.pvchange"));
 83//		pvselect = new JCheckBox(jEdit.getProperty("options.console.general.changedir.pvselect"));
 84//		pvselect.setSelected(jEdit.getBooleanProperty("console.changedir.pvpvselect"));		
 85
 86		addComponent(nodeselect);
 87		addComponent(pvchange);
 88//		addComponent(pvselect);
 89		addComponent(new JSeparator(SwingConstants.HORIZONTAL));
 90
 91		
 92	}
 93
 94	public void _save() {
 95		jEdit.setBooleanProperty("console.changedir.pvchange", pvchange.isSelected());
 96//		jEdit.setBooleanProperty("console.changedir.pvselect", pvselect.isSelected());
 97		jEdit.setBooleanProperty("console.changedir.nodeselect", nodeselect.isSelected());
 98		jEdit.setBooleanProperty("console.clearBeforeExecute", clearBeforeExecute.isSelected());
 99		jEdit.setBooleanProperty("console.rememberCWD", rememberCWD.isSelected());
100		jEdit.setBooleanProperty("console.processrunner.mergeError", mergeError.isSelected());
101		jEdit.setBooleanProperty("console.processrunner.showExitStatus", showExitStatus.isSelected());
102		jEdit.setProperty("console.shell.pathdirs", pathDirs.getText());
103		jEdit.setBooleanProperty("console.shell.pathdirs.append", pathDirsAppend.isSelected());
104		jEdit.setProperty("console.shell.prefix", prefix.getSelectedItem().toString());
105	}
106}