added more attributes and renamed the others to better distinguish

This commit is contained in:
Legit Cheetah 2024-02-07 17:05:42 +01:00
parent 076d17be2e
commit 24f1b7d680
2 changed files with 142 additions and 40 deletions

View File

@ -13,54 +13,156 @@ public class ModuleGeneric {
protected List<ModuleGeneric> content = new ArrayList<>();
//Global Attributes-------------------------------------------------------------------------------------------------
protected char accessKey;
protected String styleClass;
protected Boolean contentEditable;
protected String dataPrefix; //used with dataValue
protected String dataValue; //used with dataPrefix
protected String dir;
protected Enum draggable;
protected String enterKeyHint;
protected boolean hidden;
protected String id;
protected boolean inert;
protected Enum inputMethod;
protected Enum lang;
protected boolean popOver; //used with id & needs popovertarget on another tag
protected String popOverTaret; //needs id with the same name & popover on another tag
protected Boolean spellCheck;
protected HashMap style;
protected int tabIndex;
protected String title;
protected Boolean translate;
protected char globalAttributeAccesskey;
protected String globalAttributeClass;
protected Boolean globalAttributeContenteditable;
protected String globalAttributeDataPrefix; //used with dataValue
protected String globalAttributeDataValue; //used with dataPrefix
protected String globalAttributeDir;
protected Enum globalAttributeDraggable;
protected String globalAttributeEnterkeyhint;
protected boolean globalAttributeHidden;
protected String globalAttributeId;
protected boolean globalAttributeInert;
protected Enum globalAttributeInputmethod;
protected Enum globalAttributeLang;
protected boolean globalAttributePopover; //used with id & needs popovertarget on another tag
protected Boolean globalAttributeSpellcheck;
protected HashMap globalAttributeStyle;
protected int globalAttributeTabindex;
protected String globalAttributeTitle;
protected Boolean globalAttributeTranslate;
//Specific Attributes-----------------------------------------------------------------------------------------------
//<area>
protected String areaAttributeAlt;
protected String areaAttributeCoords;
protected String areaAttributeDownload;
protected String areaAttributeHref;
protected Enum areaAttributeHreflang;
protected String areaAttributeMedia; //Enums
protected Enum areaAttributeReferrerpolicy;
protected Enum areaAttributeRel;
protected Enum areaAttributeShape;
protected String areaAttributeTarget; //and Enum
protected Enum areaAttributeType;
//<audio>
protected boolean audioAttributeAutoplay;
protected boolean audioAttributeControls;
protected boolean audioAttributeLoop;
protected boolean audioAttributeMuted;
protected Enum audioAttributePreload;
protected String audioAttributeSrc;
//<button>
protected boolean buttonAttributeAutofocus;
protected boolean buttonAttributeDisabled;
protected String buttonAttributeForm;
protected String buttonAttributeFormaction;
protected Enum buttonAttributeFormenctype;
protected Enum buttonAttributeFormmethod;
protected boolean buttonAttributeFormnovalidate;
protected String buttonAttributeFormtarget; //and Enum
protected String buttonAttributePopovertarget;
protected Enum buttonAttributePopovertargetaction;
protected String buttonAttributeName;
protected Enum buttonAttributeType;
protected String buttonAttributeValue;
//<form>
protected String formAttributeAcceptcharset;
protected String formAttributeAction;
protected Enum formAttributeAutocomplete;
protected Enum formAttributeEnctype;
protected Enum formAttributeMethod;
protected String formAttributeName;
protected boolean formAttributeNovalidate;
protected Enum formAttributeRel;
protected String formAttributeTarget; //and Enum
//<img>
protected String imgAttributeAlt;
protected Enum imgAttributeCrossorigin;
protected int imgAttributeHeight;
protected boolean imgAttributeIsmap;
protected Enum imgAttributeLoading;
protected String imgAttributeLongdesc;
protected Enum imgAttributeReferrerpolicy;
protected String imgAttributeSizes;
protected String imgAttributeSrc;
protected String imgAttributeSrcset;
protected String imgAttributeUsemap;
protected int imgAttributeWidth;
//<input>
protected String accept; //used with type="file" //custom or Enum
protected String alt; //used with type="image"
protected Enum autoComplete; //Enum
protected Boolean autoFocus;
protected boolean checked; //used with type="checkbox" or type="radio"
protected boolean dirname; //used with name="<value>" -> dirname="<value.dir>"
protected boolean disabled;
protected String form; //needs formID
protected String formAction; //used with type="submit" or type="image"
protected Enum formenctype; //used with type="submit" or type="image"
protected Enum formmethod; //used with type="submit" or type="image"
protected boolean formNoValidate; //used with type="submit"
protected Enum formTarget; //or custom //use with type="submit" or type="image"
protected String inputAttributeAccept; //used with type="file" //custom or Enum
protected String inputAttributeAlt; //used with type="image"
protected Enum inputAttributeAutocomplete; //Enum
protected Boolean inputAttributeAutofocus;
protected boolean inputAttributeChecked; //used with type="checkbox" or type="radio"
protected boolean inputAttributeDirname; //used with name="<value>" -> dirname="<value.dir>"
protected boolean inputAttributeDisabled;
protected String inputAttributeForm; //needs formID
protected String inputAttributeFormaction; //used with type="submit" or type="image"
protected Enum inputAttributeFormenctype; //used with type="submit" or type="image"
protected Enum inputAttributeFormmethod; //used with type="submit" or type="image"
protected boolean inputAttributeFormnovalidate; //used with type="submit"
protected Enum inputAttributeFormtarget; //or custom //use with type="submit" or type="image"
protected int inputAttributeHeight; //used with type="image"
protected String inputAttributeList; //used with datalist and same as datalist id
protected String inputAttributeMax; //number or date
protected int inputAttributeMaxlength;
protected String inputAttributeMin; //number or date
protected int inputAttributeMinlength;
protected boolean inputAttributeMultiple;
protected String inputAttributeName;
protected String inputAttributePattern;
protected String inputAttributePlaceholder;
protected String inputAttributePopovertarget; //needs id with the same name & popover on another tag
protected Enum inputAttributePopovertargetaction;
protected boolean inputAttributeReadOnly;
protected boolean inputAttributeRequired;
protected int inputAttributeSize;
protected String inputAttributeSrc;
protected String inputAttributeStep;
protected Enum inputAttributeType;
protected String inputAttributeValue;
protected int inputAttributeWidth;
//<select>
protected boolean selectAttributeAutofocus;
protected boolean selectAttributeDisabled;
protected String selectAttributeForm;
protected boolean selectAttributeMultiple;
protected String selectAttributeName;
protected boolean selectAttributeRequired;
protected int selectAttributeSize;
//<script>
protected boolean scriptAttributeAsync;
protected Enum scriptAttributeCrossorigin;
protected boolean scriptAttributeDefer;
protected String scriptAttributeIntegrity;
protected Boolean scriptAttributeNomodule;
protected Enum scriptAttributeReferrerpolicy;
protected String scriptAttributeSrc;
protected Enum scriptAttributetype;
//<textarea>
protected boolean textareaAttributeAutofocus;
protected int textareaAttributeCols;
protected String textareaAttributeDirname;
protected boolean textareaAttributeDisabled;
protected String textareaAttributeForm;
protected int textareaAttributeMaxlength;
protected String textareaAttributeName;
protected String textareaAttributePlaceholder;
protected boolean textareaAttributeReadonly;
protected boolean textareaAttributeRequired;
protected int textareaAttributeRows;
protected Boolean textareaAttributeWrap;
//form
protected String acceptCharset;
protected String action;
public StringBuilder build(){
StringBuilder buildString = new StringBuilder();
buildString
.append("\n<")
.append(tag.getTag())
.append(id != null ? " id=\"" + id +"\"" : "")
.append(globalAttributeId != null ? " id=\"" + globalAttributeId +"\"" : "")
.append(">");
for (ModuleGeneric moduleGeneric : content) {

View File

@ -18,11 +18,11 @@ public class ModuleTag extends ModuleGeneric {
public void setID(String ID) {
this.id = ID;
this.globalAttributeId = ID;
}
public String getID() {
return id;
return globalAttributeId;
}
public void setTag(HtmlTagsEnum tag) {