- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 29 of file WebLink.java.
◆ WebLink() [1/2]
org.turro.elephant.web.actions.WebLink.WebLink |
( |
WebActionType |
type, |
|
|
String |
caption, |
|
|
String |
url |
|
) |
| |
Definition at line 34 of file WebLink.java.
35 this(type, caption, url,
null);
◆ WebLink() [2/2]
org.turro.elephant.web.actions.WebLink.WebLink |
( |
WebActionType |
type, |
|
|
String |
caption, |
|
|
String |
url, |
|
|
String |
icon |
|
) |
| |
Definition at line 38 of file WebLink.java.
40 this.caption = caption;
◆ from()
static WebLink org.turro.elephant.web.actions.WebLink.from |
( |
WebLink |
webLink, |
|
|
String |
newCaption |
|
) |
| |
|
static |
Definition at line 113 of file WebLink.java.
114 if(webLink.getType() == WebActionType.WRONG)
return webLink;
115 return new WebLink(webLink.getType(), newCaption, webLink.getUrl(), webLink.getIcon());
WebLink(WebActionType type, String caption, String url)
◆ getCaption()
String org.turro.elephant.web.actions.WebLink.getCaption |
( |
| ) |
|
Definition at line 49 of file WebLink.java.
50 if(Strings.isBlank(caption))
return switch(type) {
51 case NAVIGATE, ACTION, TAG, URL -> url;
52 case MAIL -> I_.get(
"Email");
53 case TEL -> I_.get(
"Call");
54 case WHATS ->
"Whatsapp";
55 case TGRAM ->
"Telegram";
56 case WRONG ->
"Wrong";
◆ getHelp()
String org.turro.elephant.web.actions.WebLink.getHelp |
( |
| ) |
|
Definition at line 82 of file WebLink.java.
84 case NAVIGATE, TAG, ACTION, URL -> url;
85 case MAIL, TEL -> Strings.pastFirst(url,
":");
86 case WHATS -> Strings.pastLast(url,
"=");
87 case TGRAM -> Strings.pastLast(url,
"/");
88 case WRONG ->
"Wrong action found";
◆ getIcon()
String org.turro.elephant.web.actions.WebLink.getIcon |
( |
| ) |
|
Definition at line 65 of file WebLink.java.
66 if(Strings.isBlank(icon))
return switch(type) {
67 case NAVIGATE, URL, TAG ->
"globe";
68 case MAIL ->
"envelope";
70 case ACTION ->
switch(url) {
71 case "singup" ->
"sign in alternate";
72 case "tellsomeone" ->
"satellite dish";
75 case WHATS ->
"whatsapp";
76 case TGRAM ->
"telegram";
77 case WRONG ->
"warning";
◆ getIcons()
Icons org.turro.elephant.web.actions.WebLink.getIcons |
( |
| ) |
|
◆ getType()
◆ getUrl()
String org.turro.elephant.web.actions.WebLink.getUrl |
( |
| ) |
|
◆ isEmpty()
boolean org.turro.elephant.web.actions.WebLink.isEmpty |
( |
| ) |
|
Definition at line 100 of file WebLink.java.
101 return type ==
null || Strings.isBlank(caption) || Strings.isBlank(url);
◆ isExternal()
boolean org.turro.elephant.web.actions.WebLink.isExternal |
( |
| ) |
|
Definition at line 96 of file WebLink.java.
97 return url.matches(
"(http|https|ftp|sftp|ftps):.+");
The documentation for this class was generated from the following file: