Search in sources :

Example 21 with Column

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

the class DatabaseObjectExplorerViewImpl method addOpenColumn.

private void addOpenColumn() {
    Column<DatabaseObjectRow, String> column = new Column<DatabaseObjectRow, String>(new ButtonCell(ButtonType.DEFAULT, ButtonSize.SMALL)) {

        @Override
        public String getValue(DatabaseObjectRow row) {
            return translationService.getTranslation(DataSourceManagementConstants.DatabaseObjectExplorerViewImpl_dbObjectOpen);
        }
    };
    column.setFieldUpdater(new FieldUpdater<DatabaseObjectRow, String>() {

        @Override
        public void update(int index, DatabaseObjectRow row, String value) {
            onOpen(row);
        }
    });
    dataGrid.addColumn(column, translationService.getTranslation(DataSourceManagementConstants.DatabaseObjectExplorerViewImpl_dbObjectActionColumn));
    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 22 with Column

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

the class DataSourceSelectorViewImpl method init.

@PostConstruct
private void init() {
    dataGrid.setHeight("200px");
    dataGrid.setColumnPickerButtonVisible(false);
    dataGrid.setEmptyTableCaption(translationService.getTranslation(DataSourceManagementConstants.DataSourceSelector_NoAvailableDataSourcesMessage));
    Column<DataSourceSelectorPageRow, String> nameColumn = new Column<DataSourceSelectorPageRow, String>(new TextCell()) {

        @Override
        public String getValue(DataSourceSelectorPageRow row) {
            return row.getDataSourceDefInfo().getName();
        }
    };
    dataGrid.addColumn(nameColumn, translationService.getTranslation(DataSourceManagementConstants.DataSourceSelector_DataSourceColumn));
    Column<DataSourceSelectorPageRow, String> selectorColumn = new Column<DataSourceSelectorPageRow, String>(new ButtonCell(ButtonType.PRIMARY, ButtonSize.SMALL)) {

        @Override
        public String getValue(DataSourceSelectorPageRow row) {
            return translationService.getTranslation(DataSourceManagementConstants.DataSourceSelector_SelectButton);
        }
    };
    selectorColumn.setFieldUpdater(new FieldUpdater<DataSourceSelectorPageRow, String>() {

        @Override
        public void update(int index, DataSourceSelectorPageRow row, String value) {
            selectedRow = row;
            cancelNextHiddenEvent = true;
            modal.hide();
            presenter.onSelect();
        }
    });
    dataGrid.addColumn(selectorColumn, "");
    mainPanel.add(dataGrid);
    this.modal = new BaseModal();
    this.modal.setTitle(translationService.getTranslation(DataSourceManagementConstants.DataSourceSelector_Title));
    this.modal.setBody(this);
    this.modal.addHiddenHandler(new ModalHiddenHandler() {

        @Override
        public void onHidden(ModalHiddenEvent evt) {
            if (!cancelNextHiddenEvent) {
                presenter.onClose();
            }
            cancelNextHiddenEvent = false;
        }
    });
}
Also used : BaseModal(org.uberfire.ext.widgets.common.client.common.popups.BaseModal) Column(com.google.gwt.user.cellview.client.Column) ModalHiddenHandler(org.gwtbootstrap3.client.shared.event.ModalHiddenHandler) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell) ModalHiddenEvent(org.gwtbootstrap3.client.shared.event.ModalHiddenEvent) TextCell(com.google.gwt.cell.client.TextCell) PostConstruct(javax.annotation.PostConstruct)

Example 23 with Column

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

the class DependencyListWidget method init.

