19 package org.turro.elephant.web.actions;
21 import java.io.IOException;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import org.turro.elephant.context.IConstructor;
25 import org.turro.elephant.web.ElContext;
26 import org.turro.elephant.web.ElContextMap;
27 import org.turro.i18n.I_;
28 import org.turro.string.Strings;
37 this.constructor = constructor;
51 String caption =
null, url =
null, icon =
null;
72 caption =
I_.
get(
"Email");
76 caption =
I_.
get(
"Call");
80 return switch(command) {
88 url =
"https://api.whatsapp.com/send?phone=" + command;
92 url =
"https://t.me/" + command;
95 if(!Strings.isBlank(url)) {
96 return new WebLink(type, caption, url, Strings.isBlank(image, icon));
99 return new WebLink(
null,
null,
null);
105 }
catch (IOException ex) {
106 Logger.getLogger(
WebActions.class.getName()).log(Level.SEVERE,
null, ex);
128 private final String action;
131 private String image;
134 this.action = action;
static ElContext getContextFromWebTag(String webTag)
static ElContext getContext(IConstructor constructor)
WebActions image(String image)
static WebActions of(String action)
WebActions constructor(IConstructor constructor)
static String get(String msg)
static WebActionType typeOf(String action)
static String imageOf(String action)
static String actionOf(String action)
void redirect(String path)