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
|
package org.openslx.dozmod.gui.wizard.layout;
import java.awt.event.KeyEvent;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JTextArea;
import javax.swing.JTextField;
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;
@SuppressWarnings("serial")
public abstract class ImageUploadPageLayout extends WizardPage {
protected JTextField imageNameTextField;
protected JButton imageFileBrowseButton;
protected JTextField imageFileTextField;
protected JCheckBox softwareLicenseBox;
protected QLabel imageNameCaption;
/**
* Page for uploading an imagefile
*/
public ImageUploadPageLayout(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");
imageFileTextField = new JTextField();
imageFileTextField.setEditable(false);
imageFileBrowseButton = new JButton("Durchsuchen");
imageFileBrowseButton.setMnemonic(KeyEvent.VK_B);
grid.add(imageFileCaption);
grid.add(imageFileTextField).fill(true, false).expand(true, false);
grid.add(imageFileBrowseButton);
grid.nextRow();
imageNameCaption = new QLabel("Name");
imageNameTextField = new JTextField();
grid.add(imageNameCaption);
grid.add(imageNameTextField, 2, 1).fill(true, false).expand(true, false);
grid.nextRow();
// -- Software license changed - shown only in UploadWizard --
softwareLicenseBox = new JCheckBox("enthält lizenzpflichtige Software");
softwareLicenseBox.setVisible(false);
grid.skip();
grid.add(softwareLicenseBox, 2, 1).fill(false, false).expand(true, false);
grid.nextRow();
grid.add(Box.createVerticalGlue(), 3).expand(true, true);
// -- info text field --
JTextArea infoText = new JTextArea();
infoText.setBorder(BorderFactory.createTitledBorder("Hinweis"));
infoText.setLineWrap(true);
infoText.setWrapStyleWord(true);
infoText.setEditable(false);
infoText.setFocusable(false);
infoText.setOpaque(false);
infoText.setText("Haben Sie noch keine eigene Virtuelle Maschine erstellt, "
+ "können Sie sich in der Übersicht eine Virtuelle Maschine als Vorlage herunterladen, "
+ "diese an Ihre Bedürfnisse anpassen und anschließend über diesen Assistenten hochladen.");
grid.add(infoText, 3).fill(true, false).expand(true, false);
grid.nextRow();
grid.finish(false);
}
}
|