Search in sources :

Example 16 with Column

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

the class HostNetworkInterfaceListViewItem method createTxColumn.

private IsWidget createTxColumn(HostInterface hostInterface) {
    Column txCol = new Column(ColumnSize.SM_3);
    DListElement dl = Document.get().createDLElement();
    addReverseDetailItem(templates.sub(constants.txRate(), constants.mbps()), SafeHtmlUtils.fromString(rateRenderer.render(new Double[] { hostInterface.getTxRate(), hostInterface.getSpeed().doubleValue() })), dl);
    dl.addClassName(Styles.PULL_LEFT);
    txCol.getElement().appendChild(dl);
    FlowPanel divider = new FlowPanel();
    divider.addStyleName(RATE_DIVIDER);
    txCol.add(divider);
    dl = Document.get().createDLElement();
    addReverseDetailItem(templates.sub(constants.txTotal(), constants.bytes()), SafeHtmlUtils.fromString(totalRenderer.render(hostInterface.getTxTotal())), dl);
    dl.addClassName(Styles.PULL_LEFT);
    txCol.getElement().appendChild(dl);
    return txCol;
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) AbstractIconTypeColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractIconTypeColumn) TextColumn(com.google.gwt.user.cellview.client.TextColumn) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) DListElement(com.google.gwt.dom.client.DListElement)

Example 17 with Column

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

the class DataObjectBrowserViewImpl method addRemoveRowColumn.

private void addRemoveRowColumn() {
    ButtonCell buttonCell = new ButtonCell(IconType.TRASH, ButtonType.DANGER, ButtonSize.SMALL);
    Column<ObjectProperty, String> column = new Column<ObjectProperty, String>(buttonCell) {

        @Override
        public String getValue(ObjectProperty objectProperty) {
            return Constants.INSTANCE.objectBrowser_action_delete();
        }
    };
    column.setFieldUpdater(new FieldUpdater<ObjectProperty, String>() {

        @Override
        public void update(int index, ObjectProperty objectProperty, String value) {
            if (!readonly) {
                presenter.onDeleteProperty(objectProperty, index);
            }
        }
    });
    propertiesTable.addColumn(column, "");
    propertiesTable.setColumnWidth(column, calculateButtonSize(Constants.INSTANCE.objectBrowser_action_delete()), Style.Unit.PX);
}
Also used : ObjectProperty(org.kie.workbench.common.services.datamodeller.core.ObjectProperty) Column(com.google.gwt.user.cellview.client.Column) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell)

Example 18 with Column

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

the class PersistenceUnitPropertyGridViewImpl method addRemoveRowColumn.

private void addRemoveRowColumn() {
    Column<PropertyRow, String> column = new Column<PropertyRow, String>(new ButtonCell(IconType.TRASH, ButtonType.DANGER, ButtonSize.SMALL)) {

        @Override
        public String getValue(PropertyRow propertyRow) {
            return Constants.INSTANCE.persistence_unit_property_grid_action_delete();
        }
    };
    column.setFieldUpdater(new FieldUpdater<PropertyRow, String>() {

        @Override
        public void update(int index, PropertyRow propertyRow, String value) {
            if (!readOnly) {
                onRemoveProperty(propertyRow);
            }
        }
    });
    dataGrid.addColumn(column, Constants.INSTANCE.persistence_unit_property_grid_property_action_column());
    dataGrid.setColumnWidth(column, 10, Style.Unit.PCT);
}
Also used : Column(com.google.gwt.user.cellview.client.Column) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell)

Example 19 with Column

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

the class ContainerConfigParamsView method addRemoveRowColumn.

private void addRemoveRowColumn() {
    ButtonCell buttonCell = new ButtonCell(IconType.TRASH, ButtonType.DANGER, ButtonSize.SMALL);
    Column<ContainerConfig, String> column = new Column<ContainerConfig, String>(buttonCell) {

        @Override
        public String getValue(ContainerConfig containerConfig) {
            return translationService.getTranslation(ContainerConfigParamsView_Delete);
        }
    };
    column.setFieldUpdater((index, containerConfig, value) -> presenter.onDeleteContainer(containerConfig));
    dataGrid.addColumn(column, "");
    dataGrid.setColumnWidth(column, 90, Style.Unit.PX);
}
Also used : ContainerConfigParamsView_ArtifactIdColumn(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_ArtifactIdColumn) ContainerConfigParamsView_VersionColumn(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_VersionColumn) ContainerConfigParamsView_GroupIdColumn(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_GroupIdColumn) ContainerConfigParamsView_ContainerNameColumn(org.guvnor.ala.ui.client.resources.i18n.GuvnorAlaUIConstants.ContainerConfigParamsView_ContainerNameColumn) Column(com.google.gwt.user.cellview.client.Column) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell)

Example 20 with Column

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

the class CrudComponentViewImpl method showEditButtons.

@Override
public void showEditButtons() {
    final Column<MODEL, String> column = new Column<MODEL, String>(new ButtonCell(IconType.EDIT, ButtonType.PRIMARY, ButtonSize.SMALL)) {

        @Override
        public String getValue(final Object model) {
            return translationService.getTranslation(CrudComponentConstants.CrudComponentViewImplEditInstanceButton);
        }
    };
    column.setFieldUpdater(new FieldUpdater<MODEL, String>() {

        @Override
        public void update(final int index, final Object model, final String s) {
            presenter.editInstance(index);
        }
    });
    table.addColumn(column, "");
}
Also used : Column(com.google.gwt.user.cellview.client.Column) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell)

Aggregations

Column (org.gwtbootstrap3.client.ui.Column)30 Row (org.gwtbootstrap3.client.ui.Row)24 Column (com.google.gwt.user.cellview.client.Column)17 ButtonCell (org.gwtbootstrap3.client.ui.gwt.ButtonCell)12 DListElement (com.google.gwt.dom.client.DListElement)10 Button (org.gwtbootstrap3.client.ui.Button)9 TextColumn (com.google.gwt.user.cellview.client.TextColumn)8 Element (com.google.gwt.dom.client.Element)5 IsWidget (com.google.gwt.user.client.ui.IsWidget)5 AbstractIconTypeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractIconTypeColumn)5 AbstractCell (com.google.gwt.cell.client.AbstractCell)4 ValueUpdater (com.google.gwt.cell.client.ValueUpdater)4 NativeEvent (com.google.gwt.dom.client.NativeEvent)4 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)4 HTMLButtonElement (elemental2.dom.HTMLButtonElement)4 Container (org.gwtbootstrap3.client.ui.Container)4 Icon (org.gwtbootstrap3.client.ui.Icon)4 Label (org.gwtbootstrap3.client.ui.Label)4 CellTable (com.google.gwt.user.cellview.client.CellTable)3 ListDataProvider (com.google.gwt.view.client.ListDataProvider)3