Skip to content

Commit

Permalink
ISelectableDataProvider removed unused first type parameter
Browse files Browse the repository at this point in the history
some class cleanup, mostly ColumnUtils (far from clean though)
  • Loading branch information
virgo47 committed Sep 26, 2022
1 parent 75cad82 commit e896fac
Show file tree
Hide file tree
Showing 29 changed files with 63 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private CompositedIcon createCompositedIcon(CompiledObjectCollectionView collect
}

@Override
protected ISelectableDataProvider<O, SelectableBean<O>> createProvider() {
protected ISelectableDataProvider<SelectableBean<O>> createProvider() {
return createSelectableBeanObjectDataProvider(null, null); // default
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected IModel<Boolean> getEnabled(IModel<SelectableBean<O>> rowModel) {
}

@Override
protected final ISelectableDataProvider<O, SelectableBean<O>> createProvider() {
protected final ISelectableDataProvider<SelectableBean<O>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> getCustomizeContentQuery(), null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private WidgetTableHeader createWidgetHeader(String headerId) {
protected BoxedTablePanel<PO> initItemTable() {

List<IColumn<PO, String>> columns = createColumns();
ISelectableDataProvider<C, PO> provider = createProvider();
ISelectableDataProvider<PO> provider = createProvider();
setDefaultSorting(provider);
BoxedTablePanel<PO> itemTable = new BoxedTablePanel<>(ID_ITEMS_TABLE,
provider, columns, getTableId()) {
Expand Down Expand Up @@ -878,7 +878,7 @@ protected List<InlineMenuItem> createInlineMenu() {
return null;
}

protected abstract ISelectableDataProvider<C, PO> createProvider();
protected abstract ISelectableDataProvider<PO> createProvider();

public int getSelectedObjectsCount() {
List<PO> selectedList = getSelectedObjects();
Expand Down Expand Up @@ -963,7 +963,6 @@ private AjaxIconButton createViewAllButton(String buttonId) {
AjaxIconButton viewAll = new AjaxIconButton(buttonId, new Model<>(GuiStyleConstants.CLASS_ICON_SEARCH),
createStringResource("AjaxIconButton.viewAll")) {


@Override
public void onClick(AjaxRequestTarget target) {
viewAllActionPerformed(target);
Expand Down Expand Up @@ -1347,7 +1346,7 @@ protected GuiObjectListViewType getDefaultView() {
return DefaultColumnUtils.getDefaultView(getType());
}

protected void setDefaultSorting(ISelectableDataProvider<C, PO> provider) {
protected void setDefaultSorting(ISelectableDataProvider<PO> provider) {
if (provider instanceof SortableDataProvider
&& isCollectionViewPanel() && getObjectCollectionView().getPaging() != null
&& getObjectCollectionView().getPaging().getOrderBy() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import com.evolveum.midpoint.gui.impl.component.search.AbstractSearchItemWrapper;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CollectionRefSpecificationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;

import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectCollectionType;
Expand Down Expand Up @@ -126,7 +125,7 @@ protected ItemPath getDefaultSearchItem() {
}

@Override
protected ISelectableDataProvider<C, PrismContainerValueWrapper<C>> createProvider() {
protected ISelectableDataProvider<PrismContainerValueWrapper<C>> createProvider() {
return new MultivalueContainerListDataProvider<>(MultivalueContainerListPanel.this, getSearchModel(), new PropertyModel<>(getContainerModel(), "values")) {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ public boolean isRepositorySearchEnabled() {
}

@Override
public ISelectableDataProvider<AssignmentType, PrismContainerValueWrapper<AssignmentType>> create(
public ISelectableDataProvider<PrismContainerValueWrapper<AssignmentType>> create(
org.apache.wicket.Component component, @NotNull IModel<Search<AssignmentType>> search,
IModel<List<PrismContainerValueWrapper<AssignmentType>>> model, Class<? extends Objectable> objectType,
String oid, ItemPath path) {
return new AssignmentListProvider(component, search, model);
}

@Override
public ISelectableDataProvider<AssignmentType, PrismContainerValueWrapper<AssignmentType>> create(
public ISelectableDataProvider<PrismContainerValueWrapper<AssignmentType>> create(
org.apache.wicket.Component component, @NotNull IModel<Search<AssignmentType>> search,
IModel<List<PrismContainerValueWrapper<AssignmentType>>> model, Class<? extends Objectable> objectType,
String oid, ItemPath path, CompiledObjectCollectionView collection, Customization<AssignmentType> customization) {
Expand All @@ -62,7 +62,7 @@ public ISelectableDataProvider<AssignmentType, PrismContainerValueWrapper<Assign
/**
* Static method is necessary to not serialize the factory as well.
*/
private static ISelectableDataProvider<AssignmentType, PrismContainerValueWrapper<AssignmentType>> doCreate(
private static ISelectableDataProvider<PrismContainerValueWrapper<AssignmentType>> doCreate(
org.apache.wicket.Component component, @NotNull IModel<Search<AssignmentType>> search,
IModel<List<PrismContainerValueWrapper<AssignmentType>>> model, Class<? extends Objectable> objectType,
String oid, ItemPath path, CompiledObjectCollectionView collection, Customization<AssignmentType> customization) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ public boolean isRepositorySearchEnabled() {
}

@Override
public ISelectableDataProvider<AssignmentType, PrismContainerValueWrapper<AssignmentType>> create(
public ISelectableDataProvider<PrismContainerValueWrapper<AssignmentType>> create(
org.apache.wicket.Component component, @NotNull IModel<Search<AssignmentType>> search,
IModel<List<PrismContainerValueWrapper<AssignmentType>>> model, Class<? extends Objectable> objectType,
String oid, ItemPath path) {
return new RepoAssignmentListProvider(component, search, model, objectType, oid, path);
}

@Override
public ISelectableDataProvider<AssignmentType, PrismContainerValueWrapper<AssignmentType>> create(
public ISelectableDataProvider<PrismContainerValueWrapper<AssignmentType>> create(
org.apache.wicket.Component component, @NotNull IModel<Search<AssignmentType>> search,
IModel<List<PrismContainerValueWrapper<AssignmentType>>> model, Class<? extends Objectable> objectType,
String oid, ItemPath path, CompiledObjectCollectionView collection, Customization<AssignmentType> customization) {
return doCreate(component, search, model, objectType, oid, path, collection, customization);
}

private static ISelectableDataProvider<AssignmentType, PrismContainerValueWrapper<AssignmentType>> doCreate(
private static ISelectableDataProvider<PrismContainerValueWrapper<AssignmentType>> doCreate(
org.apache.wicket.Component component, @NotNull IModel<Search<AssignmentType>> search,
IModel<List<PrismContainerValueWrapper<AssignmentType>>> model, Class<? extends Objectable> objectType,
String oid, ItemPath path, CompiledObjectCollectionView collection, Customization<AssignmentType> customization) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ public void deleteItemPerformed(AjaxRequestTarget target, List<PrismContainerVal
}

@Override
protected ISelectableDataProvider<AssignmentType, PrismContainerValueWrapper<AssignmentType>> createProvider() {
protected ISelectableDataProvider<PrismContainerValueWrapper<AssignmentType>> createProvider() {
var searchModel = getSearchModel();
var assignments = loadValuesModel();
var itemPath = model.getObject().getPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@
import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.component.util.SelectableBeanImpl;
import com.evolveum.midpoint.gui.impl.page.admin.cases.PageCase;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.web.util.OnePageParameterEncoder;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType;

import com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
Expand All @@ -32,7 +29,6 @@
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;

import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -109,7 +105,7 @@ protected boolean isCreateNewObjectEnabled(){
}

@Override
protected ISelectableDataProvider<CaseType, SelectableBean<CaseType>> createProvider() {
protected ISelectableDataProvider<SelectableBean<CaseType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> getChildCasesQuery(), null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected void initLayout() {
private static final long serialVersionUID = 1L;

@Override
protected ISelectableDataProvider<ShadowType, PrismContainerValueWrapper<ShadowType>> createProvider() {
protected ISelectableDataProvider<PrismContainerValueWrapper<ShadowType>> createProvider() {
return new ProjectionsListProvider(FocusProjectionsPanel.this, getSearchModel(), loadShadowModel()) {
@Override
protected PageStorage getPageStorage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.PrismObjectDefinition;
import com.evolveum.midpoint.prism.polystring.PolyString;
import com.evolveum.midpoint.prism.query.ObjectQuery;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.util.exception.SchemaException;
Expand All @@ -37,7 +36,6 @@
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
Expand Down Expand Up @@ -87,7 +85,7 @@ protected UserProfileStorage.TableId getTableId() {
}

@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
protected ISelectableDataProvider<SelectableBean<TaskType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> createResourceTasksQuery(), null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected IModel<PrismContainerWrapper<ResourceAttributeDefinitionType>> getCont
}

@Override
protected ISelectableDataProvider<ResourceAttributeDefinitionType, PrismContainerValueWrapper<ResourceAttributeDefinitionType>> createProvider() {
protected ISelectableDataProvider<PrismContainerValueWrapper<ResourceAttributeDefinitionType>> createProvider() {
return new MultivalueContainerListDataProvider<>(MappingOverrideTable.this, getSearchModel(), new PropertyModel<>(getContainerModel(), "values")) {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
package com.evolveum.midpoint.gui.impl.page.admin.task.component;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.gui.api.prism.ItemStatus;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.ObjectDetailsModels;
import com.evolveum.midpoint.gui.impl.page.admin.task.RootTaskLoader;
import com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.PrismProperty;
Expand All @@ -25,7 +21,6 @@
import com.evolveum.midpoint.web.application.PanelDisplay;
import com.evolveum.midpoint.web.application.PanelInstance;
import com.evolveum.midpoint.web.application.PanelType;
import com.evolveum.midpoint.web.component.AjaxIconButton;
import com.evolveum.midpoint.web.component.data.ISelectableDataProvider;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.component.util.SelectableListDataProvider;
Expand Down Expand Up @@ -83,7 +78,7 @@ protected void initLayout() {
TaskTablePanel subtasksPanel = new TaskTablePanel(ID_SUBTASKS_PANEL, createOperationOptions()) {

@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
protected ISelectableDataProvider<SelectableBean<TaskType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> createSubtasksQuery(), null);
}

Expand Down Expand Up @@ -127,7 +122,7 @@ protected UserProfileStorage.TableId getTableId() {
TaskTablePanel workerThreadsTable = new TaskTablePanel(ID_WORKER_THREADS_TABLE, null) {

@Override
protected ISelectableDataProvider<TaskType, SelectableBean<TaskType>> createProvider() {
protected ISelectableDataProvider<SelectableBean<TaskType>> createProvider() {
return new SelectableListDataProvider<>(TaskSubtasksAndThreadsPanel.this, createWorkersModel());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected boolean isCreateNewObjectEnabled() {
}

@Override
protected ISelectableDataProvider<UserType, SelectableBean<UserType>> createProvider() {
protected ISelectableDataProvider<SelectableBean<UserType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> getFocusPersonasQuery(), null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.web.component.util.Selectable;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.component.util.SelectableRow;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ default boolean isSupported(Class<?> type) {
* @param path Path on which prism container values are located
* @return Data Provider instance
*/
ISelectableDataProvider<T, PrismContainerValueWrapper<T>> create(Component component, @NotNull IModel<Search<T>> search, IModel<List<PrismContainerValueWrapper<T>>> model,
ISelectableDataProvider<PrismContainerValueWrapper<T>> create(Component component, @NotNull IModel<Search<T>> search, IModel<List<PrismContainerValueWrapper<T>>> model,
Class<? extends Objectable> objectType, String oid, ItemPath path);

/**
Expand All @@ -75,7 +75,7 @@ ISelectableDataProvider<T, PrismContainerValueWrapper<T>> create(Component compo
* @return Data Provider instance
*/

ISelectableDataProvider<T, PrismContainerValueWrapper<T>> create(Component component, @NotNull IModel<Search<T>> search, IModel<List<PrismContainerValueWrapper<T>>> model,
ISelectableDataProvider<PrismContainerValueWrapper<T>> create(Component component, @NotNull IModel<Search<T>> search, IModel<List<PrismContainerValueWrapper<T>>> model,
Class<? extends Objectable> objectType, String oid, ItemPath path, CompiledObjectCollectionView compiledObjectCollectionView, Customization<T> customization);

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
/*
* Copyright (c) 2010-2019 Evolveum and contributors
* Copyright (C) 2010-2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.web.component.data;

import com.evolveum.midpoint.prism.query.ObjectQuery;

import org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
* @author skublik
*/
import com.evolveum.midpoint.prism.query.ObjectQuery;

public interface ISelectableDataProvider<O, S> extends ISortableDataProvider<S, String> {
public interface ISelectableDataProvider<S> extends ISortableDataProvider<S, String> {

void setQuery(ObjectQuery query);
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @author semancik
*/
public class SelectableBeanContainerDataProvider<C extends Containerable> extends BaseSearchDataProvider<C, SelectableBean<C>>
implements ISelectableDataProvider<C, SelectableBean<C>>{
implements ISelectableDataProvider<SelectableBean<C>>{
private static final long serialVersionUID = 1L;

private static final Trace LOGGER = TraceManager.getTrace(SelectableBeanContainerDataProvider.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
package com.evolveum.midpoint.web.component.data.column;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.evolveum.midpoint.gui.impl.model.SelectableObjectModel;

import com.evolveum.midpoint.gui.impl.util.TableUtil;
import com.evolveum.midpoint.web.component.util.SelectableBean;

import com.evolveum.midpoint.web.component.util.SelectableRow;

Expand All @@ -32,7 +30,6 @@
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.data.BaseSortableDataProvider;
import com.evolveum.midpoint.web.component.data.SelectableDataTable;
import com.evolveum.midpoint.web.component.data.TableHeadersToolbar;
import com.evolveum.midpoint.web.component.util.Selectable;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
Expand Down

0 comments on commit e896fac

Please sign in to comment.