Improve CMS session.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / ui / CmsView.java
index b403a2088d33fbfcb703c49c1bdf11762eca4b6d..dcc1f1fd16b8b747723382dc071927e1246cb0ae 100644 (file)
@@ -1,11 +1,13 @@
 package org.argeo.cms.ui;
 
+import java.security.PrivilegedAction;
 import java.util.HashMap;
 import java.util.Map;
 
 import javax.security.auth.login.LoginContext;
 
-import org.eclipse.swt.widgets.Composite;
+import org.argeo.cms.auth.CmsSession;
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 
 /** Provides interaction with the CMS system. */
@@ -51,12 +53,23 @@ public interface CmsView {
                properties.put(param, value);
                sendEvent(topic, properties);
        }
-       
+
        default void applyStyles(Object widget) {
-               
+
+       }
+
+       default <T> T doAs(PrivilegedAction<T> action) {
+               throw new UnsupportedOperationException();
+       }
+       
+       default void stateChanged(String state, String title) {
+       }
+       
+       default CmsSession getCmsSession() {
+               throw new UnsupportedOperationException();
        }
 
-       static CmsView getCmsView(Composite parent) {
+       static CmsView getCmsView(Control parent) {
                // find parent shell
                Shell topShell = parent.getShell();
                while (topShell.getParent() != null)