use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.
the class PagePreviewChanges method savePerformed.
private void savePerformed(AjaxRequestTarget target) {
Breadcrumb bc = redirectBack();
if (bc instanceof BreadcrumbPageInstance) {
BreadcrumbPageInstance bcpi = (BreadcrumbPageInstance) bc;
WebPage page = bcpi.getPage();
if (page instanceof PageAdminObjectDetails) {
((PageAdminObjectDetails) page).setSaveOnConfigure(true);
} else {
error("Couldn't save changes - unexpected referring page: " + page);
}
} else {
error("Couldn't save changes - no instance for referring page; breadcrumb is " + bc);
}
}
use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.
the class PageBase method createConfigurationItems.
private MainMenuItem createConfigurationItems() {
MainMenuItem item = new MainMenuItem("fa fa-cog", createStringResource("PageAdmin.menu.top.configuration"), null);
item.setInsertDefaultBackBreadcrumb(false);
List<MenuItem> submenu = item.getItems();
MenuItem menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.bulkActions"), PageBulkAction.class);
submenu.add(menu);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.importObject"), PageImportObject.class, null, null);
submenu.add(menu);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.repositoryObjects"), PageDebugList.class);
submenu.add(menu);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.repositoryObjectView"), PageDebugView.class, null, createVisibleDisabledBehaviorForEditMenu(PageDebugView.class));
submenu.add(menu);
PageParameters params = new PageParameters();
params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_BASIC);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.basic"), PageSystemConfiguration.class, params, null) {
@Override
public boolean isMenuActive(WebPage page) {
if (!PageSystemConfiguration.class.equals(page.getClass())) {
return false;
}
int index = getSelectedTabForConfiguration(page);
return PageSystemConfiguration.CONFIGURATION_TAB_BASIC == index ? true : false;
}
};
submenu.add(menu);
params = new PageParameters();
params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_NOTIFICATION);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.notifications"), PageSystemConfiguration.class, params, null) {
@Override
public boolean isMenuActive(WebPage page) {
if (!PageSystemConfiguration.class.equals(page.getClass())) {
return false;
}
int index = getSelectedTabForConfiguration(page);
return PageSystemConfiguration.CONFIGURATION_TAB_NOTIFICATION == index ? true : false;
}
};
submenu.add(menu);
params = new PageParameters();
params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_LOGGING);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.logging"), PageSystemConfiguration.class, params, null) {
@Override
public boolean isMenuActive(WebPage page) {
if (!PageSystemConfiguration.class.equals(page.getClass())) {
return false;
}
int index = getSelectedTabForConfiguration(page);
return PageSystemConfiguration.CONFIGURATION_TAB_LOGGING == index ? true : false;
}
};
submenu.add(menu);
params = new PageParameters();
params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_PROFILING);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.profiling"), PageSystemConfiguration.class, params, null) {
@Override
public boolean isMenuActive(WebPage page) {
if (!PageSystemConfiguration.class.equals(page.getClass())) {
return false;
}
int index = getSelectedTabForConfiguration(page);
return PageSystemConfiguration.CONFIGURATION_TAB_PROFILING == index ? true : false;
}
};
submenu.add(menu);
params = new PageParameters();
params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, PageSystemConfiguration.CONFIGURATION_TAB_ADMIN_GUI);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.adminGui"), PageSystemConfiguration.class, params, null) {
@Override
public boolean isMenuActive(WebPage page) {
if (!PageSystemConfiguration.class.equals(page.getClass())) {
return false;
}
int index = getSelectedTabForConfiguration(page);
return PageSystemConfiguration.CONFIGURATION_TAB_ADMIN_GUI == index ? true : false;
}
};
submenu.add(menu);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.shadowsDetails"), PageAccounts.class);
submenu.add(menu);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.internals"), PageInternals.class);
submenu.add(menu);
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.repoQuery"), PageRepositoryQuery.class);
submenu.add(menu);
if (SystemConfigurationHolder.isExperimentalCodeEnabled()) {
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.evaluateMapping"), PageEvaluateMapping.class);
submenu.add(menu);
}
menu = new MenuItem(createStringResource("PageAdmin.menu.top.configuration.about"), PageAbout.class);
submenu.add(menu);
return item;
}
use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.
the class PageBase method navigateToNext.
public void navigateToNext(Class<? extends WebPage> pageType, PageParameters params) {
IPageFactory pFactory = Session.get().getPageFactory();
WebPage page;
if (params == null) {
page = pFactory.newPage(pageType);
} else {
page = pFactory.newPage(pageType, params);
}
navigateToNext(page);
}
use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.
the class NewWindowNotifyingBehavior method onNewWindow.
@Override
protected void onNewWindow(AjaxRequestTarget target) {
LOG.debug("Page version already used in different tab, refreshing page");
WebPage page = (WebPage) getComponent();
page.setResponsePage(page.getPageClass(), page.getPageParameters());
}
use of org.apache.wicket.markup.html.WebPage in project midpoint by Evolveum.
the class MainMenuPanel method createSubmenu.
private void createSubmenu(final ListItem<MenuItem> listItem) {
final MenuItem menuItem = listItem.getModelObject();
listItem.add(AttributeModifier.replace("class", new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return menuItem.isMenuActive((WebPage) getPage()) ? "active" : null;
}
}));
Link<String> subLink = new Link<String>(ID_SUB_LINK) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
menuItemPerformed(menuItem);
}
};
listItem.add(subLink);
Label subLabel = new Label(ID_SUB_LABEL, menuItem.getNameModel());
subLink.add(subLabel);
listItem.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
MenuItem mi = listItem.getModelObject();
boolean visible = true;
if (mi.getVisibleEnable() != null) {
visible = mi.getVisibleEnable().isVisible();
}
return visible && SecurityUtils.isMenuAuthorized(mi);
}
@Override
public boolean isEnabled() {
MenuItem mi = listItem.getModelObject();
if (mi.getVisibleEnable() == null) {
return true;
}
return mi.getVisibleEnable().isEnabled();
}
});
}
Aggregations