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

import org.openslx.dozmod.gui.control.QLabel;
import org.openslx.dozmod.gui.helper.GridManager;
import org.openslx.dozmod.gui.wizard.Wizard;
import org.openslx.dozmod.gui.wizard.WizardPage;

import javax.swing.*;
import java.awt.event.KeyEvent;

public class ContainerUploadPageLayout extends WizardPage {

	protected final JTextField txtImageName;
	protected final JButton btnBrowseForImage;
	protected final JTextField txtImageFile;
	protected final JCheckBox chkLicenseRestricted;
	protected final QLabel lblImageName;
	protected final JTextArea txtInfoText;

	protected final JTextField txtContainerRun;
	protected final QLabel lblContainerRun;
	protected final QLabel lblMountUserDir;
	protected final JCheckBox chkMountUserDir;

	// TODO set proper Text labels
	/**
	 * Page for uploading an imagefile
	 */
	public ContainerUploadPageLayout(Wizard wizard) {

		super(wizard, "Neue VM anlegen");
		setDescription("Bitte wählen Sie eine Virtuelle Maschine zum Hochladen aus.");
		GridManager grid = new GridManager(this, 3, false);

		// -- Browse for VM --
		QLabel imageFileCaption = new QLabel("Virtuelle Maschine");
		txtImageFile = new JTextField();
		txtImageFile.setEditable(false);
		btnBrowseForImage = new JButton("Durchsuchen");
		btnBrowseForImage.setMnemonic(KeyEvent.VK_B);
		grid.add(imageFileCaption);
		grid.add(txtImageFile).fill(true, false).expand(true, false);
		grid.add(btnBrowseForImage);
		grid.nextRow();

		lblImageName = new QLabel("Name");
		txtImageName = new JTextField();
		grid.add(lblImageName);
		grid.add(txtImageName, 2, 1).fill(true, false).expand(true, false);
		grid.nextRow();

		// -- Software license changed - shown only in UploadWizard --
		chkLicenseRestricted = new JCheckBox("enthält lizenzpflichtige Software");
		chkLicenseRestricted.setVisible(false);
		grid.skip();
		grid.add(chkLicenseRestricted, 2, 1).fill(false, false).expand(true, false);
		grid.nextRow();

		grid.add(new JSeparator(),3);
		grid.nextRow();

		lblContainerRun = new QLabel("Container Start Optionen");
		lblContainerRun.setToolTipText("Geben Sie die Container Run Optionen an (Port, Name, Env,...)");
		txtContainerRun = new JTextField();
		lblMountUserDir = new QLabel("Mount User Directory");
		chkMountUserDir = new JCheckBox();
		grid.add(lblContainerRun);
		grid.add(txtContainerRun, 2, 1).fill(true, false).expand(true, false);
		grid.add(lblMountUserDir);
		grid.add(chkMountUserDir,2,1).fill(false, false).expand(true, false);
		grid.nextRow();




		grid.add(Box.createVerticalGlue(), 3).expand(true, true);

		txtInfoText = new JTextArea();
		txtInfoText.setBorder(BorderFactory.createTitledBorder("Hinweis"));
		txtInfoText.setLineWrap(true);
		txtInfoText.setWrapStyleWord(true);
		txtInfoText.setEditable(false);
		txtInfoText.setFocusable(false);
		txtInfoText.setOpaque(false);
		txtInfoText.setText("Container Info Text");
		grid.add(txtInfoText, 3).fill(true, false).expand(true, false);
		grid.nextRow();

		grid.finish(false);
	}

}