mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
don't show favorites for categories
This commit is contained in:
@@ -567,10 +567,13 @@ public class TreePanel extends JPanel {
|
|||||||
shortcutSubmenu.add(item);
|
shortcutSubmenu.add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Favorite fav = new Favorite(componentType == null ? FavoriteType.Block : FavoriteType.Component, componentType == null ? payload.toString() : componentType.getInstanceClass()
|
if (selectedNode.isLeaf()) {
|
||||||
.getCanonicalName());
|
final Favorite fav =
|
||||||
|
new Favorite(componentType == null ? FavoriteType.Block : FavoriteType.Component,
|
||||||
|
componentType == null ? payload.toString() : componentType.getInstanceClass().getCanonicalName());
|
||||||
final boolean isFavorite = favorites != null && favorites.indexOf(fav) >= 0;
|
final boolean isFavorite = favorites != null && favorites.indexOf(fav) >= 0;
|
||||||
final JMenuItem favoritesItem = new JMenuItem(isFavorite ? "Remove From Favorites" : "Add To Favorites",
|
final JMenuItem favoritesItem =
|
||||||
|
new JMenuItem(isFavorite ? "Remove From Favorites" : "Add To Favorites",
|
||||||
isFavorite ? IconLoader.StarBlue.getIcon() : IconLoader.StarGrey.getIcon());
|
isFavorite ? IconLoader.StarBlue.getIcon() : IconLoader.StarGrey.getIcon());
|
||||||
favoritesItem.addActionListener(new ActionListener() {
|
favoritesItem.addActionListener(new ActionListener() {
|
||||||
|
|
||||||
@@ -587,6 +590,7 @@ public class TreePanel extends JPanel {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
popup.add(favoritesItem);
|
popup.add(favoritesItem);
|
||||||
|
}
|
||||||
|
|
||||||
if (componentType != null) {
|
if (componentType != null) {
|
||||||
popup.add(new SelectAllAction(plugInPort, componentType));
|
popup.add(new SelectAllAction(plugInPort, componentType));
|
||||||
|
|||||||
Reference in New Issue
Block a user