Introduce tabbed area.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / ui / CmsUiProvider.java
index 24415c83c8594815469ef8d95f7cba5e8cc75dbd..00939e154ca2a5df106fb5b150f6dc33e6bc27ac 100644 (file)
@@ -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<Composite, Node, Control> {
        /**
         * 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);
+               }
+       }
+
 }