use of org.gwtbootstrap3.client.ui.Container 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);
}
use of org.gwtbootstrap3.client.ui.Container in project drools-wb by kiegroup.
the class ExpressionBuilder method createWidgetForExpression.
// Render Widgets for the Expression. ExpressionMethodParameter and ExpressionText parts
// are represented by a TextBox to allow the User to edit the values, Updates are
// reflected in the model.
private Widget createWidgetForExpression() {
final HorizontalPanel container = new HorizontalPanel();
container.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
container.setStylePrimaryName(GuidedRuleEditorResources.INSTANCE.css().container());
for (ExpressionPart expressionPart : expression.getParts()) {
if (expressionPart instanceof ExpressionUnboundFact) {
continue;
} else if (this.readOnly) {
container.add(new Label(expressionPart.getName()));
} else if (expressionPart instanceof ExpressionMethod) {
container.add(new Label(expressionPart.getName()));
container.add(new Label("("));
final ExpressionMethod em = (ExpressionMethod) expressionPart;
final List<ExpressionFormLine> emParams = em.getOrderedParams();
for (int index = 0; index < emParams.size(); index++) {
final ExpressionFormLine paramValueHolder = emParams.get(index);
final String paramDataType = em.getParameterDataType(paramValueHolder);
final ExpressionMethodParameter paramValue = ((ExpressionMethodParameter) paramValueHolder.getRootExpression());
final TextBox paramValueEditor = TextBoxFactory.getTextBox(paramDataType);
paramValueEditor.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
paramValue.setText(event.getValue());
}
});
paramValueEditor.setText(paramValue.getName());
container.add(paramValueEditor);
if (index < emParams.size() - 1) {
container.add(new Label(", "));
}
}
container.add(new Label(")"));
} else if (!(expressionPart instanceof ExpressionText)) {
container.add(new Label(expressionPart.getName()));
} else {
final TextBox tb = new TextBox();
final ExpressionText expressionTextPart = (ExpressionText) expressionPart;
tb.setText(expressionTextPart.getName());
tb.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(final ChangeEvent changeEvent) {
expressionTextPart.setText(tb.getText());
}
});
container.add(tb);
}
container.add(new Label("."));
}
return container;
}
use of org.gwtbootstrap3.client.ui.Container in project kie-wb-common by kiegroup.
the class DateTimePickerPresenterViewImpl method initDatePicker.
public void initDatePicker() {
DOMUtil.removeAllChildren(container);
dateTimePicker = new DateTimePicker();
dateTimePicker.setGWTFormat(DateEditableColumnGenerator.DEFAULT_DATE_AND_TIME_FORMAT_MASK);
dateTimePicker.setHighlightToday(true);
dateTimePicker.setShowTodayButton(true);
dateTimePicker.setAutoClose(true);
dateTimePicker.addChangeDateHandler(event -> {
presenter.notifyDateChange(dateTimePicker.getValue());
});
dateTimePicker.addHideHandler(hideEvent -> {
hideEvent.stopPropagation();
presenter.notifyHide();
});
dateTimePicker.getElement().setClassName(DATE_PICKER_CELL_STYLE);
DOMUtil.appendWidgetToElement(container, dateTimePicker);
}
use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.
the class AbstractMainWithDetailsTableView method addBreadCrumbs.
private void addBreadCrumbs(FlowPanel container) {
Row breadCrumbsRow = new Row();
breadCrumbsColumn = new Column(ColumnSize.SM_12);
breadCrumbsRow.add(breadCrumbsColumn);
container.insert(breadCrumbsRow, 0);
}
use of org.gwtbootstrap3.client.ui.Container in project ovirt-engine by oVirt.
the class PatternflyListViewItem method createItemContainerPanel.
protected Container createItemContainerPanel(Row content, boolean hidden) {
Container panel = new Container();
panel.addStyleName(LIST_GROUP_ITEM_CONTAINER);
if (hidden) {
panel.addStyleName(ExpandableListViewItem.HIDDEN);
panel.setFluid(true);
Button closeButton = new Button();
closeButton.addStyleName(Styles.CLOSE);
getClickHandlerRegistrations().add(closeButton.addClickHandler(this));
Span icon = new Span();
icon.addStyleName(PatternflyConstants.PFICON);
icon.addStyleName(PatternflyConstants.PFICON_CLOSE);
closeButton.add(icon);
panel.add(closeButton);
}
panel.add(content);
return panel;
}
Aggregations