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