Search in sources :

Example 16 with Container

use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.

the class NetworkOutOfSyncPanel method addOutOfSyncRow.

private void addOutOfSyncRow(List<Label> values, TextAlign textAlign, boolean bottomBorderSolid) {
    Row row = new Row();
    Column mainColumn = new Column(MAIN_COLUMN_SIZE);
    boolean firstTime = true;
    for (Label label : values) {
        Column subColumn;
        if (firstTime) {
            subColumn = new Column(PROPERTY_COLUMN_SIZE);
            firstTime = false;
        } else {
            subColumn = new Column(COLUMN_SIZE);
            subColumn.getElement().getStyle().setTextAlign(textAlign);
        }
        subColumn.add(label);
        mainColumn.add(subColumn);
    }
    row.add(mainColumn);
    if (bottomBorderSolid) {
        Row container = new Row();
        container.setPaddingBottom(4);
        container.add(row);
        // $NON-NLS-1$ //$NON-NLS-2$
        container.getElement().getStyle().setProperty("margin", "0 0 4px");
        // $NON-NLS-1$ //$NON-NLS-2$
        container.getElement().getStyle().setProperty("borderBottomStyle", "solid");
        // $NON-NLS-1$ //$NON-NLS-2$
        container.getElement().getStyle().setProperty("borderWidth", "1px");
        flowPanel.add(container);
    } else {
        flowPanel.add(row);
    }
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) Label(org.gwtbootstrap3.client.ui.Label) Row(org.gwtbootstrap3.client.ui.Row)

Example 17 with Container

use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.

the class VmInterfaceListGroupItem method createGuestAgentContainerPanel.

private Container createGuestAgentContainerPanel(VmNetworkInterface networkInterface, List<VmGuestAgentInterface> allGuestAgentData) {
    Row content = new Row();
    Column column = new Column(ColumnSize.MD_12);
    content.add(column);
    for (VmGuestAgentInterface guestAgentInterface : allGuestAgentData) {
        if (guestAgentInterface.getMacAddress() != null && guestAgentInterface.getMacAddress().equals(networkInterface.getMacAddress())) {
            DListElement dl = Document.get().createDLElement();
            dl.addClassName(DL_HORIZONTAL);
            addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.nameVmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getInterfaceName()), dl);
            addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv4VmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getIpv4Addresses() != null ? String.join(COMMA_DELIMITER, guestAgentInterface.getIpv4Addresses()) : constants.notAvailableLabel()), dl);
            addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.ipv6VmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getIpv6Addresses() != null ? String.join(COMMA_DELIMITER, guestAgentInterface.getIpv6Addresses()) : constants.notAvailableLabel()), dl);
            addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macVmGuestAgent()), SafeHtmlUtils.fromString(guestAgentInterface.getMacAddress()), dl);
            column.getElement().appendChild(dl);
        }
    }
    if (allGuestAgentData.isEmpty()) {
        Span noDataSpan = new Span();
        noDataSpan.setText(constants.notAvailableLabel());
        column.add(noDataSpan);
    }
    return createItemContainerPanel(content);
}
Also used : VmGuestAgentInterface(org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface) Column(org.gwtbootstrap3.client.ui.Column) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement) Span(org.gwtbootstrap3.client.ui.html.Span)

Example 18 with Container

use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.

the class VmInterfaceListGroupItem method createStatisticsItemContainerPanel.

