Search in sources :

Example 16 with WidgetTooltip

use of org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip in project ovirt-engine by oVirt.

the class VmGeneralModelForm method initialize.

/**
 * Initialize the form. Call this after ID has been set on the form,
 * so that form fields can use the ID as their prefix.
 */
public void initialize() {
    isHighlyAvailable = new BooleanLabel(constants.yes(), constants.no());
    driver.initialize(this);
    formBuilder.addFormItem(new FormItem(constants.nameVm(), name, 0, 0));
    formBuilder.addFormItem(new FormItem(constants.descriptionVm(), description, 1, 0));
    formBuilder.addFormItem(new FormItem(constants.templateVm(), template, 2, 0));
    formBuilder.addFormItem(new FormItem(constants.osVm(), oS, 3, 0));
    formBuilder.addFormItem(new FormItem(constants.graphicsProtocol(), graphicsType, 4, 0));
    formBuilder.addFormItem(new FormItem(constants.videoType(), defaultDisplayType, 5, 0));
    formBuilder.addFormItem(new FormItem(constants.priorityVm(), priority, 6, 0));
    formBuilder.addFormItem(new FormItem(constants.optimizedFor(), optimizedForSystemProfile, 7, 0));
    formBuilder.addFormItem(new FormItem(constants.definedMemoryVm(), definedMemory, 0, 1));
    formBuilder.addFormItem(new FormItem(constants.physMemGauranteedVm(), minAllocatedMemory, 1, 1));
    formBuilder.addFormItem(new FormItem(constants.guestFreeCachedBufferedMemInfo(), guestFreeCachedBufferedMemInfo, 2, 1).withDefaultValue(constants.notConfigured(), () -> getModel().getGuestFreeCachedBufferedMemInfo() == null));
    WidgetTooltip cpuInfoWithTooltip = new WidgetTooltip(cpuInfo);
    cpuInfoWithTooltip.setHtml(SafeHtmlUtils.fromString(constants.numOfCpuCoresTooltip()));
    formBuilder.addFormItem(new FormItem(constants.numOfCpuCoresVm(), cpuInfoWithTooltip, 3, 1));
    formBuilder.addFormItem(new FormItem(constants.GuestCpuCount(), guestCpuCount, 4, 1));
    formBuilder.addFormItem(new FormItem(constants.GuestCpuType(), guestCpuType, 5, 1));
    formBuilder.addFormItem(new FormItem(constants.highlyAvailableVm(), isHighlyAvailable, 6, 1));
    formBuilder.addFormItem(new FormItem(constants.numOfMonitorsVm(), monitorCount, 7, 1));
    formBuilder.addFormItem(new FormItem(constants.usbPolicyVm(), usbPolicy, 8, 1));
    formBuilder.addFormItem(new FormItem(constants.createdByUserVm(), createdByUser, 9, 1) {

        @Override
        public boolean getIsAvailable() {
            return getModel().getHasCreatedByUser();
        }
    });
    formBuilder.addFormItem(new FormItem(constants.originVm(), origin, 0, 2));
    formBuilder.addFormItem(new FormItem(constants.runOnVm(), defaultHost, 1, 2));
    formBuilder.addFormItem(new FormItem(constants.customPropertiesVm(), customProperties, 2, 2));
    formBuilder.addFormItem(new FormItem(constants.clusterCompatibilityVersionVm(), compatibilityVersion, 3, 2));
    formBuilder.addFormItem(new FormItem(constants.vmId(), vmId, 4, 2));
    formBuilder.addFormItem(new FormItem(constants.quotaVm(), quotaName, 5, 2) {

        @Override
        public boolean getIsAvailable() {
            return getModel().isQuotaAvailable();
        }
    }.withDefaultValue(constants.notConfigured(), () -> {
        String quotaName = getModel().getQuotaName();
        return quotaName == null || "".equals(quotaName);
    }));
    formBuilder.addFormItem(new FormItem(constants.domainVm(), domain, 6, 2) {

        @Override
        public boolean getIsAvailable() {
            return getModel().getHasDomain();
        }
    });
    formBuilder.addFormItem(new FormItem(constants.fqdn(), fqdn, 7, 2) {

        @Override
        public boolean getIsAvailable() {
            String fqdn = getModel().getFqdn();
            return !(fqdn == null || fqdn.isEmpty());
        }
    });
    formBuilder.addFormItem(new FormItem(constants.timeZoneVm(), timeZone, 8, 2) {

        @Override
        public boolean getIsAvailable() {
            return getModel().getHasTimeZone();
        }
    });
}
Also used : FormItem(org.ovirt.engine.ui.common.widget.form.FormItem) BooleanLabel(org.ovirt.engine.ui.common.widget.label.BooleanLabel) WidgetTooltip(org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip)

Example 17 with WidgetTooltip

use of org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip in project ovirt-engine by oVirt.

