Search in sources :

Example 1 with Row

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

the class BootstrapNavigatorView method resetRow.

private void resetRow() {
    currentRow = new Row();
    container.add(currentRow);
    itemCounter = 0;
}
Also used : Row(org.gwtbootstrap3.client.ui.Row)

Example 2 with Row

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

the class ActivateRuleFlowWidget method render.

private void render(final FixtureList retList, final FlexTable outer, final Scenario sc) {
    outer.clear();
    outer.getCellFormatter().setStyleName(0, 0, "modeller-fact-TypeHeader");
    outer.getCellFormatter().setAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE);
    outer.setStyleName("modeller-fact-pattern-Widget");
    outer.setWidget(0, 0, new SmallLabel(TestScenarioConstants.INSTANCE.ActivateRuleFlowGroup()));
    outer.getFlexCellFormatter().setColSpan(0, 0, 2);
    int row = 1;
    for (Fixture fixture : retList) {
        final ActivateRuleFlowGroup acticateRuleFlowGroup = (ActivateRuleFlowGroup) fixture;
        outer.setWidget(row, 0, new SmallLabel(acticateRuleFlowGroup.getName()));
        Button deleteButton = new Button();
        deleteButton.setIcon(IconType.TRASH);
        deleteButton.setTitle(TestScenarioConstants.INSTANCE.RemoveThisRuleFlowActivation());
        deleteButton.addClickHandler(clickEvent -> {
            retList.remove(acticateRuleFlowGroup);
            sc.getFixtures().remove(acticateRuleFlowGroup);
            render(retList, outer, sc);
            parent.renderEditor();
        });
        outer.setWidget(row, 1, deleteButton);
        row++;
    }
    ScenarioUtils.addBottomAndRightPaddingToTableCells(outer);
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) Button(org.gwtbootstrap3.client.ui.Button) Fixture(org.drools.workbench.models.testscenarios.shared.Fixture) ActivateRuleFlowGroup(org.drools.workbench.models.testscenarios.shared.ActivateRuleFlowGroup)

Example 3 with Row

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

the class AuditLogViewImpl method setup.

public void setup() {
    // BZ-996917: Use a the gwtboostrap style "row-fluid" to allow display some events in the same row.
    eventTypes.setStyleName(Styles.ROW);
    // Fill panel with available events.
    for (Map.Entry<String, Boolean> e : auditLog.getAuditLogFilter().getAcceptedTypes().entrySet()) {
        eventTypes.add(makeEventTypeCheckBox(e.getKey(), e.getValue()));
    }
    // Create the GWT Cell Table as events container.
    // BZ-996942: Set custom width and table css style.
    events = new CellTable<>();
    events.setWidth("100%");
    events.addStyleName(Styles.TABLE);
    dlp = new ListDataProvider<AuditLogEntry>() {

        @Override
        public void setList(final List<AuditLogEntry> listToWrap) {
            super.setList(listToWrap);
            cellTablePagination.rebuild(pager);
        }
    };
    dlp.addDataDisplay(events);
    AuditLogEntrySummaryColumn summaryColumn = new AuditLogEntrySummaryColumn(style.auditLogDetailLabel(), style.auditLogDetailValue());
    AuditLogEntryCommentColumn commentColumn = new AuditLogEntryCommentColumn();
    events.addColumn(summaryColumn);
    events.addColumn(commentColumn);
    events.setColumnWidth(summaryColumn, 60.0, Unit.PCT);
    events.setColumnWidth(commentColumn, 40.0, Unit.PCT);
    // If the current user is not an Administrator include the delete comment column
    if (identity.getRoles().contains(new RoleImpl(AppRoles.ADMIN.getName()))) {
        AuditLogEntryDeleteCommentColumn deleteCommentColumn = new AuditLogEntryDeleteCommentColumn();
        deleteCommentColumn.setFieldUpdater((int index, AuditLogEntry row, SafeHtml value) -> {
            row.setDeleted(true);
            dlp.setList(filterDeletedEntries(auditLog));
            dlp.refresh();
        });
        events.addColumn(deleteCommentColumn);
        events.setColumnWidth(commentColumn, 35.0, Unit.PCT);
        events.setColumnWidth(deleteCommentColumn, 5.0, Unit.PCT);
    }
    events.setEmptyTableWidget(new Label(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogNoEntries()));
    events.setKeyboardPagingPolicy(KeyboardPagingPolicy.CHANGE_PAGE);
    events.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
    events.setPageSize(PAGE_SIZE);
    // Configure the simple pager.
    pager.setDisplay(events);
    pager.setPageSize(PAGE_SIZE);
    // Add the table to the container.
    eventsContainer.add(events);
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) RoleImpl(org.jboss.errai.security.shared.api.RoleImpl) Label(org.gwtbootstrap3.client.ui.Label) AuditLogEntry(org.drools.workbench.models.datamodel.auditlog.AuditLogEntry) Map(java.util.Map)

Example 4 with Row

use of org.gwtbootstrap3.client.ui.Row 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 5 with Row

use of org.gwtbootstrap3.client.ui.Row 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)

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