* minor refactoring
This commit is contained in:
parent
f5e8e0363b
commit
118e0368ae
|
@ -151,7 +151,7 @@ class NamesListTransferablePolicy extends FileTransferablePolicy {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while (scanner.hasNext()) {
|
while (scanner.hasNext()) {
|
||||||
values.add(scanner.next().getKey().getName());
|
values.add(new AbstractFile(scanner.next().getKey().getName(), -1));
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
scanner.close();
|
scanner.close();
|
||||||
|
|
|
@ -6,7 +6,6 @@ import java.beans.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -33,7 +32,7 @@ public class RenameModel extends MatchModel<Object, File> {
|
||||||
|
|
||||||
private final FormattedFutureEventList names = new FormattedFutureEventList();
|
private final FormattedFutureEventList names = new FormattedFutureEventList();
|
||||||
|
|
||||||
private final Map<Class<?>, MatchFormatter> formatters = new HashMap<Class<?>, MatchFormatter>();
|
private final Map<Object, MatchFormatter> formatters = new LinkedHashMap<Object, MatchFormatter>();
|
||||||
|
|
||||||
private final MatchFormatter defaultFormatter = new MatchFormatter() {
|
private final MatchFormatter defaultFormatter = new MatchFormatter() {
|
||||||
|
|
||||||
|
@ -119,11 +118,11 @@ public class RenameModel extends MatchModel<Object, File> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void useFormatter(Class<?> type, MatchFormatter formatter) {
|
public void useFormatter(Object key, MatchFormatter formatter) {
|
||||||
if (formatter != null) {
|
if (formatter != null) {
|
||||||
formatters.put(type, formatter);
|
formatters.put(key, formatter);
|
||||||
} else {
|
} else {
|
||||||
formatters.remove(type);
|
formatters.remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// reformat matches
|
// reformat matches
|
||||||
|
|
Loading…
Reference in New Issue