	public void init() {
        view.setModel(new FileTreeModel(project.getProjectDir(), new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return project.getFilePredicate().apply(pathname);
            }
        }));
        window.topic(Project.FileChangeListener.class).subscribe(DispatchStrategy.ASYNC_EVENT, this);
		window.topic(ProjectImpl.RefreshListener.class).subscribe(DispatchStrategy.ASYNC_EVENT, this);
		((JTree) view).getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
			@Override
			public void valueChanged(TreeSelectionEvent e) {
				TreePath[] selectionPaths = ((JTree) view).getSelectionPaths();
				List<File> paths = Lists.newArrayList();
                if (selectionPaths != null) {
                    for (TreePath tp : selectionPaths) {
                        paths.add((File) tp.getLastPathComponent());
                    }
                }
				window.getProject().setSelectedFiles(paths);
                actionContext.put(ActionContextKeys.SELECTION, paths.toArray());
                actionContext.commit();
			}
		});
        ((JTree) view).addTreeExpansionListener(new TreeExpansionListener() {
            @Override
            public void treeExpanded(TreeExpansionEvent event) {
                File file = (File) event.getPath().getLastPathComponent();
                project.register(file);
            }
            @Override
            public void treeCollapsed(TreeExpansionEvent event) {
                File file = (File) event.getPath().getLastPathComponent();
                project.unregister(file);
            }
        });
        actionContext = new ActionContext();
        actionContext.put(ActionContextKeys.FOCUSED_COMPONENT, window.getProject());
        actionContext.commit();
        ActionContext.set(view.getJComponent(), actionContext);
        if (project.getSettingsManager() != null)
            project.getSettingsManager().subscribe(IgnorePatternProjectSettings.class, this, false, window);
	}

	public void init() {
        if (project.getProjectDir() == null) return;
        view.setModel(new FileTreeModel(project.getProjectDir(), new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return project.getFilePredicate().apply(pathname);
            }
        }));
        window.topic(Project.FileChangeListener.class).subscribe(DispatchStrategy.ASYNC_EVENT, this);
		window.topic(ProjectImpl.RefreshListener.class).subscribe(DispatchStrategy.ASYNC_EVENT, this);
		((JTree) view).getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() {
			@Override
			public void valueChanged(TreeSelectionEvent e) {
				TreePath[] selectionPaths = ((JTree) view).getSelectionPaths();
				List<File> paths = Lists.newArrayList();
                if (selectionPaths != null) {
                    for (TreePath tp : selectionPaths) {
                        paths.add((File) tp.getLastPathComponent());
                    }
                }
				window.getProject().setSelectedFiles(paths);
                actionContext.put(ActionContextKeys.SELECTION, paths.toArray());
                actionContext.commit();
			}
		});
        ((JTree) view).addTreeExpansionListener(new TreeExpansionListener() {
            @Override
            public void treeExpanded(TreeExpansionEvent event) {
                File file = (File) event.getPath().getLastPathComponent();
                project.register(file);
            }
            @Override
            public void treeCollapsed(TreeExpansionEvent event) {
                File file = (File) event.getPath().getLastPathComponent();
                project.unregister(file);
            }
        });
        actionContext = new ActionContext();
        actionContext.put(ActionContextKeys.FOCUSED_COMPONENT, window.getProject());
        actionContext.commit();
        ActionContext.set(view.getJComponent(), actionContext);
        if (project.getSettingsManager() != null)
            project.getSettingsManager().subscribe(IgnorePatternProjectSettings.class, this, false, window);
	}
