19 package org.turro.alliance.menu;
21 import org.turro.alliance.model.AllianceServerCombobox;
22 import org.turro.alliance.service.AxConstants;
23 import org.turro.alliance.service.AxServer;
24 import org.turro.alliance.service.AxClient;
25 import org.turro.annotation.ExternalMenu;
26 import org.turro.i18n.I_;
27 import org.turro.importer.ImportFromMembers;
28 import org.turro.json.Jsons;
29 import org.turro.menu.ElephantMenu;
30 import org.turro.menu.ElephantMenuBar;
31 import org.turro.security.Permission;
32 import org.turro.ws.WsServer;
33 import org.turro.ws.service.server.Clients;
34 import org.turro.ws.service.member.Servers;
35 import org.turro.zkoss.dialog.DialogField;
36 import org.turro.zkoss.dialog.Dialogs;
37 import org.zkoss.zk.ui.event.Event;
38 import org.zkoss.zk.ui.event.EventListener;
52 return Clients.hasMembers(AxClient.CLIENT_SERVICE);
55 return Servers.hasServers(AxServer.SERVER_SERVICE);
58 return Servers.hasServers(AxServer.SERVER_SERVICE);
61 return Servers.hasServers(AxServer.SERVER_SERVICE);
64 return Servers.hasServers(AxServer.SERVER_SERVICE);
68 return Clients.hasMembers(AxClient.CLIENT_SERVICE);
71 .
addMenuitem(
"Update server",
"alliance", (EventListener) (Event event) -> {
76 return new AllianceServerCombobox();
79 WsServer server = dialogs.<AllianceServerCombobox>getEditor(
"Server").getObjectValue();
80 if(server != null) Servers.getData(server, AxConstants.UPDATE_SERVER, Jsons.object());
87 .
addMenuitem(
"Connect to members",
"alliance", (EventListener) (Event event) -> {
static final String CLIENT_SERVICE
static final String SERVER_SERVICE
static String get(String msg)
static Permission from(String... roles)
static DialogField field(String label)
Dialogs width(String width)
Dialogs height(String height)
Dialogs onOk(Consumer< Dialogs > onOk)
static Dialogs title(String title)
Dialogs addField(DialogField field)