mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make dependencies explicit
This commit is contained in:
+8
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,11 +37,15 @@ import java.util.Set;
|
||||
* User: Vassiliy.Kudryashov
|
||||
*/
|
||||
public class BookmarksFavoriteListProvider extends AbstractFavoritesListProvider<Bookmark> implements BookmarksListener {
|
||||
private final BookmarkManager myBookmarkManager;
|
||||
private final FavoritesManager myFavoritesManager;
|
||||
|
||||
public BookmarksFavoriteListProvider(Project project) {
|
||||
public BookmarksFavoriteListProvider(Project project, BookmarkManager bookmarkManager, FavoritesManager favoritesManager) {
|
||||
super(project, "Bookmarks");
|
||||
project.getMessageBus().connect(project).subscribe(BookmarksListener.TOPIC, this);
|
||||
updateChildren();
|
||||
myBookmarkManager = bookmarkManager;
|
||||
myFavoritesManager = favoritesManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,7 +71,7 @@ public class BookmarksFavoriteListProvider extends AbstractFavoritesListProvider
|
||||
private void updateChildren() {
|
||||
if (myProject.isDisposed()) return;
|
||||
myChildren.clear();
|
||||
List<Bookmark> bookmarks = BookmarkManager.getInstance(myProject).getValidBookmarks();
|
||||
List<Bookmark> bookmarks = myBookmarkManager.getValidBookmarks();
|
||||
for (final Bookmark bookmark : bookmarks) {
|
||||
AbstractTreeNode<Bookmark> child = new AbstractTreeNode<Bookmark>(myProject, bookmark) {
|
||||
@NotNull
|
||||
@@ -100,7 +104,7 @@ public class BookmarksFavoriteListProvider extends AbstractFavoritesListProvider
|
||||
child.setParent(myNode);
|
||||
myChildren.add(child);
|
||||
}
|
||||
FavoritesManager.getInstance(myProject).fireListeners(getListName(myProject));
|
||||
myFavoritesManager.fireListeners(getListName(myProject));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -54,7 +54,7 @@ public class BreakpointsFavoriteListProvider extends AbstractFavoritesListProvid
|
||||
private final BreakpointItemsTreeController myTreeController;
|
||||
private final List<XBreakpointGroupingRule> myRulesAvailable = new ArrayList<XBreakpointGroupingRule>();
|
||||
|
||||
private Set<XBreakpointGroupingRule> myRulesEnabled = new TreeSet<XBreakpointGroupingRule>(XBreakpointGroupingRule.PRIORITY_COMPARATOR);
|
||||
private final Set<XBreakpointGroupingRule> myRulesEnabled = new TreeSet<XBreakpointGroupingRule>(XBreakpointGroupingRule.PRIORITY_COMPARATOR);
|
||||
|
||||
private final SingleAlarm myRebuildAlarm = new SingleAlarm(new Runnable() {
|
||||
@Override
|
||||
@@ -62,8 +62,9 @@ public class BreakpointsFavoriteListProvider extends AbstractFavoritesListProvid
|
||||
updateChildren();
|
||||
}
|
||||
}, 100);
|
||||
private final FavoritesManager myFavoritesManager;
|
||||
|
||||
public BreakpointsFavoriteListProvider(Project project) {
|
||||
public BreakpointsFavoriteListProvider(Project project, FavoritesManager favoritesManager) {
|
||||
super(project, "Breakpoints");
|
||||
myBreakpointPanelProviders = XBreakpointUtil.collectPanelProviders();
|
||||
myTreeController = new BreakpointItemsTreeController(myRulesAvailable);
|
||||
@@ -73,6 +74,7 @@ public class BreakpointsFavoriteListProvider extends AbstractFavoritesListProvid
|
||||
provider.createBreakpointsGroupingRules(myRulesAvailable);
|
||||
}
|
||||
updateChildren();
|
||||
myFavoritesManager = favoritesManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,7 +112,7 @@ public class BreakpointsFavoriteListProvider extends AbstractFavoritesListProvid
|
||||
replicate((DefaultMutableTreeNode)child, myNode, myChildren);
|
||||
}
|
||||
}
|
||||
FavoritesManager.getInstance(myProject).fireListeners(getListName(myProject));
|
||||
myFavoritesManager.fireListeners(getListName(myProject));
|
||||
}
|
||||
|
||||
private void replicate(DefaultMutableTreeNode source, AbstractTreeNode destination, final List<AbstractTreeNode<Object>> destinationChildren) {
|
||||
|
||||
Reference in New Issue
Block a user