Search in sources :

Example 16 with Row

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

the class VmSnapshotListViewItem method createGeneralItemContainerPanel.

private Container createGeneralItemContainerPanel(Snapshot snapshot, VmSnapshotListModel listModel) {
    Row content = new Row();
    Column column = new Column(ColumnSize.MD_12);
    content.add(column);
    DListElement dl = Document.get().createDLElement();
    dl.addClassName(DL_HORIZONTAL);
    addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.dateSnapshot()), SafeHtmlUtils.fromString(getCreateDateString(snapshot)), dl);
    addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.statusSnapshot()), SafeHtmlUtils.fromString(snapshot.getStatus().name()), dl);
    addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.memorySnapshot()), SafeHtmlUtils.fromString(String.valueOf(snapshot.containsMemory())), dl);
    addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.descriptionSnapshot()), SafeHtmlUtils.fromTrustedString(getDescription(snapshot)), dl);
    VM entity = listModel.getEntity();
    if (entity != null) {
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.definedMemoryVm()), SafeHtmlUtils.fromString(entity.getVmMemSizeMb() + constants.mb()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.physMemGauranteedVm()), SafeHtmlUtils.fromString(entity.getMinAllocatedMem() + constants.mb()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.numOfCpuCoresVm()), SafeHtmlUtils.fromString(messages.cpuInfoLabel(entity.getNumOfCpus(), entity.getNumOfSockets(), entity.getCpuPerSocket(), entity.getThreadsPerCpu())), dl);
    }
    column.getElement().appendChild(dl);
    return createItemContainerPanel(content);
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) VM(org.ovirt.engine.core.common.businessentities.VM) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement)

Example 17 with Row

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

the class VmSnapshotListViewItem method createDisksItemContainerPanel.

private Container createDisksItemContainerPanel(List<DiskImage> diskImages) {
    Row content = new Row();
    Column column = new Column(ColumnSize.MD_12);
    content.add(column);
    for (DiskImage image : diskImages) {
        DListElement dl = Document.get().createDLElement();
        dl.addClassName(DL_HORIZONTAL);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.statusDisk()), SafeHtmlUtils.fromString(getImageStatus(image.getImageStatus())), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.aliasDisk()), SafeHtmlUtils.fromString(image.getDiskAlias()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.provisionedSizeDisk()), SafeHtmlUtils.fromString(String.valueOf(sizeRenderer.render(image.getSize()))), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.sizeDisk()), SafeHtmlUtils.fromString(String.valueOf(sizeRenderer.render(image.getActualSizeInBytes()))), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.allocationDisk()), SafeHtmlUtils.fromString(String.valueOf(VolumeType.forValue(image.getVolumeType().getValue()))), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.interfaceDisk()), SafeHtmlUtils.fromString(getInterface(image)), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.creationDateDisk()), SafeHtmlUtils.fromString(dateRenderer.render(image.getCreationDate())), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.diskSnapshotIDDisk()), SafeHtmlUtils.fromString(String.valueOf(image.getImageId())), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.typeDisk()), SafeHtmlUtils.fromString(String.valueOf(image.getDiskStorageType())), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.descriptionDisk()), SafeHtmlUtils.fromString(StringHelper.isNotNullOrEmpty(image.getDiskDescription()) ? image.getDiskDescription() : constants.notAvailableLabel()), dl);
        column.getElement().appendChild(dl);
    }
    if (diskImages.isEmpty()) {
        column.getElement().setInnerHTML(constants.noItemsToDisplay());
    }
    return createItemContainerPanel(content);
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) Row(org.gwtbootstrap3.client.ui.Row) DListElement(com.google.gwt.dom.client.DListElement) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Example 18 with Row

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

the class VmSnapshotListViewItem method createInstalledAppsItemContainerPanel.

private Container createInstalledAppsItemContainerPanel(List<String> appList) {
    Row row = new Row();
    Column column = new Column(ColumnSize.MD_12);
    row.add(column);
    Container container = createItemContainerPanel(row);
    for (String appName : appList) {
        column.getElement().setInnerHTML(appName);
        row = new Row();
        column = new Column(ColumnSize.MD_12);
        row.add(column);
        container.add(row);
    }
    if (appList.isEmpty()) {
        column.getElement().setInnerHTML(constants.noItemsToDisplay());
    }
    return container;
}
Also used : Container(org.gwtbootstrap3.client.ui.Container) Column(org.gwtbootstrap3.client.ui.Column) Row(org.gwtbootstrap3.client.ui.Row)

Example 19 with Row

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

the class VmSnapshotListViewItem method createNicsItemContainerPanel.

