Search in sources :

Example 1 with WidgetTooltip

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

the class NetworkItemPanel method initTooltip.

protected void initTooltip() {
    tooltip = new WidgetTooltip(getContents());
    tooltip.setPlacement(Placement.BOTTOM);
    SafeHtml tooltipContent = infoPopup.getTooltipContent(item);
    if (tooltipContent != null) {
        tooltip.setHtml(tooltipContent);
    }
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) WidgetTooltip(org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip)

Example 2 with WidgetTooltip

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

the class TooltippedIcon method createTooltip.

private WidgetTooltip createTooltip(Widget widget) {
    WidgetTooltip tooltip = new WidgetTooltip(widget);
    setWidget(tooltip);
    return tooltip;
}
Also used : WidgetTooltip(org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip)

Example 3 with WidgetTooltip

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

the class VmInterfaceListGroupItem method createLinkStatusPanel.

private IsWidget createLinkStatusPanel(boolean isLinked) {
    IconStatusPanel iconStatusPanel = new IconStatusPanel(isLinked ? IconType.ARROW_CIRCLE_O_UP : IconType.ARROW_CIRCLE_O_DOWN);
    iconStatusPanel.addStyleName(DOUBLE_SIZE);
    iconStatusPanel.getElement().getStyle().setColor(isLinked ? GREEN : RED);
    String tooltipText = isLinked ? constants.linkedNetworkInterface() : constants.unlinkedNetworkInterface();
    WidgetTooltip tooltip = new WidgetTooltip(iconStatusPanel);
    tooltip.setHtml(SafeHtmlUtils.fromString(tooltipText));
    return tooltip;
}
Also used : WidgetTooltip(org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip)

Example 4 with WidgetTooltip

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

the class VmInterfaceListGroupItem method createCardPluggedStatusPanel.

private IsWidget createCardPluggedStatusPanel(boolean isPlugged) {
    Span linkStatusPanel = new Span();
    Span icon = new Span();
    icon.addStyleName(Styles.ICON_STACK);
    Italic plugItalic = new Italic();
    plugItalic.addStyleName(Styles.FONT_AWESOME_BASE);
    plugItalic.addStyleName(Styles.ICON_STACK_TOP);
    plugItalic.addStyleName(ROTATE_270);
    plugItalic.addStyleName(IconType.PLUG.getCssName());
    icon.add(plugItalic);
    if (!isPlugged) {
        Italic unplugged = new Italic();
        unplugged.addStyleName(Styles.FONT_AWESOME_BASE);
        unplugged.addStyleName(Styles.ICON_STACK_TOP);
        unplugged.addStyleName(DANGER);
        unplugged.addStyleName(IconType.BAN.getCssName());
        icon.add(unplugged);
    }
    linkStatusPanel.add(icon);
    linkStatusPanel.addStyleName(DOUBLE_SIZE);
    String tooltipText = isPlugged ? constants.pluggedNetworkInterface() : constants.unpluggedNetworkInterface();
    WidgetTooltip tooltip = new WidgetTooltip(linkStatusPanel);
    tooltip.setHtml(SafeHtmlUtils.fromString(tooltipText));
    return tooltip;
}
Also used : Italic(org.gwtbootstrap3.client.ui.html.Italic) Span(org.gwtbootstrap3.client.ui.html.Span) WidgetTooltip(org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip)

Example 5 with WidgetTooltip

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

the class TemplateGeneralModelForm 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() {
    driver.initialize(this);
    isHighlyAvailable = new BooleanLabel(constants.yes(), constants.no());
    // Build a form using the FormBuilder
    formBuilder.addFormItem(new FormItem(constants.nameTemplateGeneral(), name, 0, 0));
    formBuilder.addFormItem(new FormItem(constants.descriptionTemplateGeneral(), description, 1, 0));
    formBuilder.addFormItem(new FormItem(constants.hostClusterTemplateGeneral(), hostCluster, 2, 0));
    formBuilder.addFormItem(new FormItem(constants.osTemplateGeneral(), 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.optimizedFor(), optimizedForSystemProfile, 6, 0));
    formBuilder.addFormItem(new FormItem(constants.definedMemTemplateGeneral(), definedMemory, 0, 1));
    WidgetTooltip cpuInfoWithTooltip = new WidgetTooltip(cpuInfo);
    cpuInfoWithTooltip.setHtml(SafeHtmlUtils.fromString(constants.numOfCpuCoresTooltip()));
    formBuilder.addFormItem(new FormItem(constants.numOfCpuCoresTemplateGeneral(), cpuInfoWithTooltip, 1, 1));
    formBuilder.addFormItem(new FormItem(constants.numOfMonitorsTemplateGeneral(), monitorCount, 2, 1));
    formBuilder.addFormItem(new FormItem(constants.highlyAvailTemplateGeneral(), isHighlyAvailable, 3, 1));
    formBuilder.addFormItem(new FormItem(constants.priorityTemplateGeneral(), priority, 4, 1));
    formBuilder.addFormItem(new FormItem(constants.usbPolicyTemplateGeneral(), usbPolicy, 5, 1) {

        @Override
        public boolean getIsAvailable() {
            return getModel().getHasUsbPolicy();
        }
    });
    formBuilder.addFormItem(new FormItem(constants.originTemplateGeneral(), origin, 0, 2));
    formBuilder.addFormItem(new FormItem(constants.isStatelessTemplateGeneral(), isStateless, 1, 2));
    formBuilder.addFormItem(new FormItem(constants.templateId(), templateId, 2, 2));
    formBuilder.addFormItem(new FormItem(constants.domainTemplateGeneral(), domain, 3, 2) {

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

        @Override
        public boolean getIsAvailable() {
            return getModel().getHasTimeZone();
        }
    });
    formBuilder.addFormItem(new FormItem(constants.quotaTemplateGeneral(), quotaName, 5, 2) {

        @Override
        public boolean getIsAvailable() {
            return getModel().isQuotaAvailable();
        }
    }.withDefaultValue(constants.notConfigured(), () -> {
        String quotaName = getModel().getQuotaName();
        return quotaName == null || "".equals(quotaName);
    }));
}
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)

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