From b6e4ce772f4c7a823dad0d3aa0a28f6432a7540b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 2 Jun 2008 14:02:49 +0200 Subject: [PATCH] move method to correct place remove obsolete listener implementation --- src/net/pterodactylus/jsite/gui/FileManager.java | 74 ++++++++++-------------- 1 file changed, 31 insertions(+), 43 deletions(-) diff --git a/src/net/pterodactylus/jsite/gui/FileManager.java b/src/net/pterodactylus/jsite/gui/FileManager.java index 33a07ce..5bd52e8 100644 --- a/src/net/pterodactylus/jsite/gui/FileManager.java +++ b/src/net/pterodactylus/jsite/gui/FileManager.java @@ -29,7 +29,6 @@ import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.beans.PropertyChangeEvent; @@ -83,7 +82,7 @@ import net.pterodactylus.util.swing.SwingUtils; * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ -public class FileManager extends JDialog implements I18nable, ActionListener, TreeSelectionListener, MouseListener { +public class FileManager extends JDialog implements I18nable, TreeSelectionListener, MouseListener { /** Logger. */ private static final Logger logger = Logging.getLogger(FileManager.class.getName()); @@ -646,6 +645,36 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr return selectedProjectFileWrappers; } + /** + * Sets the given action’s enabled state to the given enabled state if the + * action’s current enabled state is not the given enabled state. + * + * @param action + * The action to set the enabled state on + * @param enabled + * The new enabled state of the action + */ + private void setEnabled(Action action, boolean enabled) { + if (action.isEnabled() != enabled) { + action.setEnabled(enabled); + } + } + + /** + * Sets the given button’s selected state to the given selected state if the + * button’s current selected state is not the given selected state. + * + * @param button + * The button to set the selected state on + * @param selected + * The new selected state of the button + */ + private void setSelected(AbstractButton button, boolean selected) { + if (button.isSelected() != selected) { + button.setSelected(selected); + } + } + // // INTERFACE I18nable // @@ -711,47 +740,6 @@ public class FileManager extends JDialog implements I18nable, ActionListener, Tr setSelected(insertOverrideCheckBox, insertOverrideSelected); } - /** - * Sets the given action’s enabled state to the given enabled state if the - * action’s current enabled state is not the given enabled state. - * - * @param action - * The action to set the enabled state on - * @param enabled - * The new enabled state of the action - */ - private void setEnabled(Action action, boolean enabled) { - if (action.isEnabled() != enabled) { - action.setEnabled(enabled); - } - } - - /** - * Sets the given button’s selected state to the given selected state if the - * button’s current selected state is not the given selected state. - * - * @param button - * The button to set the selected state on - * @param selected - * The new selected state of the button - */ - private void setSelected(AbstractButton button, boolean selected) { - if (button.isSelected() != selected) { - button.setSelected(selected); - } - } - - // - // INTERFACE ActionListener - // - - /** - * {@inheritDoc} - */ - public void actionPerformed(ActionEvent actionEvent) { - /* TODO */ - } - // // INTERFACE MouseListener // -- 2.7.4