the class VmImportGeneralModelForm method initialize.

public void initialize() {
    driver.initialize(this);
    // $NON-NLS-1$
    name.asValueBox().setWidth("130px");
    name.asValueBox().getElement().getParentElement().getStyle().setTop(0, Style.Unit.PX);
    name.asValueBox().getElement().getParentElement().getStyle().setLeft(-5, Style.Unit.PX);
    // $NON-NLS-1$
    operatingSystems.setWidth("130px");
    formBuilder.addFormItem(new FormItem(constants.nameVm(), name, 0, 0));
    formBuilder.addFormItem(new FormItem(constants.osVm(), getOperatingSystemWidget(), 1, 0));
    formBuilder.addFormItem(new FormItem(constants.descriptionVm(), description, 2, 0));
    formBuilder.addFormItem(new FormItem(constants.templateVm(), template, 3, 0));
    formBuilder.addFormItem(new FormItem(constants.videoType(), defaultDisplayType, 4, 0));
    formBuilder.addFormItem(new FormItem(constants.priorityVm(), priority, 5, 0));
    formBuilder.addFormItem(new FormItem(constants.definedMemoryVm(), definedMemory, 6, 0));
    formBuilder.addFormItem(new FormItem(constants.optimizedFor(), optimizedForSystemProfile, 7, 0));
    formBuilder.addFormItem(new FormItem(constants.physMemGauranteedVm(), minAllocatedMemory, 0, 1));
    formBuilder.addFormItem(new FormItem(constants.guestFreeCachedBufferedMemInfo(), guestFreeCachedBufferedMemInfo, 1, 1).withDefaultValue(constants.notConfigured(), () -> getModel().getGuestFreeCachedBufferedMemInfo() == null));
    WidgetTooltip cpuInfoWithTooltip = new WidgetTooltip(cpuInfo);
    cpuInfoWithTooltip.setHtml(SafeHtmlUtils.fromString(constants.numOfCpuCoresTooltip()));
    formBuilder.addFormItem(new FormItem(constants.numOfCpuCoresVm(), cpuInfoWithTooltip, 2, 1));
    formBuilder.addFormItem(new FormItem(constants.GuestCpuCount(), guestCpuCount, 3, 1));
    formBuilder.addFormItem(new FormItem(constants.numOfMonitorsVm(), monitorCount, 4, 1));
    formBuilder.addFormItem(new FormItem(constants.usbPolicyVm(), usbPolicy, 5, 1));
    formBuilder.addFormItem(new FormItem(constants.originVm(), origin, 6, 1));
    formBuilder.addFormItem(new FormItem(constants.runOnVm(), defaultHost, 0, 2));
    formBuilder.addFormItem(new FormItem(constants.customPropertiesVm(), customProperties, 1, 2));
    formBuilder.addFormItem(new FormItem(constants.clusterCompatibilityVersionVm(), compatibilityVersion, 2, 2));
    formBuilder.addFormItem(new FormItem(constants.vmId(), vmId, 3, 2));
    formBuilder.addFormItem(new FormItem(constants.quotaVm(), quotaName, 4, 2) {

        @Override
        public boolean getIsAvailable() {
            return getModel().isQuotaAvailable();
        }
    }.withDefaultValue(constants.notConfigured(), () -> {
        String quotaName = getModel().getQuotaName();
        return quotaName == null || "".equals(quotaName);
    }));
    formBuilder.addFormItem(new FormItem(constants.domainVm(), domain, 5, 2) {

        @Override
        public boolean getIsAvailable() {
            return getModel().getHasDomain();
        }
    });
    formBuilder.addFormItem(new FormItem(constants.fqdn(), fqdn, 6, 2) {

        @Override
        public boolean getIsAvailable() {
            String fqdn = getModel().getFqdn();
            return !(fqdn == null || fqdn.isEmpty());
        }
    });
}
Also used : FormItem(org.ovirt.engine.ui.common.widget.form.FormItem) WidgetTooltip(org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip)

Aggregations

WidgetTooltip (org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip)17 IconStatusPanel (org.ovirt.engine.ui.common.widget.uicommon.vm.IconStatusPanel)6 FormItem (org.ovirt.engine.ui.common.widget.form.FormItem)3 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)2 BooleanLabel (org.ovirt.engine.ui.common.widget.label.BooleanLabel)2 Button (org.gwtbootstrap3.client.ui.Button)1 Italic (org.gwtbootstrap3.client.ui.html.Italic)1 Span (org.gwtbootstrap3.client.ui.html.Span)1 Bond (org.ovirt.engine.core.common.businessentities.network.Bond)1 InterfaceStatus (org.ovirt.engine.core.common.businessentities.network.InterfaceStatus)1 BondedNetworkIcon (org.ovirt.engine.ui.common.widget.uicommon.network.BondedNetworkIcon)1