Search in sources :

Example 1 with GeneralFormPanel

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);
        }
    }
}
Also used : FormBuilder(org.ovirt.engine.ui.common.widget.form.FormBuilder) FormItem(org.ovirt.engine.ui.common.widget.form.FormItem) StringValueLabel(org.ovirt.engine.ui.common.widget.label.StringValueLabel) GeneralFormPanel(org.ovirt.engine.ui.common.widget.form.GeneralFormPanel)

Aggregations

FormBuilder (org.ovirt.engine.ui.common.widget.form.FormBuilder)1 FormItem (org.ovirt.engine.ui.common.widget.form.FormItem)1 GeneralFormPanel (org.ovirt.engine.ui.common.widget.form.GeneralFormPanel)1 StringValueLabel (org.ovirt.engine.ui.common.widget.label.StringValueLabel)1