X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui%2Fsrc%2Forg%2Fargeo%2Fcms%2Fui%2FCmsUiProvider.java;h=00939e154ca2a5df106fb5b150f6dc33e6bc27ac;hb=fea7cd546f9c04c00f961918919dd6307c32cc8e;hp=24415c83c8594815469ef8d95f7cba5e8cc75dbd;hpb=5330a39edafd14df2e6cdc57aae4e9393ebca75c;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/CmsUiProvider.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/CmsUiProvider.java index 24415c83c..00939e154 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/ui/CmsUiProvider.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/ui/CmsUiProvider.java @@ -8,14 +8,22 @@ import org.eclipse.swt.widgets.Control; /** Stateless factory building an SWT user interface given a JCR context. */ @FunctionalInterface -public interface CmsUiProvider { +public interface CmsUiProvider extends MvcProvider { /** * Initialises a user interface. * - * @param parent - * the parent composite - * @param context - * a context node (holding the JCR underlying session), or null + * @param parent the parent composite + * @param context a context node (holding the JCR underlying session), or null */ - public Control createUi(Composite parent, Node context) throws RepositoryException; + Control createUi(Composite parent, Node context) throws RepositoryException; + + @Override + default Control createUiPart(Composite parent, Node context) { + try { + return createUi(parent, context); + } catch (RepositoryException e) { + throw new IllegalStateException("Cannot create UI for context " + context, e); + } + } + }