private Container createStatisticsItemContainerPanel(VmNetworkInterface networkInterface) {
    Row content = new Row();
    Column column = new Column(ColumnSize.MD_12);
    content.add(column);
    RxTxRateRenderer rateRenderer = new RxTxRateRenderer();
    RxTxTotalRenderer totalRenderer = new RxTxTotalRenderer();
    DListElement dl = Document.get().createDLElement();
    dl.addClassName(DL_HORIZONTAL);
    addDetailItem(templates.sub(constants.rxRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { networkInterface.getStatistics().getReceiveRate(), networkInterface.hasSpeed() ? networkInterface.getSpeed().doubleValue() : 0 })), dl);
    addDetailItem(templates.sub(constants.txRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { networkInterface.getStatistics().getTransmitRate(), networkInterface.hasSpeed() ? networkInterface.getSpeed().doubleValue() : 0 })), dl);
    addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.rxTotal()), SafeHtmlUtils.fromString(totalRenderer.render(networkInterface.getStatistics().getReceivedBytes())), dl);
    addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.txTotal()), SafeHtmlUtils.fromString(totalRenderer.render(networkInterface.getStatistics().getTransmittedBytes())), dl);
    addDetailItem(templates.sub(constants.dropsInterface(), constants.pkts()), SafeHtmlUtils.fromString(String.valueOf(networkInterface.getStatistics().getReceiveDropRate() + networkInterface.getStatistics().getTransmitDropRate())), dl);
    column.getElement().appendChild(dl);
    return createItemContainerPanel(content);
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) RxTxRateRenderer(org.ovirt.engine.ui.common.widget.renderer.RxTxRateRenderer) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement) RxTxTotalRenderer(org.ovirt.engine.ui.common.widget.renderer.RxTxTotalRenderer)

Example 19 with Container

use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.

the class VmSnapshotListViewItem method updateValues.

public void updateValues(SnapshotModel snapshotModel) {
    Container currentDetails = disksExpand.getDetails();
    if (currentDetails != null) {
        listGroupItem.remove(currentDetails);
    }
    Container disksInfoContainer = createDisksItemContainerPanel(snapshotModel.getDisks());
    disksExpand.setDetails(disksInfoContainer);
    disksExpand.toggleExpanded(disksExpand.isActive());
    listGroupItem.add(disksInfoContainer);
    currentDetails = nicsExpand.getDetails();
    if (currentDetails != null) {
        listGroupItem.remove(currentDetails);
    }
    Container nicsInfoContainer = createNicsItemContainerPanel(snapshotModel.getNics());
    nicsExpand.setDetails(nicsInfoContainer);
    nicsExpand.toggleExpanded(nicsExpand.isActive());
    listGroupItem.add(nicsInfoContainer);
    currentDetails = installedAppsExpand.getDetails();
    if (currentDetails != null) {
        listGroupItem.remove(currentDetails);
    }
    Container installedAppsInfoContainer = createInstalledAppsItemContainerPanel(snapshotModel.getApps());
    installedAppsExpand.setDetails(installedAppsInfoContainer);
    installedAppsExpand.toggleExpanded(installedAppsExpand.isActive());
    listGroupItem.add(installedAppsInfoContainer);
}
Also used : Container(org.gwtbootstrap3.client.ui.Container)

Example 20 with Container

use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.

the class SubTabDataCenterQosView method setInSlot.

@Override
public void setInSlot(Object slot, IsWidget content) {
    super.setInSlot(slot, content);
    if (slot == AbstractSubTabPresenter.TYPE_SetActionPanel) {
        if (getTableContainer() instanceof FlowPanel) {
            FlowPanel container = (FlowPanel) getTableContainer();
            PageHeader storageHeader = new PageHeader();
            storageHeader.setText(constants.dataCenterStorageQosSubTabLabel());
            container.insert(storageHeader, 0);
        }
    }
}
Also used : PageHeader(org.gwtbootstrap3.client.ui.PageHeader) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Aggregations

Column (org.gwtbootstrap3.client.ui.Column)13 Row (org.gwtbootstrap3.client.ui.Row)13 DListElement (com.google.gwt.dom.client.DListElement)7 Container (org.gwtbootstrap3.client.ui.Container)7 CellTable (com.google.gwt.user.cellview.client.CellTable)2 TextColumn (com.google.gwt.user.cellview.client.TextColumn)2 ListDataProvider (com.google.gwt.view.client.ListDataProvider)2 Button (org.gwtbootstrap3.client.ui.Button)2 Label (org.gwtbootstrap3.client.ui.Label)2 Span (org.gwtbootstrap3.client.ui.html.Span)2 RxTxRateRenderer (org.ovirt.engine.ui.common.widget.renderer.RxTxRateRenderer)2 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)1