From 118e0368ae5a4aa29fb71cbd8a6cde883ba325f1 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 2 Aug 2009 17:33:48 +0000 Subject: [PATCH] * minor refactoring --- .../ui/panel/rename/NamesListTransferablePolicy.java | 2 +- .../sourceforge/filebot/ui/panel/rename/RenameModel.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/source/net/sourceforge/filebot/ui/panel/rename/NamesListTransferablePolicy.java b/source/net/sourceforge/filebot/ui/panel/rename/NamesListTransferablePolicy.java index 8fef54dc..1617ef49 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/NamesListTransferablePolicy.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/NamesListTransferablePolicy.java @@ -151,7 +151,7 @@ class NamesListTransferablePolicy extends FileTransferablePolicy { try { while (scanner.hasNext()) { - values.add(scanner.next().getKey().getName()); + values.add(new AbstractFile(scanner.next().getKey().getName(), -1)); } } finally { scanner.close(); diff --git a/source/net/sourceforge/filebot/ui/panel/rename/RenameModel.java b/source/net/sourceforge/filebot/ui/panel/rename/RenameModel.java index e788d16d..dfb568cc 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/RenameModel.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/RenameModel.java @@ -6,7 +6,6 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -33,7 +32,7 @@ public class RenameModel extends MatchModel { private final FormattedFutureEventList names = new FormattedFutureEventList(); - private final Map, MatchFormatter> formatters = new HashMap, MatchFormatter>(); + private final Map formatters = new LinkedHashMap(); private final MatchFormatter defaultFormatter = new MatchFormatter() { @@ -119,11 +118,11 @@ public class RenameModel extends MatchModel { } - public void useFormatter(Class type, MatchFormatter formatter) { + public void useFormatter(Object key, MatchFormatter formatter) { if (formatter != null) { - formatters.put(type, formatter); + formatters.put(key, formatter); } else { - formatters.remove(type); + formatters.remove(key); } // reformat matches