mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-12 02:02:16 +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);
|
||||
}
|
||||
|
||||
final Favorite fav = new Favorite(componentType == null ? FavoriteType.Block : FavoriteType.Component, componentType == null ? payload.toString() : componentType.getInstanceClass()
|
||||
.getCanonicalName());
|
||||
if (selectedNode.isLeaf()) {
|
||||
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 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());
|
||||
favoritesItem.addActionListener(new ActionListener() {
|
||||
|
||||
@@ -587,6 +590,7 @@ public class TreePanel extends JPanel {
|
||||
}
|
||||
});
|
||||
popup.add(favoritesItem);
|
||||
}
|
||||
|
||||
if (componentType != null) {
|
||||
popup.add(new SelectAllAction(plugInPort, componentType));
|
||||
|
||||
Reference in New Issue
Block a user