From: <kp...@us...> - 2012-01-30 21:19:52
|
Revision: 21025 http://jedit.svn.sourceforge.net/jedit/?rev=21025&view=rev Author: kpouer Date: 2012-01-30 21:19:46 +0000 (Mon, 30 Jan 2012) Log Message: ----------- added missing annotations, minor simplifications, added final keyword to some private fields Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/options/StatusBarOptionPane.java Modified: jEdit/trunk/org/gjt/sp/jedit/options/StatusBarOptionPane.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/options/StatusBarOptionPane.java 2012-01-30 19:56:27 UTC (rev 21024) +++ jEdit/trunk/org/gjt/sp/jedit/options/StatusBarOptionPane.java 2012-01-30 21:19:46 UTC (rev 21025) @@ -298,17 +298,18 @@ //{{{ ActionHandler class private class ActionHandler implements ActionListener { + @Override public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); if(source == add) { - String value = selectWidget(); - if (value == null) + WidgetSelectionDialog dialog = new WidgetSelectionDialog(StatusBarOptionPane.this); + String value = dialog.getValue(); + if (value == null || value.isEmpty()) return; - int index = list.getSelectedIndex(); if(index == -1) index = listModel.getSize(); @@ -372,27 +373,19 @@ updatePreview(); } } - - private String selectWidget() - { - WidgetSelectionDialog dialog = new WidgetSelectionDialog(StatusBarOptionPane.this); - String value = dialog.getValue(); - if (value != null && value.length() == 0) - value = null; - return value; - } } //}}} //{{{ ListHandler class private class ListHandler implements ListSelectionListener { + @Override public void valueChanged(ListSelectionEvent evt) { updateButtons(); } } //}}} - private class WidgetListCellRenderer extends DefaultListCellRenderer + private static class WidgetListCellRenderer extends DefaultListCellRenderer { @Override public Component getListCellRendererComponent(JList list, Object value, int index, @@ -413,14 +406,14 @@ //{{{ WidgetSelectionDialog class private class WidgetSelectionDialog extends EnhancedDialog { - private JButton ok; - private JButton cancel; - private JTextField labelField; - private JLabel labelLabel; - private JRadioButton labelRadio; - private JComboBox widgetCombo; - private JLabel widgetLabel; - private JRadioButton widgetRadio; + private final JButton ok; + private final JButton cancel; + private final JTextField labelField; + private final JLabel labelLabel; + private final JRadioButton labelRadio; + private final JComboBox widgetCombo; + private final JLabel widgetLabel; + private final JRadioButton widgetRadio; private String value; //{{{ WidgetSelectionDialog constructors @@ -560,6 +553,7 @@ private class ActionHandler implements ActionListener { //{{{ actionPerformed() method + @Override public void actionPerformed(ActionEvent evt) { Object source = evt.getSource(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |