diff options
author | Simon Rettberg | 2021-07-05 18:45:57 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-08-12 14:41:19 +0200 |
commit | 389a1ffc4388352f8fefb908f50cc48dcc2747a1 (patch) | |
tree | e89ce8c17bc7691b3288bc3cf97d0449b3412cab /dozentenmodul | |
parent | [client] Set anti aliasing properties after LAF initialization (diff) | |
download | tutor-module-389a1ffc4388352f8fefb908f50cc48dcc2747a1.tar.gz tutor-module-389a1ffc4388352f8fefb908f50cc48dcc2747a1.tar.xz tutor-module-389a1ffc4388352f8fefb908f50cc48dcc2747a1.zip |
[*] Adapt to de-genricization of VirtualizationConfiguration
Diffstat (limited to 'dozentenmodul')
5 files changed, 129 insertions, 320 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java index 6d0bac85..3fccf3dd 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java @@ -24,9 +24,10 @@ import org.openslx.dozmod.thrift.ImageDetailsActions; import org.openslx.dozmod.thrift.ImageDetailsActions.VirtConfCallback; import org.openslx.dozmod.thrift.cache.MetaDataCache; import org.openslx.util.XmlHelper; +import org.openslx.virtualization.configuration.VirtualizationConfiguration; +import org.openslx.virtualization.configuration.VirtualizationConfigurationException; import org.openslx.virtualization.configuration.VirtualizationConfigurationVirtualBox; import org.openslx.virtualization.configuration.VirtualizationConfigurationVmwareFileFormat; -import org.openslx.virtualization.configuration.VirtualizationConfiguration; public class VirtConfigEditorWindow extends VirtConfigEditorWindowLayout implements UiFeedback { @@ -90,11 +91,11 @@ public class VirtConfigEditorWindow extends VirtConfigEditorWindowLayout impleme // cs is now either the detected encoding, or latin1 as a default uiBytes = userInput.getBytes(cs); // now we should have the correct bytes... - VirtualizationConfiguration<?, ?, ?, ?> virtualizationConfig = null; + VirtualizationConfiguration virtualizationConfig = null; try { virtualizationConfig = VirtualizationConfiguration.getInstance(MetaDataCache.getOperatingSystems(), uiBytes, uiBytes.length); - } catch (IOException e) { + } catch (IOException | VirtualizationConfigurationException e) { LOGGER.error("Could not get VmMetaData instance from given machine description: ", e); } if (virtualizationConfig == null) { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java index 680b9b7c..cf055cbd 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java @@ -1,36 +1,58 @@ package org.openslx.dozmod.gui.window; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Insets; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JEditorPane; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; import org.apache.log4j.Logger; import org.openslx.dozmod.gui.Gui; +import org.openslx.dozmod.gui.control.ComboBox; +import org.openslx.dozmod.gui.control.ComboBox.ComboBoxRenderer; +import org.openslx.dozmod.gui.control.WordWrapLabel; +import org.openslx.dozmod.gui.helper.GridManager; import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.gui.helper.UiFeedback; -import org.openslx.dozmod.gui.window.layout.VirtDropDownConfigEditorWindowLayout; import org.openslx.dozmod.thrift.ImageDetailsActions; -import org.openslx.dozmod.thrift.Session; import org.openslx.dozmod.thrift.ImageDetailsActions.VirtConfCallback; import org.openslx.dozmod.thrift.cache.MetaDataCache; -import org.openslx.sat.thrift.version.Feature; import org.openslx.util.ThriftUtil; import org.openslx.util.XmlHelper; -import org.openslx.virtualization.configuration.VirtualizationConfigurationVirtualBox; -import org.openslx.virtualization.Version; import org.openslx.virtualization.configuration.VirtualizationConfiguration; -import org.openslx.virtualization.configuration.VirtualizationConfiguration.DDAcceleration; -import org.openslx.virtualization.configuration.VirtualizationConfiguration.EthernetDevType; -import org.openslx.virtualization.configuration.VirtualizationConfiguration.SoundCardType; -import org.openslx.virtualization.configuration.VirtualizationConfiguration.UsbSpeed; +import org.openslx.virtualization.configuration.VirtualizationConfiguration.ConfigurableOptionGroup; +import org.openslx.virtualization.configuration.VirtualizationConfigurationException; +import org.openslx.virtualization.configuration.VirtualizationConfigurationVirtualBox; +import org.openslx.virtualization.hardware.VirtOptionValue; -public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWindowLayout +public class VirtDropDownConfigEditorWindow extends JDialog implements UiFeedback { + protected final JScrollPane pnlScrollPane; + protected final JEditorPane pnlEditor; + protected final JButton btnSave; + protected final JButton btnCancel; + protected final JButton btnMore; + protected final List<JComboBox<VirtOptionValue>> cboHardwareOptions; + /** * Version for serialization. */ @@ -45,91 +67,106 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind private final String imageVersionId; private final String originalMachineDescription; private final VirtDropDownConfigEditorWindow me = this; - private VirtualizationConfiguration<?, ?, ?, ?> virtualizationConfig = null; + private final VirtualizationConfiguration virtualizationConfig; private final ImageDetailsActions actionHandler; protected VirtDropDownConfigEditorWindow(Window modalParent, final ImageDetailsActions actionHandler, - final String imageVersionId, final ByteBuffer machineDescription) { - super(modalParent); + final String imageVersionId, final ByteBuffer machineDescription) + throws IOException, VirtualizationConfigurationException { + super(modalParent, I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Dialog.title"), + modalParent != null ? ModalityType.APPLICATION_MODAL : ModalityType.MODELESS); + + byte[] machineData = ThriftUtil.unwrapByteBuffer(machineDescription); + virtualizationConfig = VirtualizationConfiguration.getInstance(MetaDataCache.getOperatingSystems(), + machineData, machineData.length); this.actionHandler = actionHandler; this.imageVersionId = imageVersionId; - // and now for the meta data - byte[] machineData = ThriftUtil.unwrapByteBuffer(machineDescription); - try { - virtualizationConfig = VirtualizationConfiguration.getInstance(MetaDataCache.getOperatingSystems(), - machineData, machineData.length); - } catch (IOException e) { - LOGGER.error("Could not get VmMetaData instance from given machine description: ", e); - } - - if (virtualizationConfig == null) { - this.originalMachineDescription = null; - dispose(); - return; - } + // Configurable options, list of groups, each containing all valid options for group + List<ConfigurableOptionGroup> groups = virtualizationConfig.getConfigurableOptions(); + cboHardwareOptions = new ArrayList<JComboBox<VirtOptionValue>>(groups.size()); - initializeSoundBox(virtualizationConfig.getSupportedSoundCards()); - initializeDDABox(virtualizationConfig.getSupportedDDAccs()); - initializeHWVersBox(virtualizationConfig.getVirtualizer().getSupportedVersions()); - initializeEDTBox(virtualizationConfig.getSupportedEthernetDevices()); - initializeUsbBox(virtualizationConfig.getSupportedUsbSpeeds()); + GridManager grid = new GridManager(getContentPane(), 2, true, new Insets(2, 2, 2, 2)); - //set the initial state of the buttons - initializeComboBoxes(virtualizationConfig); + /* + * extra JPanel for the Warning message + */ + JPanel pnlWarning = new JPanel(); + pnlWarning.setBorder(BorderFactory.createTitledBorder( + I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.TitledBorder.pnlWarning.title"))); + pnlWarning.setLayout(new BorderLayout()); + pnlWarning.add(new WordWrapLabel( + I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Label.pnlWarning.text")), + BorderLayout.CENTER); - // listener for the sound card drop box - cboSound.addActionListener(new ActionListener() { + ComboBoxRenderer<VirtOptionValue> renderer = new ComboBoxRenderer<VirtOptionValue>() { @Override - public void actionPerformed(ActionEvent e) { - SoundCardType selected = (SoundCardType) cboSound.getSelectedItem(); - virtualizationConfig.setSoundCard(selected); - btnSave.setEnabled(hasChanged()); + public String renderItem(VirtOptionValue item) { + if (item == null) + return "???"; + return item.getDisplayName(); } - }); + }; - // listener for the 3Dacceleration drop box - cbo3DAcceleration.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - DDAcceleration selected = (DDAcceleration) cbo3DAcceleration.getSelectedItem(); - virtualizationConfig.setDDAcceleration(selected); - btnSave.setEnabled(hasChanged()); - } - }); + pnlEditor = new JEditorPane("text/plain", null); + pnlScrollPane = new JScrollPane(pnlEditor, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - // listener for the Hardware version drop box - cboHWVersion.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - Version selected = (Version) cboHWVersion.getSelectedItem(); - virtualizationConfig.setVirtualizerVersion(selected); - btnSave.setEnabled(hasChanged()); + grid.add(pnlWarning, 2).fill(true, false).expand(true, false); + grid.nextRow(); + + for (ConfigurableOptionGroup group : groups) { + ComboBox<VirtOptionValue> box = new ComboBox<VirtOptionValue>(renderer, VirtOptionValue.class); + for (VirtOptionValue option : group.availableOptions) { + box.addItem(option); } - }); + box.setSelectedItem(group.getSelected()); + cboHardwareOptions.add(box); + grid.add(new JLabel(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Label." + + group.groupIdentifier.i18n + ".text"))) + .fill(true, false).expand(false, false); + grid.add(box).fill(true, false).expand(true, false); + grid.nextRow(); + } + + grid.add(Box.createVerticalGlue(), 2).expand(true, true); + grid.nextRow(); + + JPanel buttonPane = new JPanel(); + buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); + buttonPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + buttonPane.add(Box.createHorizontalGlue()); + btnMore = new JButton(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Button.more.text")); + buttonPane.add(btnMore); + buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); + btnCancel = new JButton(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Button.cancel.text")); + buttonPane.add(btnCancel); + buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); + btnSave = new JButton(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Button.save.text")); + buttonPane.add(btnSave); + grid.add(buttonPane, 2).fill(true, false).expand(true, false); + grid.finish(false); + + setPreferredSize(Gui.getScaledDimension(600, 400)); + setMinimumSize(Gui.getScaledDimension(450, 375)); + if (modalParent != null) { + Gui.centerShellOverShell(modalParent, this); + } // listener for the Virtual Ethernet device drop box - cboE0VirtDev.addActionListener(new ActionListener() { + ActionListener hwListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - EthernetDevType selected = (EthernetDevType) cboE0VirtDev.getSelectedItem(); - virtualizationConfig.setEthernetDevType(0, selected); + VirtOptionValue selected = (VirtOptionValue) ((JComboBox<VirtOptionValue>) e.getSource()).getSelectedItem(); + selected.apply(); btnSave.setEnabled(hasChanged()); } - }); - - if (Session.hasFeature(Feature.CONFIGURE_USB)) { - cboMaxUsbSpeed.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - UsbSpeed selected = (UsbSpeed) cboMaxUsbSpeed.getSelectedItem(); - virtualizationConfig.setMaxUsbSpeed(selected); - btnSave.setEnabled(hasChanged()); - } - }); + }; + for (JComboBox<VirtOptionValue> box : cboHardwareOptions) { + box.addActionListener(hwListener); } - + // listener for the save button btnSave.addActionListener(new ActionListener() { @Override @@ -172,34 +209,6 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind btnSave.setEnabled(false); } - /* - * setting the boxes to their initial value...value is read from the given virtualization configuration - */ - private void initializeComboBoxes(VirtualizationConfiguration<?, ?, ?, ?> m) { - try { - SoundCardType SCT = m.getSoundCard(); - cboSound.setSelectedItem(SCT); - DDAcceleration DDA = m.getDDAcceleration(); - cbo3DAcceleration.setSelectedItem(DDA); - - // initialize version value in combobox - Version HWV = m.getVirtualizerVersion(); - if (HWV != null) { - // set version value specified in the virtualization configuration as default if specified - cboHWVersion.setSelectedItem(HWV); - } - - EthernetDevType E0VD = m.getEthernetDevType(0); - cboE0VirtDev.setSelectedItem(E0VD); - UsbSpeed usbSpeed = m.getMaxUsbSpeed(); - cboMaxUsbSpeed.setSelectedItem(usbSpeed); - } catch (IllegalArgumentException e) { - // TODO improve user message - Gui.showMessageBox(I18n.WINDOW.getString("VirtDropDownConfigEditor.Message.warning.initializeComboBoxes"), - MessageType.WARNING, null, e); - } - } - private void saveClicked() { // we have a valid vmx or the user accepted to push the filtered input actionHandler.setVirtualizerConfig(imageVersionId, ByteBuffer.wrap(virtualizationConfig.getConfigurationAsByteArray()), @@ -215,13 +224,20 @@ public class VirtDropDownConfigEditorWindow extends VirtDropDownConfigEditorWind public static void open(Window modalParent, final ImageDetailsActions handler, final String imageVersionId, final ByteBuffer machineDescription) { - VirtDropDownConfigEditorWindow win = new VirtDropDownConfigEditorWindow(modalParent, handler, - imageVersionId, machineDescription); + VirtDropDownConfigEditorWindow win; + try { + win = new VirtDropDownConfigEditorWindow(modalParent, handler, + imageVersionId, machineDescription); + } catch (IOException | VirtualizationConfigurationException e) { + Gui.showMessageBox(I18n.WINDOW.getString("VirtDropDownConfigEditor.Message.error.loadMachineConfig"), + MessageType.WARNING, LOGGER, e); + return; + } win.setVisible(true); } private boolean hasChanged() { - return !originalMachineDescription + return originalMachineDescription != null && !originalMachineDescription .equals(ThriftUtil.byteBufferToString(ByteBuffer.wrap(virtualizationConfig.getConfigurationAsByteArray()))); } diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtDropDownConfigEditorWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtDropDownConfigEditorWindowLayout.java deleted file mode 100644 index 24e41e78..00000000 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtDropDownConfigEditorWindowLayout.java +++ /dev/null @@ -1,208 +0,0 @@ -package org.openslx.dozmod.gui.window.layout; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.Window; -import java.util.List; - -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.BoxLayout; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JDialog; -import javax.swing.JEditorPane; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JScrollPane; - -import org.openslx.dozmod.gui.Gui; -import org.openslx.dozmod.gui.control.ComboBox; -import org.openslx.dozmod.gui.control.ComboBox.ComboBoxRenderer; -import org.openslx.dozmod.gui.control.WordWrapLabel; -import org.openslx.dozmod.gui.helper.GridManager; -import org.openslx.dozmod.gui.helper.I18n; -import org.openslx.dozmod.thrift.Session; -import org.openslx.sat.thrift.version.Feature; -import org.openslx.virtualization.configuration.VirtualizationConfiguration.DDAcceleration; -import org.openslx.virtualization.configuration.VirtualizationConfiguration.EthernetDevType; -import org.openslx.virtualization.Version; -import org.openslx.virtualization.configuration.VirtualizationConfiguration.SoundCardType; -import org.openslx.virtualization.configuration.VirtualizationConfiguration.UsbSpeed; - -public class VirtDropDownConfigEditorWindowLayout extends JDialog { - - /** - * Version for serialization. - */ - private static final long serialVersionUID = -8808628177189132030L; - - protected final JScrollPane pnlScrollPane; - protected final JEditorPane pnlEditor; - protected final JButton btnSave; - protected final JButton btnCancel; - protected final JButton btnMore; - protected final JComboBox<SoundCardType> cboSound; - protected final JComboBox<DDAcceleration> cbo3DAcceleration; - protected final JComboBox<Version> cboHWVersion; - protected final JComboBox<EthernetDevType> cboE0VirtDev; - protected final JComboBox<UsbSpeed> cboMaxUsbSpeed; - - protected VirtDropDownConfigEditorWindowLayout(Window modalParent) { - super(modalParent, I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Dialog.title"), - modalParent != null ? ModalityType.APPLICATION_MODAL : ModalityType.MODELESS); - - GridManager grid = new GridManager(getContentPane(), 2, true, new Insets(2, 2, 2, 2)); - - /* - * extra JPanel for the Warning message - */ - JPanel pnlWarning = new JPanel(); - pnlWarning.setBorder(BorderFactory.createTitledBorder( - I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.TitledBorder.pnlWarning.title"))); - pnlWarning.setLayout(new BorderLayout()); - pnlWarning.add(new WordWrapLabel( - I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Label.pnlWarning.text")), - BorderLayout.CENTER); - - /* - * ComboBoxes - one for each device - */ - - cboSound = new ComboBox<SoundCardType>(new ComboBoxRenderer<SoundCardType>() { - @Override - public String renderItem(SoundCardType item) { - return item.displayName; - } - }, SoundCardType.class); - - // 3D accelerationBox - cbo3DAcceleration = new ComboBox<DDAcceleration>(new ComboBoxRenderer<DDAcceleration>() { - @Override - public String renderItem(DDAcceleration item) { - return item.displayName; - } - }, DDAcceleration.class); - - // HardwareVersioBox - cboHWVersion = new ComboBox<Version>(new ComboBoxRenderer<Version>() { - @Override - public String renderItem(org.openslx.virtualization.Version item) { - return item.getName(); - } - }, Version.class); - - // HardwareVersioBox - cboE0VirtDev = new ComboBox<EthernetDevType>(new ComboBoxRenderer<EthernetDevType>() { - @Override - public String renderItem(EthernetDevType item) { - return item.displayName; - } - }, EthernetDevType.class); - - cboMaxUsbSpeed = new ComboBox<UsbSpeed>(new ComboBoxRenderer<UsbSpeed>() { - @Override - public String renderItem(UsbSpeed item) { - return item.displayName; - } - }, UsbSpeed.class); - - pnlEditor = new JEditorPane("text/plain", null); - pnlScrollPane = new JScrollPane(pnlEditor, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, - JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - - grid.add(pnlWarning, 2).fill(true, false).expand(true, false); - grid.nextRow(); - grid.add(new JLabel(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Label.sound.text"))) - .fill(true, false).expand(false, false); - grid.add(cboSound).fill(true, false).expand(false, false); - grid.nextRow(); - grid.add(new JLabel(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Label.3DAcceleration.text"))) - .fill(true, false).expand(false, false); - grid.add(cbo3DAcceleration).fill(true, false).expand(true, false); - grid.nextRow(); - grid.add(new JLabel(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Label.HWVersion.text"))) - .fill(true, false).expand(false, false); - grid.add(cboHWVersion).fill(true, false).expand(true, false); - grid.nextRow(); - grid.add(new JLabel(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Label.E0VirtDev.text"))) - .fill(true, false).expand(false, false); - grid.add(cboE0VirtDev).fill(true, false).expand(true, false); - grid.nextRow(); - if (Session.hasFeature(Feature.CONFIGURE_USB)) { - grid.add(new JLabel(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Label.maxUSBSpeed.text"))) - .fill(true, false).expand(false, false); - grid.add(cboMaxUsbSpeed).fill(true, false).expand(true, false); - grid.nextRow(); - } - - grid.add(Box.createVerticalGlue(), 2).expand(true, true); - grid.nextRow(); - - JPanel buttonPane = new JPanel(); - buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); - buttonPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - buttonPane.add(Box.createHorizontalGlue()); - btnMore = new JButton(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Button.more.text")); - buttonPane.add(btnMore); - buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); - btnCancel = new JButton(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Button.cancel.text")); - buttonPane.add(btnCancel); - buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); - btnSave = new JButton(I18n.WINDOW_LAYOUT.getString("VirtDropDownConfigEditor.Button.save.text")); - buttonPane.add(btnSave); - grid.add(buttonPane, 2).fill(true, false).expand(true, false); - grid.finish(false); - - setPreferredSize(Gui.getScaledDimension(600, 400)); - setMinimumSize(Gui.getScaledDimension(450, 375)); - if (modalParent != null) { - Gui.centerShellOverShell(modalParent, this); - } - } - - // SoundBox - public void initializeSoundBox(List<SoundCardType> list) { - for (SoundCardType i : list) { - cboSound.addItem(i); - } - } - - // 3 D acceleration - public void initializeDDABox(List<DDAcceleration> list) { - for (DDAcceleration i : list) { - cbo3DAcceleration.addItem(i); - } - } - - // Hardware version - public void initializeHWVersBox(List<Version> list) { - if (list == null || list.isEmpty()) { - // disable selection of items if list does not contain any items - cboHWVersion.setEnabled(false); - } else { - // append items to combobox if list contains items - for (Version i : list) { - cboHWVersion.addItem(i); - } - - // enable selection of items - cboHWVersion.setEnabled(true); - } - } - - // Ethernet Device type - public void initializeEDTBox(List<EthernetDevType> list) { - for (EthernetDevType i : list) { - cboE0VirtDev.addItem(i); - } - } - - // USB Speed - public void initializeUsbBox(List<UsbSpeed> list) { - for (UsbSpeed i : list) { - cboMaxUsbSpeed.addItem(i); - } - } -} diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/state/UploadWizardState.java b/dozentenmodul/src/main/java/org/openslx/dozmod/state/UploadWizardState.java index cbbaf475..ad877d91 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/state/UploadWizardState.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/state/UploadWizardState.java @@ -52,7 +52,7 @@ public class UploadWizardState { /** * Meta data (description file content) of this VM */ - public VirtualizationConfiguration<?,?,?,?> virtualizationConfig = null; + public VirtualizationConfiguration virtualizationConfig = null; // To be able to call the conversion Page from within the ImageUploadPage // TODO find cleaner approach, this probably shouldn't be in here.. diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java index 71c39f16..85703ea0 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java @@ -24,15 +24,15 @@ import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.thrift.cache.MetaDataCache; import org.openslx.thrifthelper.TConst; +import org.openslx.virtualization.configuration.VirtualizationConfiguration; +import org.openslx.virtualization.configuration.VirtualizationConfigurationException; import org.openslx.virtualization.configuration.VirtualizationConfigurationVmware; +import org.openslx.virtualization.configuration.data.ConfigurationDataDozModServerToDozModClient; import org.openslx.virtualization.configuration.logic.ConfigurationLogicDozModServerToDozModClient; import org.openslx.virtualization.configuration.transformation.TransformationException; import org.openslx.virtualization.disk.DiskImage; import org.openslx.virtualization.disk.DiskImageException; import org.openslx.virtualization.disk.DiskImageVmdk; -import org.openslx.virtualization.configuration.VirtualizationConfiguration; -import org.openslx.virtualization.configuration.VirtualizationConfigurationException; -import org.openslx.virtualization.configuration.data.ConfigurationDataDozModServerToDozModClient; public class VmWrapper { @@ -66,7 +66,7 @@ public class VmWrapper { } // handle machine description to generate configuration file - final VirtualizationConfiguration<?, ?, ?, ?> virtualizationConfig = VirtualizationConfiguration + final VirtualizationConfiguration virtualizationConfig = VirtualizationConfiguration .getInstance(MetaDataCache.getOperatingSystems(), machineDescription, machineDescription.length); // transform virtualization configuration for local editing |