package _VisualDVM.GlobalData.Machine;
import Common.Visual.Controls.MenuBarButton;
import Common.Visual.Menus.DataMenuBar;
import Visual_DVM_2021.Passes.PassCode;
import _VisualDVM.Global;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class MachinesMenuBar extends DataMenuBar {
    MenuBarButton bCollapse;
    public MachinesMenuBar() {
        super("машины",
                PassCode.AddMachine,
                PassCode.EditMachine,
                PassCode.DeleteMachine);
        this.add(bCollapse = new MenuBarButton() {
            {
                setIcon("/icons/CollapseUp.png");
                setToolTipText("Свернуть");
                addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        Global.mainModule.getPass(PassCode.UpdateProperty).Do("collapseCredentials", true);
                    }
                });
            }
        }, 0);
    }
}
