Fix transcript in transfer window.
[cyberduck.git] / source / ch / cyberduck / ui / cocoa / InfoControllerFactory.java
blob3c6245618fb11aaff6a560f789982097e56eca44
1 package ch.cyberduck.ui.cocoa;
3 import ch.cyberduck.core.Path;
4 import ch.cyberduck.core.preferences.PreferencesFactory;
5 import ch.cyberduck.binding.foundation.NSNotification;
7 import java.util.HashMap;
8 import java.util.List;
9 import java.util.Map;
11 /**
12 * @version $Id$
14 public final class InfoControllerFactory {
16 private static Map<BrowserController, InfoController> open
17 = new HashMap<BrowserController, InfoController>();
19 private InfoControllerFactory() {
23 public static InfoController create(final BrowserController controller, final List<Path> files) {
24 if(PreferencesFactory.get().getBoolean("browser.info.inspector")) {
25 if(open.containsKey(controller)) {
26 final InfoController c = open.get(controller);
27 c.setFiles(files);
28 return c;
31 final InfoController c = new InfoController(controller, files) {
32 @Override
33 public void windowWillClose(final NSNotification notification) {
34 InfoControllerFactory.open.remove(controller);
35 super.windowWillClose(notification);
38 open.put(controller, c);
39 return c;
42 /**
43 * @param controller Browser
44 * @return Null if the browser does not have an Info window.
46 public static InfoController get(final BrowserController controller) {
47 return open.get(controller);