use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.
the class OnePageParameterEncoder method decodePageParameters.
@Override
public PageParameters decodePageParameters(Url url) {
PageParameters parameters = new PageParameters();
List<String> segments = url.getSegments();
if (!segments.isEmpty()) {
String value = segments.get(0);
parameters.add(PARAMETER, value);
}
if (url.getQueryParameters() != null) {
for (Url.QueryParameter qp : url.getQueryParameters()) {
parameters.add(qp.getName(), qp.getValue());
}
}
return parameters.isEmpty() ? null : parameters;
}
use of org.apache.wicket.request.mapper.parameter.PageParameters in project ocvn by devgateway.
the class BasePage method newLanguageMenu.
public NavbarDropDownButton newLanguageMenu() {
final NavbarDropDownButton languageDropDown = new NavbarDropDownButton(new StringResourceModel("navbar.lang", this, null)) {
private static final long serialVersionUID = 319842753824102674L;
@Override
protected List<AbstractLink> newSubMenuButtons(final String buttonMarkupId) {
final List<AbstractLink> list = new ArrayList<>();
for (final Locale l : WebConstants.AVAILABLE_LOCALES) {
final PageParameters params = new PageParameters(BasePage.this.getPageParameters());
params.set(WebConstants.LANGUAGE_PARAM, l.getLanguage());
list.add(new MenuBookmarkablePageLink<Page>(BasePage.this.getPageClass(), params, Model.of(l.getDisplayName())));
}
return list;
}
};
languageDropDown.setIconType(GlyphIconType.flag);
return languageDropDown;
}
Aggregations