@PostConstruct
public void init() {
    dependencyPagedJarTable = IOC.getBeanManager().lookupBean(ArtifactListPresenter.class).getInstance();
    dependencyPagedJarTable.setup(ColumnType.NAME, ColumnType.GAV, ColumnType.LAST_MODIFIED);
    // Column to view KJAR's pom
    final Column<JarListPageRow, String> openColumn = new Column<JarListPageRow, String>(new ButtonCell(ButtonSize.EXTRA_SMALL)) {

        @Override
        public String getValue(JarListPageRow row) {
            return M2RepoEditorConstants.INSTANCE.Open();
        }
    };
    openColumn.setFieldUpdater(new FieldUpdater<JarListPageRow, String>() {

        @Override
        public void update(int index, JarListPageRow row, String value) {
            dependencyPagedJarTable.onOpenPom(row.getPath());
        }
    });
    // Column to allow selection of dependency
    final Column<JarListPageRow, String> selectColumn = new Column<JarListPageRow, String>(new ButtonCell(ButtonSize.EXTRA_SMALL)) {

        @Override
        public String getValue(JarListPageRow row) {
            return ProjectEditorResources.CONSTANTS.Select();
        }
    };
    selectColumn.setFieldUpdater(new FieldUpdater<JarListPageRow, String>() {

        @Override
        public void update(final int index, final JarListPageRow row, final String value) {
            onPathSelect.execute(row.getPath());
        }
    });
    final ArtifactListView artifactListView = dependencyPagedJarTable.getView();
    artifactListView.addColumn(openColumn, M2RepoEditorConstants.INSTANCE.Open(), false, 100.0, Style.Unit.PX);
    artifactListView.addColumn(selectColumn, ProjectEditorResources.CONSTANTS.Select(), 100.0, Style.Unit.PX);
    artifactListView.setContentHeight("200px");
    artifactListView.asWidget().getElement().getStyle().setMarginLeft(0, Style.Unit.PX);
    artifactListView.asWidget().getElement().getStyle().setMarginRight(0, Style.Unit.PX);
    panel.add(artifactListView);
}
Also used : ArtifactListView(org.guvnor.m2repo.client.widgets.ArtifactListView) Column(com.google.gwt.user.cellview.client.Column) JarListPageRow(org.guvnor.m2repo.model.JarListPageRow) ButtonCell(org.gwtbootstrap3.client.ui.gwt.ButtonCell) PostConstruct(javax.annotation.PostConstruct)

Example 24 with Column

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

the class NotificationWidgetViewImpl method initDelete.

private void initDelete() {
    AbstractCell<NotificationRow> buttonCell = new AbstractCell<NotificationRow>(ClickEvent.getType().getName()) {

        @Override
        public void render(Context context, NotificationRow value, SafeHtmlBuilder sb) {
            Button button = new Button();
            button.setSize(ButtonSize.SMALL);
            button.add(new Icon(IconType.TRASH));
            sb.append(SafeHtmlUtils.fromTrustedString(button.toString()));
        }

        @Override
        public void onBrowserEvent(Context context, Element parent, NotificationRow value, NativeEvent event, ValueUpdater<NotificationRow> valueUpdater) {
            if (!readOnly) {
                delete(value);
            }
        }
    };
    Column<NotificationRow, NotificationRow> deleteColumn = new Column<NotificationRow, NotificationRow>(buttonCell) {

        @Override
        public NotificationRow getValue(NotificationRow object) {
            return object;
        }
    };
    deleteColumn.setSortable(false);
    table.addColumn(deleteColumn, presenter.getDeleteLabel());
    table.setColumnWidth(deleteColumn, 60, Style.Unit.PX);
}
Also used : Button(org.gwtbootstrap3.client.ui.Button) ValueUpdater(com.google.gwt.cell.client.ValueUpdater) Column(com.google.gwt.user.cellview.client.Column) HTMLButtonElement(elemental2.dom.HTMLButtonElement) Element(com.google.gwt.dom.client.Element) NotificationRow(org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow) AbstractCell(com.google.gwt.cell.client.AbstractCell) Icon(org.gwtbootstrap3.client.ui.Icon) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Example 25 with Column

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

the class BootstrapNavigatorView method addItem.

private void addItem(final IsWidget widget) {
    if (null == currentRow || (itemCounter == 4)) {
        resetRow();
    }
    final Column column = new Column(ColumnSize.MD_3);
    column.add(widget);
    currentRow.add(column);
    itemCounter++;
}
Also used : Column(org.gwtbootstrap3.client.ui.Column)

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