use of com.evolveum.midpoint.web.component.search.filter.ValueSearchFilterItem in project midpoint by Evolveum.
the class SearchPropertiesConfigPanel method initTable.
private void initTable(WebMarkupContainer configPanel) {
List<IColumn<SelectableBean<ValueSearchFilterItem>, String>> columns = getTableColumns();
BoxedTablePanel<SelectableBean<ValueSearchFilterItem>> table = new BoxedTablePanel<SelectableBean<ValueSearchFilterItem>>(ID_PROPERTIES_TABLE, provider, columns) {
private static final long serialVersionUID = 1L;
@Override
protected WebMarkupContainer createHeader(String headerId) {
return new WebMarkupContainer(headerId);
}
@Override
public String getAdditionalBoxCssClasses() {
return null;
}
@Override
protected WebMarkupContainer createButtonToolbar(String id) {
AjaxButton addRowButton = new AjaxButton(id) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
propertyAddedPerformed(ajaxRequestTarget);
}
};
addRowButton.setOutputMarkupId(true);
addRowButton.add(AttributeAppender.append("class", "btn btn-sm btn-default fa fa-plus"));
addRowButton.add(AttributeAppender.append("style", "color: green;"));
return addRowButton;
}
@Override
protected boolean hideFooterIfSinglePage() {
return true;
}
@Override
public int getAutoRefreshInterval() {
return 0;
}
@Override
public boolean isAutoRefreshEnabled() {
return false;
}
};
table.setOutputMarkupId(true);
configPanel.add(table);
}
use of com.evolveum.midpoint.web.component.search.filter.ValueSearchFilterItem in project midpoint by Evolveum.
the class SearchPropertiesConfigPanel method getTableColumns.
private List<IColumn<SelectableBean<ValueSearchFilterItem>, String>> getTableColumns() {
List<IColumn<SelectableBean<ValueSearchFilterItem>, String>> columns = new ArrayList<>();
CheckBoxHeaderColumn<SelectableBean<ValueSearchFilterItem>> checkboxColumn = new CheckBoxHeaderColumn<>();
columns.add(checkboxColumn);
IColumn<SelectableBean<ValueSearchFilterItem>, String> propertyColumn = new PropertyColumn<SelectableBean<ValueSearchFilterItem>, String>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.property"), "value." + ValueSearchFilterItem.F_PROPERTY_NAME) {
private static final long serialVersionUID = 1L;
@Override
public String getCssClass() {
return getColumnStyleClass();
}
};
columns.add(propertyColumn);
IColumn<SelectableBean<ValueSearchFilterItem>, String> valueColumn = new AbstractColumn<SelectableBean<ValueSearchFilterItem>, String>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.value")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ValueSearchFilterItem>>> item, String id, IModel<SelectableBean<ValueSearchFilterItem>> rowModel) {
item.add(new SwitchablePropertyValuePanel(id, rowModel));
}
@Override
public String getCssClass() {
return "max-width-column";
}
};
columns.add(valueColumn);
IColumn<SelectableBean<ValueSearchFilterItem>, String> filterColumn = new AbstractColumn<SelectableBean<ValueSearchFilterItem>, String>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.filter")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ValueSearchFilterItem>>> item, String id, IModel<SelectableBean<ValueSearchFilterItem>> rowModel) {
List<ValueSearchFilterItem.FilterName> availableFilterNames = rowModel.getObject().getValue().getAvailableFilterNameList();
DropDownChoicePanel<ValueSearchFilterItem.FilterName> filterPanel = WebComponentUtil.createEnumPanel(id, Model.ofList(availableFilterNames), new PropertyModel<>(rowModel, "value." + ValueSearchFilterItem.F_FILTER_TYPE_NAME), SearchPropertiesConfigPanel.this, false, getPageBase().createStringResource("SearchPropertiesConfigPanel.selectFilter").getString());
filterPanel.setOutputMarkupId(true);
filterPanel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
filterPanel.getBaseFormComponent().add(new EnableBehaviour(() -> availableFilterNames.size() > 1));
item.add(filterPanel);
}
@Override
public String getCssClass() {
return getColumnStyleClass();
}
};
columns.add(filterColumn);
IColumn<SelectableBean<ValueSearchFilterItem>, String> matchingRuleColumn = new AbstractColumn<SelectableBean<ValueSearchFilterItem>, String>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.matchingRule")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<ValueSearchFilterItem>>> item, String id, IModel<SelectableBean<ValueSearchFilterItem>> rowModel) {
DropDownChoicePanel<ValueSearchFilterItem.MatchingRule> matchingRulePanel = WebComponentUtil.createEnumPanel(id, Model.ofList(rowModel.getObject().getValue().getAvailableMatchingRuleList()), new PropertyModel<>(rowModel, "value." + ValueSearchFilterItem.F_MATCHING_RULE), SearchPropertiesConfigPanel.this, true, getPageBase().createStringResource("SearchPropertiesConfigPanel.selectMatchingRule").getString());
matchingRulePanel.setOutputMarkupId(true);
matchingRulePanel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
item.add(matchingRulePanel);
}
@Override
public String getCssClass() {
return getColumnStyleClass();
}
};
columns.add(matchingRuleColumn);
CheckBoxColumn<SelectableBean<ValueSearchFilterItem>> negationColumn = new CheckBoxColumn<SelectableBean<ValueSearchFilterItem>>(getPageBase().createStringResource("SearchPropertiesConfigPanel.table.column.applyNegotiation"), "value." + ValueSearchFilterItem.F_APPLY_NEGATION) {
private static final long serialVersionUID = 1L;
@Override
public String getCssClass() {
return "min-width-column";
}
};
columns.add(negationColumn);
InlineMenuButtonColumn<SelectableBean<ValueSearchFilterItem>> actionsColumn = new InlineMenuButtonColumn<SelectableBean<ValueSearchFilterItem>>(getTableMenuItems(), getPageBase()) {
private static final long serialVersionUID = 1L;
@Override
public String getCssClass() {
return "min-width-column";
}
};
columns.add(actionsColumn);
return columns;
}
use of com.evolveum.midpoint.web.component.search.filter.ValueSearchFilterItem in project midpoint by Evolveum.
the class SwitchablePropertyValuePanel method isReferenceFilterValue.
private boolean isReferenceFilterValue() {
ValueSearchFilterItem valueSearchFilter = getModelObject().getValue();
ItemDefinition propertyDef = valueSearchFilter.getPropertyDef();
return propertyDef instanceof PrismReferenceDefinition;
}
Aggregations