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); } }