package org.openslx.dozmod.gui.window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import org.openslx.dozmod.gui.MainWindow; import org.openslx.dozmod.gui.window.layout.MainMenuWindowLayout; import org.openslx.dozmod.thrift.Session; public class MainMenuWindow extends MainMenuWindowLayout { /** * Version for serialization. */ private static final long serialVersionUID = 1386462978086690536L; public MainMenuWindow() { super(); // function for vmButton btnShowVirtualMachines.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { MainWindow.showPage(ImageListWindow.class); } }); // function for lecturesButton btnShowLectures.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { MainWindow.showPage(LectureListWindow.class); } }); } @Override public boolean requestHide() { return true; } @Override public void requestShow() { // here we need to check if the user is a student // if so directly forward to lecturelist. if(!Session.canListImages()) { MainWindow.showPage(LectureListWindow.class); } btnShowVirtualMachines.setEnabled(Session.canListImages()); } }