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
;
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
);
31 final InfoController c
= new InfoController(controller
, files
) {
33 public void windowWillClose(final NSNotification notification
) {
34 InfoControllerFactory
.open
.remove(controller
);
35 super.windowWillClose(notification
);
38 open
.put(controller
, c
);
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
);