Skip to content

Commit

Permalink
Adding map tooltip customization features
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Nov 10, 2023
1 parent 7353c33 commit 34104e2
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 37 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/computate/frFR/java/ConfigCles.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ public class ConfigCles {
public static final String var_HtmCellule = "var_HtmCellule";
public static final String var_htmColonne = "var_htmColonne";
public static final String var_HtmColonne = "var_HtmColonne";
public static final String var_HtmInfobulle = "var_HtmInfobulle";
public static final String var_htmInfobulle = "var_htmInfobulle";
public static final String var_htmLigne = "var_htmLigne";
public static final String var_HtmLigne = "var_HtmLigne";
public static final String var_IconeGroupe = "var_IconeGroupe";
Expand All @@ -250,6 +252,7 @@ public class ConfigCles {
public static final String var_initLoin = "var_initLoin";
public static final String var_InitLoin = "var_InitLoin";
public static final String var_Interne = "var_Interne";
public static final String var_JsInfobulle = "var_JsInfobulle";
public static final String var_LANGUE_NOM = "var_LANGUE_NOM";
public static final String var_Langue = "var_Langue";
public static final String var_Largeur = "var_Largeur";
Expand Down
36 changes: 36 additions & 0 deletions src/main/java/org/computate/frFR/java/ConfigSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -807,6 +808,41 @@ public String regex(String motif, String texte, String valeurDefaut) {
return o;
}

public String regexYaml(String champ, String texte) {
String o = null;
if (champ != null && texte != null) {
String motif = "^" + champ + ": ([>|-]{0,2}(\\d*)\\n)?([\\s\\S]*?)(^\\w|\\Z)";
Matcher m = Pattern.compile(motif, Pattern.MULTILINE).matcher(texte);
boolean trouve = m.find();
if (trouve) {
String groupe1 = m.group(1);
String groupe2 = m.group(2);
String groupe3 = m.group(3);
Integer spaces = 2;
if(groupe2.length() > 0)
spaces = Integer.parseInt(groupe2);
o = groupe3.replaceAll("^" + String.join("", Collections.nCopies(spaces, " ")), "").replaceAll("\n" + String.join("", Collections.nCopies(spaces, " ")), "\n");

if(groupe1.contains(">"))
o = o.replaceAll("\\n([^\\n])", " $1");

if(groupe1.contains("-"))
o = o.replaceAll("\\n+\\Z", "");
else if(!groupe1.contains("+"))
o = o.replaceAll("\\n\\Z", "");
} else {
motif = "^" + champ + ": (.*)";
m = Pattern.compile(motif, Pattern.MULTILINE).matcher(texte);
trouve = m.find();
if (trouve) {
String groupe1 = m.group(1);
o = groupe1;
}
}
}
return o;
}

/**
* Param1.var.enUS: pattern Param2.var.enUS: text Param3.var.enUS: group r:
* motif r.enUS: pattern r: texte r.enUS: text r: groupe r.enUS: group r: trouve
Expand Down
14 changes: 10 additions & 4 deletions src/main/java/org/computate/frFR/java/EcrireGenClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,11 @@ public class EcrireGenClasse extends EcrireClasse {
*/
protected String classeTitre;

protected String classeHtmInfobulle;
protected String classeJsInfobulle;
protected String classeJsPATCH;
protected String classeJsWebsocket;

/**
* Var.enUS: contextTheNames
*/
Expand Down Expand Up @@ -1116,7 +1121,7 @@ public class EcrireGenClasse extends EcrireClasse {

boolean entiteContientRequeteSite;

String entiteHtmlTooltip;
String entiteHtmInfobulle;

Integer entiteHtmColonne;

Expand Down Expand Up @@ -2284,6 +2289,7 @@ public void genCodeClasseDebut(String langueNom, YAMLConfiguration langueConfig)
if(classePageFichierJs != null) {
classePageFichierJs.getParentFile().mkdirs();
auteurPageJs = ToutEcrivain.create(classePageFichierJs);
auteurPageJs.setTab(" ");
}
if(classePageFichierHbs != null && (!classePageFichierHbs.exists() || classePageFichierHbs.length() == 0L)) {
classePageFichierHbs.getParentFile().mkdirs();
Expand Down Expand Up @@ -2810,8 +2816,8 @@ public void genCodeMethode(String langueNom, YAMLConfiguration langueConfig) thr
* r.enUS: entityAttribute
* r: entiteDefinir
* r.enUS: entityDefined
* r: entiteHtmlTooltip
* r.enUS: entityHtmlTooltip
* r: entiteHtmInfobulle
* r.enUS: entityHtmInfobulle
* r: urlSolrComputate
* r.enUS: solrUrlComputate
* r: partEstEntite
Expand Down Expand Up @@ -3072,7 +3078,7 @@ public void genCodeEntite(String langueNom, YAMLConfiguration langueConfig) thro
entiteTypeJson = doc.getString("entiteTypeJson_stored_string");

entiteNomAffichage = doc.getString("entiteNomAffichage_" + langueNom + "_stored_string");
entiteHtmlTooltip = doc.getString("entiteHtmlTooltip_" + langueNom + "_stored_string");
entiteHtmInfobulle = doc.getString("entiteHtmInfobulle_" + langueNom + "_stored_string");
entiteHtmColonne = doc.getInteger("entiteHtmColonne_stored_int");
entiteHtmLigne = doc.getInteger("entiteHtmLigne_stored_int");
entiteHtmLigneTitre = doc.getString("entiteHtmLigneTitre_stored_string");
Expand Down
Loading

0 comments on commit 34104e2

Please sign in to comment.