protected void _init() { ButtonHandler handler = new ButtonHandler(); // Core JPanel corePanel = new JPanel(); corePanel.setLayout(new BoxLayout(corePanel, BoxLayout.X_AXIS)); corePanel.add( coreIncluded = new JRadioButton(jEdit.getProperty("options.clojure.included-core-label"))); corePanel.add(coreCustom = new JRadioButton(jEdit.getProperty("options.clojure.choose-label"))); ButtonGroup coreGroup = new ButtonGroup(); coreGroup.add(coreIncluded); coreGroup.add(coreCustom); corePanel.add(new JSeparator(JSeparator.VERTICAL)); corePanel.add(corePath = new JTextField()); coreBrowse = new JButton(jEdit.getProperty("vfs.browser.browse.label")); coreBrowse.addActionListener(new BrowseHandler(corePath)); corePanel.add(coreBrowse); String core = plugin.getClojureCore(); if (core.equals(ClojurePlugin.includedCore)) { coreIncluded.setSelected(true); corePath.setEnabled(false); coreBrowse.setEnabled(false); } else { coreCustom.setSelected(true); corePath.setText(core); } coreIncluded.addActionListener(handler); coreCustom.addActionListener(handler); addComponent("Core:", corePanel); // Contrib JPanel contribPanel = new JPanel(); contribPanel.setLayout(new BoxLayout(contribPanel, BoxLayout.X_AXIS)); contribPanel.add(contribIncluded = new JRadioButton("Included (1.1.0)")); contribPanel.add(contribCustom = new JRadioButton("Choose jar")); ButtonGroup contribGroup = new ButtonGroup(); contribGroup.add(contribIncluded); contribGroup.add(contribCustom); contribPanel.add(new JSeparator(JSeparator.VERTICAL)); contribPanel.add(contribPath = new JTextField()); contribBrowse = new JButton(jEdit.getProperty("vfs.browser.browse.label")); contribBrowse.addActionListener(new BrowseHandler(contribPath)); contribPanel.add(contribBrowse); String contrib = plugin.getClojureContrib(); if (contrib.equals(ClojurePlugin.includedContrib)) { contribIncluded.setSelected(true); contribPath.setEnabled(false); contribBrowse.setEnabled(false); } else { contribCustom.setSelected(true); contribPath.setText(contrib); } contribIncluded.addActionListener(handler); contribCustom.addActionListener(handler); addComponent("Contrib:", contribPanel); }
protected void _save() { if (coreIncluded.isSelected()) { plugin.setClojureCore(ClojurePlugin.includedCore); } else { plugin.setClojureCore(corePath.getText()); } if (contribIncluded.isSelected()) { plugin.setClojureContrib(ClojurePlugin.includedContrib); } else { plugin.setClojureContrib(contribPath.getText()); } plugin.setVars(); }