/bundles/plugins-trunk/JavaInsight/javainsight/JavaInsightOptionPane.java
Java | 115 lines | 60 code | 24 blank | 31 comment | 0 complexity | 9c9ebbadb1483a70a72276ffd75f5bc5 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- /*
- * JavaInsightOptionPane.java - options panel for JavaInsight
- * Copyright (C) 2001 Dirk Moebius
- *
- * jEdit edit mode settings:
- * :mode=java:tabSize=4:indentSize=4:noTabs=true:maxLineLen=0:
- *
- * 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 2
- * 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
- package javainsight;
- import javax.swing.Box;
- import javax.swing.JCheckBox;
- import javax.swing.JComboBox;
- import javax.swing.JLabel;
- import javax.swing.JTextField;
- import org.gjt.sp.jedit.AbstractOptionPane;
- import org.gjt.sp.jedit.jEdit;
- /**
- * An option panel for the Java Insight plugin.
- *
- * @author Dirk Moebius
- * @version $Id: JavaInsightOptionPane.java 9456 2007-04-18 20:09:54Z dmoebius $
- */
- public class JavaInsightOptionPane extends AbstractOptionPane
- {
- public JavaInsightOptionPane() {
- super("javainsight");
- }
- @Override
- public void _init() {
- addSeparator("options.javainsight.decompiler");
- cStyle = new JComboBox(new String[] { "sun", "gnu", "pascal" });
- cStyle.setSelectedItem(jEdit.getProperty("javainsight.jode.style", "sun"));
- addComponent("Coding Style:", cStyle);
- addComponent(Box.createVerticalStrut(15));
- addComponent(cPretty =
- new JCheckBox("Use \"pretty\" names for local variables",
- jEdit.getBooleanProperty("javainsight.jode.pretty", true)));
- addComponent(cOnetime =
- new JCheckBox("Remove locals, that are used only one time",
- jEdit.getBooleanProperty("javainsight.jode.onetime", false)));
- addComponent(cDecrypt =
- new JCheckBox("Decrypt encrypted strings",
- jEdit.getBooleanProperty("javainsight.jode.decrypt", true)));
- addComponent(Box.createVerticalStrut(15));
- addComponent(new JLabel("Generate imports..."));
- cImportPkgLimit = new JTextField(jEdit.getProperty("javainsight.jode.pkglimit", "0"));
- Box b1 = Box.createHorizontalBox();
- b1.add(cImportPkgLimit);
- b1.add(new JLabel(" classes"));
- addComponent("...for packages with more than", b1);
- cImportClassLimit = new JTextField(jEdit.getProperty("javainsight.jode.clslimit", "1"));
- Box b2 = Box.createHorizontalBox();
- b2.add(cImportClassLimit);
- b2.add(new JLabel(" times"));
- addComponent("...for classes used more than", b2);
- addComponent(Box.createVerticalStrut(5));
- addComponent(new JLabel("(0 means generate no imports)"));
- }
- /**
- * Called when the options dialog's `OK' button is pressed.
- * This saves any properties saved in this option pane.
- */
- @Override
- public void _save() {
- jEdit.setProperty("javainsight.jode.style", cStyle.getSelectedItem().toString());
- jEdit.setBooleanProperty("javainsight.jode.pretty", cPretty.isSelected());
- jEdit.setBooleanProperty("javainsight.jode.onetime", cOnetime.isSelected());
- jEdit.setBooleanProperty("javainsight.jode.decrypt", cDecrypt.isSelected());
- jEdit.setProperty("javainsight.jode.pkglimit", cImportPkgLimit.getText());
- jEdit.setProperty("javainsight.jode.clslimit", cImportClassLimit.getText());
- }
- private JComboBox cStyle;
- private JCheckBox cPretty;
- private JCheckBox cOnetime;
- private JCheckBox cDecrypt;
- private JTextField cImportPkgLimit;
- private JTextField cImportClassLimit;
- }