use of org.ovirt.engine.ui.common.widget.form.GeneralFormPanel in project ovirt-engine by oVirt.
the class HostGeneralSubTabView method refreshHBADeviceInfo.
private void refreshHBADeviceInfo(VDS selectedItem) {
/* refresh all the information about Host Bus Adapter (FC, iSCSI) devices */
hbaInventory.clear();
if (selectedItem != null && hardWareModelProvider.getModel().getHbaDevices() != null) {
/*
* traverse the model and get all the HBAs
*/
for (EnumMap<HostHardwareGeneralModel.HbaDeviceKeys, String> hbaDevice : hardWareModelProvider.getModel().getHbaDevices()) {
GeneralFormPanel hbaFormPanel = new GeneralFormPanel() {
{
getElement().getStyle().setFloat(Float.LEFT);
getElement().getStyle().setBorderWidth(1, Unit.PX);
getElement().getStyle().setBorderStyle(BorderStyle.SOLID);
// $NON-NLS-1$
getElement().getStyle().setBorderColor("black");
getElement().getStyle().setMarginLeft(5, Unit.PX);
getElement().getStyle().setMarginBottom(5, Unit.PX);
// $NON-NLS-1$ //$NON-NLS-2$
getElement().getStyle().setProperty("width", "auto");
}
};
StringValueLabel interfaceName = new StringValueLabel(hbaDevice.get(HostHardwareGeneralModel.HbaDeviceKeys.MODEL_NAME));
StringValueLabel interfaceType = new StringValueLabel(hbaDevice.get(HostHardwareGeneralModel.HbaDeviceKeys.TYPE));
StringValueLabel interfaceWWNN = new StringValueLabel(hbaDevice.get(HostHardwareGeneralModel.HbaDeviceKeys.WWNN));
StringValueLabel portWWPNs = new StringValueLabel(hbaDevice.get(HostHardwareGeneralModel.HbaDeviceKeys.WWNPS));
FormBuilder hbaFormBuilder = new FormBuilder(hbaFormPanel, 1, 4);
hbaFormBuilder.setRelativeColumnWidth(0, 12);
hbaFormBuilder.addFormItem(new FormItem(constants.hbaModelName(), interfaceName, 0, 0));
hbaFormBuilder.addFormItem(new FormItem(constants.hbaDeviceType(), interfaceType, 1, 0));
hbaFormBuilder.addFormItem(new FormItem(constants.hbaWWNN(), interfaceWWNN, 2, 0));
hbaFormBuilder.addFormItem(new FormItem(constants.hbaWWPNs(), portWWPNs, 3, 0));
hbaInventory.add(hbaFormPanel);
}
}
}
Aggregations