package _VisualDVM.Visual.Menus;
import Common.MainModule_;
import Common.Properties;
import Common.Utils.Utils_;
import Common.Visual.Fonts.VisualiserFonts;

import javax.swing.*;
public class PropertiesSubmenu extends JMenu {
    public PropertiesSubmenu(String title, String icon, Properties properties, String... names) {
        super(title);
        if (icon != null)
            setIcon(Utils_.getIcon(icon));
        setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.Menu));
        addProperties(properties, names);
    }
    public void addProperties(Properties properties, String... names) {
        for (String name : names)
            add(properties.getMenuItem(name));
    }
}
