summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureCustomPermissionPageLayout.java
blob: 6a007e691bc21652b01429e3ae57aae39c6f75ee (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
package org.openslx.dozmod.gui.wizard.layout;

import java.awt.GridBagLayout;

import javax.swing.JButton;
import javax.swing.JPanel;

import org.openslx.dozmod.gui.control.table.LecturePermissionTable;
import org.openslx.dozmod.gui.helper.GridPos;
import org.openslx.dozmod.gui.wizard.Wizard;
import org.openslx.dozmod.gui.wizard.WizardPage;

@SuppressWarnings("serial")
public abstract class LectureCustomPermissionPageLayout extends WizardPage {

	protected LecturePermissionTable permissionTableViewer;
	protected JButton addUser;
	protected JButton removeUser;

	String addUserLabel = "Benutzer hinzufügen";
	String removeUserLabel = "Benutzer entfernen";

	/**
	 * Page for setting custom permissions of a lecture
	 */
	public LectureCustomPermissionPageLayout(Wizard wizard) {
		super(wizard, "Benutzerdefinierte Berechtigungen");
		setDescription("Setzen Sie bei Bedarf benutzerdefinierte Berechtigungen");
		setLayout(new GridBagLayout());

		// TableViewer on the table
		permissionTableViewer = new LecturePermissionTable();
		add(permissionTableViewer, GridPos.get(0, 0, true, true));

		JPanel panel = new JPanel();
		// Buttons below Table
		addUser = new JButton(addUserLabel);
		removeUser = new JButton(removeUserLabel);
		panel.add(addUser);
		panel.add(removeUser);
		add(panel, GridPos.get(0, 1));
	}
}