private Container createNicsItemContainerPanel(List<VmNetworkInterface> nics) {
    RxTxRateRenderer rateRenderer = new RxTxRateRenderer();
    Row content = new Row();
    Container container = createItemContainerPanel(content);
    int i = 0;
    for (VmNetworkInterface nic : nics) {
        if (i % 4 == 0 && i > 0) {
            content = new Row();
            container.add(content);
        }
        Column column = new Column(calculateColSize(i));
        content.add(column);
        DListElement dl = Document.get().createDLElement();
        dl.addClassName(DL_HORIZONTAL);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.nameInterface()), SafeHtmlUtils.fromString(nic.getName()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.networkNameInterface()), SafeHtmlUtils.fromString(nic.getNetworkName()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.profileNameInterface()), SafeHtmlUtils.fromString(nic.getVnicProfileName()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.typeInterface()), SafeHtmlUtils.fromString(VmInterfaceType.forValue(nic.getType()).getDescription()), dl);
        addDetailItem(SafeHtmlUtils.fromSafeConstant(constants.macInterface()), SafeHtmlUtils.fromString(nic.getMacAddress()), dl);
        addDetailItem(templates.sub(constants.rxRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { nic.getStatistics().getReceiveRate(), nic.hasSpeed() ? nic.getSpeed().doubleValue() : 0 })), dl);
        addDetailItem(templates.sub(constants.txRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { nic.getStatistics().getTransmitRate(), nic.hasSpeed() ? nic.getSpeed().doubleValue() : 0 })), dl);
        addDetailItem(templates.sub(constants.dropsInterface(), constants.pkts()), SafeHtmlUtils.fromString(String.valueOf(nic.getStatistics().getReceiveDropRate() != null ? nic.getStatistics().getReceiveDropRate() : "" + nic.getStatistics().getTransmitDropRate())), dl);
        column.getElement().appendChild(dl);
        i++;
    }
    if (nics.isEmpty()) {
        Column column = new Column(ColumnSize.MD_12);
        content.add(column);
        column.getElement().setInnerHTML(constants.noItemsToDisplay());
    }
    return container;
}
Also used : Container(org.gwtbootstrap3.client.ui.Container) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) 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)

Example 20 with Row

use of org.gwtbootstrap3.client.ui.Row in project kie-wb-common by kiegroup.

the class ActivityDataIOEditorViewImpl method init.

public void init(final Presenter presenter) {
    this.presenter = presenter;
    container.setFluid(true);
    container.add(row);
    row.add(column);
    setTitle(StunnerFormsClientFieldsConstants.INSTANCE.Data_IO());
    inputAssignmentsWidget.setVariableType(Variable.VariableType.INPUT);
    inputAssignmentsWidget.setAllowDuplicateNames(false, StunnerFormsClientFieldsConstants.INSTANCE.A_Data_Input_with_this_name_already_exists());
    column.add(inputAssignmentsWidget.getWidget());
    outputAssignmentsWidget.setVariableType(Variable.VariableType.OUTPUT);
    outputAssignmentsWidget.setAllowDuplicateNames(true, "");
    column.add(outputAssignmentsWidget.getWidget());
    final Row btnRow = new Row();
    btnRow.getElement().getStyle().setMarginTop(10, Style.Unit.PX);
    final Column btnColumn = new Column(ColumnSize.MD_12);
    btnRow.add(btnColumn);
    btnSave = new Button(StunnerFormsClientFieldsConstants.INSTANCE.Save());
    btnSave.setType(ButtonType.PRIMARY);
    btnSave.setIcon(IconType.SAVE);
    btnSave.setPull(Pull.RIGHT);
    btnSave.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent clickEvent) {
            presenter.handleSaveClick();
        }
    });
    btnColumn.add(btnSave);
    btnCancel = new Button(StunnerFormsClientFieldsConstants.INSTANCE.Cancel());
    btnCancel.setPull(Pull.RIGHT);
    btnCancel.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            presenter.handleCancelClick();
        }
    });
    btnColumn.add(btnCancel);
    container.add(btnRow);
    setBody(container);
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Column(org.gwtbootstrap3.client.ui.Column) Button(org.gwtbootstrap3.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) AssignmentRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow) Row(org.gwtbootstrap3.client.ui.Row)

Aggregations

Row (org.gwtbootstrap3.client.ui.Row)26 Column (org.gwtbootstrap3.client.ui.Column)22 DListElement (com.google.gwt.dom.client.DListElement)7 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)6 Button (org.gwtbootstrap3.client.ui.Button)5 Container (org.gwtbootstrap3.client.ui.Container)5 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)4 Column (com.google.gwt.user.cellview.client.Column)4 ButtonCell (org.gwtbootstrap3.client.ui.gwt.ButtonCell)4 CellTable (com.google.gwt.user.cellview.client.CellTable)2 TextColumn (com.google.gwt.user.cellview.client.TextColumn)2 IsWidget (com.google.gwt.user.client.ui.IsWidget)2 Widget (com.google.gwt.user.client.ui.Widget)2 ListDataProvider (com.google.gwt.view.client.ListDataProvider)2 PostConstruct (javax.annotation.PostConstruct)2 Label (org.gwtbootstrap3.client.ui.Label)2 TextBox (org.gwtbootstrap3.client.ui.TextBox)2 ValueListBox (org.gwtbootstrap3.client.ui.ValueListBox)2 Span (org.gwtbootstrap3.client.ui.html.Span)2 Before (org.junit.Before)2