summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureCreationPageLayout.java
blob: 1522cd72534554eacd021f8f0d64d08780fd928d (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
90
91
92
93
package org.openslx.dozmod.gui.wizard.layout;

import org.eclipse.jface.wizard.WizardPage;
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.Composite;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

public abstract class LectureCreationPageLayout extends WizardPage {

	protected Text lectureNameTextField;
	protected Composite container;
	protected DateTime startDate;
	protected DateTime endDate;
	protected DateTime startTime;
	protected DateTime endTime;
	protected Button networkAccessCheck;
	protected Button examCheck;


	/**
	 * Page for creating lectures
	 * 
	 * @param editExistingLecture whether to edit existing lecture or create new
	 *            one
	 */
	public LectureCreationPageLayout() {
		super("Eingabe Ihrer Daten");
		setTitle("Eingabe Ihrer Daten");
		setDescription("Geben Sie bitte einen aussagekräftigen Namen für die neue Veranstaltung ein.");
	}

	@Override
	public void createControl(Composite parent) {
		container = new Composite(parent, SWT.NONE);
		GridLayout layout = new GridLayout();
		layout.verticalSpacing = 16;
		layout.numColumns = 4;
		container.setLayout(layout);

		// lecture name
		Label lectureNameLabel = new Label(container, SWT.NONE);
		lectureNameLabel.setText("Veranstaltungsname:");
		lectureNameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		lectureNameTextField = new Text(container, SWT.BORDER | SWT.SINGLE);
		lectureNameTextField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 3, 1));
		
		// start and end date
		Label startDateLabel = new Label(container, SWT.NONE);
		startDateLabel.setText("Startdatum:");
		startDateLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		startDate = new DateTime(container, SWT.DATE | SWT.DROP_DOWN);
		startDate.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		
		Label endDateLabel = new Label(container, SWT.NONE);
		endDateLabel.setText("Enddatum:");
		endDateLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		endDate = new DateTime(container, SWT.DATE | SWT.DROP_DOWN);
		endDate.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		
		// start- and end
		Label endTimelabel = new Label(container, SWT.NONE);
		endTimelabel.setText("Startzeit:");
		endTimelabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		startTime = new DateTime (container, SWT.TIME | SWT.SHORT);
		
		
		Label endTimeLabel = new Label(container, SWT.NONE);
		endTimeLabel.setText("Endzeit:");
		endTimeLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		endTime = new DateTime (container, SWT.TIME | SWT.SHORT);	
	
		// checkboxes for network access and exam
		Label networkAccessLabel = new Label(container, SWT.NONE);
		networkAccessLabel.setText("Internet verfügbar:");
		networkAccessLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		networkAccessCheck = new Button (container, SWT.CHECK);
		
		new Label(container, SWT.NONE);
		new Label(container, SWT.NONE);
		
		Label examLabel = new Label(container, SWT.NONE);
		examLabel.setText("Prüfung:");
		examLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		examCheck = new Button (container, SWT.CHECK);

		setControl(container);
	}
}