Skip to content

Commit

Permalink
more cleanup - role member panel
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Apr 16, 2021
1 parent f9e388d commit 829adef
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 85 deletions.
Expand Up @@ -174,13 +174,6 @@ protected boolean isObjectDetailsEnabled(IModel<SelectableBean<O>> rowModel) {

protected void objectDetailsPerformed(AjaxRequestTarget target, O object){}

protected ContainerTypeSearchItem getTypeItem(Class<? extends O> type, List<DisplayableValue<Class<? extends O>>> allowedValues){
@NotNull ObjectTypes objectType = ObjectTypes.getObjectType(type);
return new ContainerTypeSearchItem<>(new SearchValue<>(objectType.getClassDefinition(),
"ObjectType." + objectType.getTypeQName().getLocalPart()),
allowedValues);
}

@Override
protected O getRowRealValue(SelectableBean<O> rowModelObject) {
if (rowModelObject == null) {
Expand Down
Expand Up @@ -32,7 +32,7 @@ public class ContainerTypeSearchItem<C extends Containerable> extends SearchItem
public static final String F_TYPE_VALUE = "type.value";
public static final String F_TYPE = "type";

private List<DisplayableValue<Class<? extends C>>> allowedValues = new ArrayList<>();
private List<DisplayableValue<Class<C>>> allowedValues = new ArrayList<>();
private DisplayableValue<Class<C>> type;
private Class<C> oldType;
private boolean visible = false;
Expand All @@ -46,7 +46,7 @@ public ContainerTypeSearchItem(@NotNull DisplayableValue<Class<C>> type) {
this(type, null);
}

public ContainerTypeSearchItem(@NotNull DisplayableValue<Class<C>> type, List<DisplayableValue<Class<? extends C>>> allowedValues) {
public ContainerTypeSearchItem(@NotNull DisplayableValue<Class<C>> type, List<DisplayableValue<Class<C>>> allowedValues) {
super(null);
Validate.notNull(type, "Type must not be null.");
Validate.notNull(type.getValue(), "Type must not be null.");
Expand Down Expand Up @@ -101,7 +101,7 @@ public String toString() {
'}';
}

public List<DisplayableValue<Class<? extends C>>> getAllowedValues() {
public List<DisplayableValue<Class<C>>> getAllowedValues() {
return allowedValues;
}

Expand Down
Expand Up @@ -39,7 +39,7 @@ protected void initSearchItemField(WebMarkupContainer searchItemContainer) {
Component searchItemField = new WebMarkupContainer(ID_SEARCH_ITEM_FIELD);
ContainerTypeSearchItem<C> item = getModelObject();
if (item != null && item.getAllowedValues() != null) {
List<DisplayableValue<Class<? extends C>>> allowedValues = item.getAllowedValues();
List<DisplayableValue<Class<C>>> allowedValues = item.getAllowedValues();
if (allowedValues != null && !allowedValues.isEmpty()) {
IModel<List<DisplayableValue<?>>> choices = new ListModel(item.getAllowedValues());
searchItemField = createDropDownChoices(ID_SEARCH_ITEM_FIELD, new PropertyModel<>(getModel(), ContainerTypeSearchItem.F_TYPE), choices, false);
Expand Down

0 comments on commit 829adef

Please sign in to comment.