Search in sources :

Example 1 with ErrorPanel

use of com.evolveum.midpoint.gui.impl.error.ErrorPanel in project midpoint by Evolveum.

the class PrismPropertyValuePanel method createDefaultPanel.

@Override
protected Component createDefaultPanel(String id) {
    if (getPageBase().getApplication().usesDevelopmentConfig()) {
        return new ErrorPanel(id, createStringResource("Cannot create component for: " + getModelObject().getParent().getItem()));
    } else {
        Label noComponent = new Label(id);
        noComponent.setVisible(false);
        return noComponent;
    }
}
Also used : ErrorPanel(com.evolveum.midpoint.gui.impl.error.ErrorPanel) Label(org.apache.wicket.markup.html.basic.Label)

Example 2 with ErrorPanel

use of com.evolveum.midpoint.gui.impl.error.ErrorPanel in project midpoint by Evolveum.

the class PageBase method initItemPanel.

public <IW extends ItemWrapper> Panel initItemPanel(String panelId, QName typeName, IModel<IW> wrapperModel, ItemPanelSettings itemPanelSettings) throws SchemaException {
    Class<?> panelClass = getWrapperPanel(typeName);
    if (panelClass == null) {
        ErrorPanel errorPanel = new ErrorPanel(panelId, () -> "Cannot create panel for " + typeName);
        errorPanel.add(new VisibleBehaviour(() -> getApplication().usesDevelopmentConfig()));
        return errorPanel;
    }
    Constructor<?> constructor;
    try {
        constructor = panelClass.getConstructor(String.class, IModel.class, ItemPanelSettings.class);
        return (Panel) constructor.newInstance(panelId, wrapperModel, itemPanelSettings);
    } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
        throw new SystemException("Cannot instantiate " + panelClass, e);
    }
}
Also used : ErrorPanel(com.evolveum.midpoint.gui.impl.error.ErrorPanel) IModel(org.apache.wicket.model.IModel) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) InvocationTargetException(java.lang.reflect.InvocationTargetException) ItemPanelSettings(com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettings) LocalePanel(com.evolveum.midpoint.web.component.menu.top.LocalePanel) UserMenuPanel(com.evolveum.midpoint.web.component.menu.UserMenuPanel) ErrorPanel(com.evolveum.midpoint.gui.impl.error.ErrorPanel) PrismContainerValuePanel(com.evolveum.midpoint.gui.impl.prism.panel.PrismContainerValuePanel) Panel(org.apache.wicket.markup.html.panel.Panel) LeftMenuPanel(com.evolveum.midpoint.gui.impl.component.menu.LeftMenuPanel)

Aggregations

ErrorPanel (com.evolveum.midpoint.gui.impl.error.ErrorPanel)2 LeftMenuPanel (com.evolveum.midpoint.gui.impl.component.menu.LeftMenuPanel)1 ItemPanelSettings (com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettings)1 PrismContainerValuePanel (com.evolveum.midpoint.gui.impl.prism.panel.PrismContainerValuePanel)1 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)1 UserMenuPanel (com.evolveum.midpoint.web.component.menu.UserMenuPanel)1 LocalePanel (com.evolveum.midpoint.web.component.menu.top.LocalePanel)1 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Label (org.apache.wicket.markup.html.basic.Label)1 Panel (org.apache.wicket.markup.html.panel.Panel)1 IModel (org.apache.wicket.model.IModel)1