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;
}
}
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);
}
}
Aggregations