use of com.google.gwt.user.client.ui.HorizontalPanel in project gerrit by GerritCodeReview.
the class GroupListScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
setPageTitle(AdminConstants.I.groupListTitle());
initPageHeader();
prev = PagingHyperlink.createPrev();
prev.setVisible(false);
next = PagingHyperlink.createNext();
next.setVisible(false);
groups = new GroupTable(PageLinks.ADMIN_GROUPS);
add(groups);
final HorizontalPanel buttons = new HorizontalPanel();
buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks());
buttons.add(prev);
buttons.add(next);
add(buttons);
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class ColumnsPagePresenterTest method testMakeMetaDataWidgetWhenDecisionTableIsEditable.
@Test
public void testMakeMetaDataWidgetWhenDecisionTableIsEditable() {
final HorizontalPanel expectedHorizontalPanel = mock(HorizontalPanel.class);
final ColumnLabelWidget columnLabelWidget = mock(ColumnLabelWidget.class);
final CheckBox hideColumnCheckBox = mock(CheckBox.class);
final DeleteColumnManagementAnchorWidget deleteColumnManagementAnchorWidget = mock(DeleteColumnManagementAnchorWidget.class);
final boolean isEditable = true;
doReturn(expectedHorizontalPanel).when(presenter).makeHorizontalPanel();
doReturn(columnLabelWidget).when(presenter).makeColumnLabel(metadataColumn);
doReturn(hideColumnCheckBox).when(presenter).hideColumnCheckBox(modeller, metadataColumn);
doReturn(deleteColumnManagementAnchorWidget).when(presenter).deleteMetaDataColumnAnchor(modeller, metadataColumn);
doReturn(isEditable).when(modeller).isActiveDecisionTableEditable();
final HorizontalPanel actualHorizontalPanel = presenter.makeMetaDataWidget(modeller, metadataColumn);
verify(actualHorizontalPanel).setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
verify(actualHorizontalPanel).add(columnLabelWidget);
verify(actualHorizontalPanel).add(hideColumnCheckBox);
verify(actualHorizontalPanel).add(deleteColumnManagementAnchorWidget);
assertEquals(expectedHorizontalPanel, actualHorizontalPanel);
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class ColumnsPagePresenterTest method testRefreshMetaDataWidgetWhenModellerIsNotNullAndMetaDataColumnsIsNotEmpty.
@Test
public void testRefreshMetaDataWidgetWhenModellerIsNotNullAndMetaDataColumnsIsNotEmpty() {
final MetadataCol52 metadataColumn1 = mock(MetadataCol52.class);
final MetadataCol52 metadataColumn2 = mock(MetadataCol52.class);
final HorizontalPanel metaDataWidget1 = mock(HorizontalPanel.class);
final HorizontalPanel metaDataWidget2 = mock(HorizontalPanel.class);
final List<MetadataCol52> metaDataColumns = new ArrayList<MetadataCol52>() {
{
add(metadataColumn1);
add(metadataColumn2);
}
};
doReturn(verticalPanel).when(presenter).getMetaDataWidget();
doReturn(metaDataWidget1).when(presenter).makeMetaDataWidget(modeller, metadataColumn1);
doReturn(metaDataWidget2).when(presenter).makeMetaDataWidget(modeller, metadataColumn2);
presenter.refreshMetaDataWidget(metaDataColumns);
verify(verticalPanel).clear();
verify(verticalPanel).add(metaDataWidget1);
verify(verticalPanel).add(metaDataWidget2);
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class ColumnManagementView method renderColumn.
HorizontalPanel renderColumn(final ActionCol52 actionColumn) {
HorizontalPanel action = newHorizontalPanel();
final ColumnLabelWidget actionLabel = makeColumnLabel(actionColumn);
action.add(actionLabel);
final FlowPanel buttons = new FlowPanel() {
{
add(editAnchor((clickEvent) -> {
presenter.getActiveDecisionTable().ifPresent(dt -> dt.editAction(actionColumn));
}));
if (presenter.isActiveDecisionTableEditable()) {
add(deleteAnchor(actionColumn.getHeader(), () -> {
try {
final Optional<GuidedDecisionTableView.Presenter> dtPresenter = presenter.getActiveDecisionTable();
if (dtPresenter.isPresent()) {
dtPresenter.get().deleteColumn(actionColumn);
}
} catch (VetoDeletePatternInUseException veto) {
presenter.getView().showUnableToDeleteColumnMessage(actionColumn);
} catch (VetoException veto) {
presenter.getView().showGenericVetoMessage();
}
}));
}
}
};
action.add(buttons);
return action;
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class ColumnManagementView method renderColumn.
HorizontalPanel renderColumn(final BRLConditionColumn conditionColumn) {
HorizontalPanel condition = newHorizontalPanel();
final ColumnLabelWidget columnLabel = makeColumnLabel(conditionColumn);
condition.add(columnLabel);
final FlowPanel buttons = new FlowPanel() {
{
add(editAnchor((clickEvent) -> {
presenter.getActiveDecisionTable().ifPresent(dt -> dt.editCondition(conditionColumn));
}));
if (presenter.isActiveDecisionTableEditable()) {
add(removeCondition(conditionColumn));
}
}
};
condition.add(buttons);
return condition;
}
Aggregations