Improve CMS View.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / ui / CmsView.java
index 8011dce59a9af024ef40ecb025c30cde7e80be31..e18d4b4330d3098a6c8178fa71f1cda29382497b 100644 (file)
@@ -6,6 +6,7 @@ import java.util.Map;
 
 import javax.security.auth.login.LoginContext;
 
+import org.argeo.cms.auth.CmsSession;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 
@@ -61,6 +62,25 @@ public interface CmsView {
                throw new UnsupportedOperationException();
        }
 
+       default Void runAs(Runnable runnable) {
+               return doAs(new PrivilegedAction<Void>() {
+
+                       @Override
+                       public Void run() {
+                               if (runnable != null)
+                                       runnable.run();
+                               return null;
+                       }
+               });
+       }
+
+       default void stateChanged(String state, String title) {
+       }
+
+       default CmsSession getCmsSession() {
+               throw new UnsupportedOperationException();
+       }
+
        static CmsView getCmsView(Control parent) {
                // find parent shell
                Shell topShell = parent.getShell();