summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/MainMenuWindowLayout.java
blob: 4665666796d8e00a55a4d93780ca46f73b87236c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package org.openslx.dozmod.gui.window.layout;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.openslx.dozmod.gui.helper.CompositePage;

/*
 * Structure/workflow should be:
 * 
 * 1) App starts with Login Window for now [1]
 *
 * 2) After login, the main window opens.
 * 2a) If the disclaimer has not been accepted yet, the main window will open it as a modal window
 * 2b) Maybe do the same with the "you need vmware" window afterwards, or just show a hint in mainwindow
 *     that would open the vmware info window when clicked.
 * The disclaimer and vmware info should still be reachable via the menu at any time
 * 
 * - Clicking vm list or lecture list would show the according list in the same window
 * - adding/editing lecture/image will open a wizard
 * - doubleclicking a lecture/image will open a detailed info window
 * 
 * 
 * GuiManager's add/remove content needs refactoring or needs to be moved, as it's
 * designed like we only have one main window with changing content, but we
 * actually have lots of independent windows and wizards. 
 * 
 * (TODO: Make sure it doesn't suck on multiscreen setups)
 * 
 * [1] Later on we might support a "stay logged in" feature that
 * will skip the login screen
 */

public abstract class MainMenuWindowLayout extends CompositePage {
	// text for info for the vms selection
	protected String vmInfo = "Infotext VMs.";

	// text for the info for the lecture selection
	protected String lecturesInfo = "Infotext Veranstaltungen.";

	// buttons
	protected Button vmButton;
	protected Button lecturesButton;

	public MainMenuWindowLayout(final Shell mainShell) {
		super(mainShell, SWT.NONE);

		this.setLayout(new GridLayout(2, true));

		// group for the vm selection
		Group vmGroup = new Group(this, SWT.NONE);
		vmGroup.setLayout(new GridLayout());
		vmGroup.setText("VMs");
		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
		vmGroup.setLayoutData(gridData);

		vmButton = new Button(vmGroup, SWT.PUSH);
		vmButton.setText("VM  - Übersicht");
		gridData = new GridData(SWT.CENTER, SWT.CENTER, true, true);
		vmButton.setLayoutData(gridData);

		Label vmInfoLabel = new Label(vmGroup, SWT.NONE);
		vmInfoLabel.setText(vmInfo);
		gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
		vmInfoLabel.setLayoutData(gridData);

		//g group for the lecture selection
		Group lecturesGroup = new Group(this, SWT.NONE);
		lecturesGroup.setLayout(new GridLayout());
		lecturesGroup.setText("Veranstaltungen");
		gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
		lecturesGroup.setLayoutData(gridData);

		lecturesButton = new Button(lecturesGroup, SWT.PUSH);
		lecturesButton.setText("Veranstanstaltungen");
		gridData = new GridData(SWT.CENTER, SWT.CENTER, true, true);
		lecturesButton.setLayoutData(gridData);

		Label lecturesInfoLabel = new Label(lecturesGroup, SWT.NONE);
		lecturesInfoLabel.setText(lecturesInfo);
		gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
		lecturesInfoLabel.setLayoutData(gridData);
	}

}