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

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

import javax.swing.*;

public abstract class ImageTypePageLayout extends WizardPage {

	/**
	 * Version for serialization.
	 */
	private static final long serialVersionUID = 2548125409461846482L;

	protected final JTextArea txtInfoText;
	protected final JRadioButton rbtnNewVmImage;
	protected final JRadioButton rbtnNewDockerImage;
	protected final ButtonGroup btgrpImageTyp;

	/**
	 * Page to choose between new VM-Image or Docker Image
	 */
	public ImageTypePageLayout(Wizard wizard) {

		super(wizard, I18n.PAGE_LAYOUT.getString("ImageTypePageLayout.WizardPage.title"));
		setDescription(I18n.PAGE_LAYOUT.getString("ImageTypePageLayout.WizardPage.description"));
		GridManager grid = new GridManager(this, 4, false);

		// Choose between new vm or new docker-image
		txtInfoText = new JTextArea();
		txtInfoText.setBorder(BorderFactory.createTitledBorder(I18n.PAGE_LAYOUT.getString("ImageTypePageLayout.newVmInformation.border")));
		txtInfoText.setLineWrap(true);
		txtInfoText.setWrapStyleWord(true);
		txtInfoText.setEditable(false);
		txtInfoText.setFocusable(false);
		txtInfoText.setOpaque(false);
		txtInfoText.setText(I18n.PAGE_LAYOUT.getString("ImageTypePageLayout.newVmInformation.text"));
		grid.add(txtInfoText, 4).fill(true, false).expand(true, false);
		grid.nextRow();
		grid.nextRow();

		rbtnNewVmImage = new JRadioButton(I18n.PAGE_LAYOUT.getString("ImageTypePageLayout.button.newVM"));
		grid.add(rbtnNewVmImage, 2, 2).fill(true, true).expand(true, true);
		rbtnNewDockerImage = new JRadioButton(I18n.PAGE_LAYOUT.getString("ImageTypePageLayout.button.newDocker"));
		grid.add(rbtnNewDockerImage, 2, 2).fill(true, true).expand(true, true);

		btgrpImageTyp = new ButtonGroup();
		btgrpImageTyp.add(rbtnNewVmImage);
		btgrpImageTyp.add(rbtnNewDockerImage);

		grid.finish(false);

	}
}