19 package org.turro.elephant.signin;
21 import java.io.IOException;
22 import org.turro.auth.Authentication;
23 import org.turro.command.Command;
24 import org.turro.command.Context;
25 import org.turro.elephant.TemplateControl;
26 import org.turro.elephant.context.Application;
27 import org.turro.entities.EntityCombobox;
28 import org.turro.i18n.I_;
29 import org.turro.zkoss.dialog.InputDialog;
30 import org.turro.zkoss.dialog.InputField;
31 import org.zkoss.zk.ui.HtmlBasedComponent;
32 import org.zkoss.zk.ui.event.Event;
33 import org.zkoss.zk.ui.select.annotation.Listen;
34 import org.zkoss.zk.ui.select.annotation.Wire;
35 import org.zkoss.zul.A;
36 import org.zkoss.zul.Div;
44 @Wire(
"#impersonateform")
45 private Div impersonateform;
48 private A impersonate;
53 @Listen(
"onClick = #impersonate")
57 I_.
get(
"Impersonate"),
59 new InputField(
"Contact", null, null, 0) {
61 protected HtmlBasedComponent createEditor() {
62 EntityCombobox ec = new EntityCombobox();
63 ec.setRoot(
"contact");
67 protected Object getEditorValue() {
68 return ((EntityCombobox) editor).getObjectValue();
73 public Object execute(Context context) {
75 if(fields.length > 0) {
77 if(
"Contact".equals(f.getLabel())) {
89 @Listen(
"onClick = #backtoself")
90 public
void onBackToSelf() {
99 impersonateform.setVisible(impersonate.isVisible() || backtoself.isVisible());
static void impersonateIContact(IContact contact)
static boolean canImpersonate()
static void impersonateContact(Object contact)
static boolean isBehaving()
abstract void sendRedirect(String uri)
static Application getApplication()
void onImpersonate(Event event)
static String get(String msg)