Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/support-4.4' into s…
Browse files Browse the repository at this point in the history
…upport-4.4
  • Loading branch information
skublik committed Jan 25, 2022
2 parents df99773 + fc5dcbf commit fc7f0e3
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

import java.util.Collection;
import java.util.Collections;
import java.util.Locale;
import java.util.*;

@PanelType(name = "internalPerformance")
@PanelInstance(identifier = "internalPerformance", applicableForType = TaskType.class, childOf = TaskPerformancePanel.class,
Expand All @@ -59,9 +57,8 @@ public TaskInternalPerformancePanel(String id, TaskDetailsModel taskModel, Conta
private final IModel<SortBy> sortByModel = Model.of(SortBy.NAME);

protected void initLayout() {

DropDownChoicePanel<Format> formatPanel =
WebComponentUtil.createEnumPanel(Format.class, ID_FORMAT, formatModel, this, false);
WebComponentUtil.createEnumPanel(Format.class, ID_FORMAT, createFormatListModel(), formatModel, this, false);
formatPanel.getBaseFormComponent().add(new OnChangeAjaxBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
Expand Down Expand Up @@ -97,6 +94,13 @@ public boolean isResizeToMaxHeight() {

}

private IModel<List<Format>> createFormatListModel() {
List<Format> formatList = new ArrayList<>();
Collections.addAll(formatList, Format.values());
formatList.remove(Format.RAW);
return Model.ofList(formatList);
}

private IModel<String> createStringModel() {
return new IModel<>() {
@Override
Expand Down

0 comments on commit fc7f0e3

Please sign in to comment.