From 2d232a4c719e0cab9401a69291f5defb1890f269 Mon Sep 17 00:00:00 2001 From: LegitCheetah Date: Tue, 12 Mar 2024 03:17:49 +0100 Subject: [PATCH] added Attributes getter and setter with descriptions and corresponding Enums(unfinished) --- src/main/Main.java | 2 +- src/main/htmlModules/ModuleGeneric.java | 3 +- src/main/htmlModules/ModuleTag.java | 112 ++++++++++++++++-- .../GlobalAttributeDraggableEnum.java | 15 +++ 4 files changed, 120 insertions(+), 12 deletions(-) create mode 100644 src/main/htmlModules/attributeEnums/GlobalAttributeDraggableEnum.java diff --git a/src/main/Main.java b/src/main/Main.java index a8d07df..6a4ac0c 100644 --- a/src/main/Main.java +++ b/src/main/Main.java @@ -5,7 +5,7 @@ import main.htmlSites.SiteGeneric; public class Main { public static void main(String[] args) { SiteGeneric site = new SiteGeneric(); - site.setID("1"); + site.setIDAttribute("1"); System.out.println(site.build()); } } diff --git a/src/main/htmlModules/ModuleGeneric.java b/src/main/htmlModules/ModuleGeneric.java index 46fbd04..b5700a4 100644 --- a/src/main/htmlModules/ModuleGeneric.java +++ b/src/main/htmlModules/ModuleGeneric.java @@ -1,6 +1,7 @@ package main.htmlModules; import main.HtmlTagsEnum; +import main.htmlModules.attributeEnums.GlobalAttributeDraggableEnum; import java.util.ArrayList; import java.util.HashMap; @@ -19,7 +20,7 @@ public class ModuleGeneric { protected String globalAttributeDataPrefix; //used with dataValue protected String globalAttributeDataValue; //used with dataPrefix protected String globalAttributeDir; - protected Enum globalAttributeDraggable; + protected GlobalAttributeDraggableEnum globalAttributeDraggable; protected String globalAttributeEnterkeyhint; protected boolean globalAttributeHidden; protected String globalAttributeId; diff --git a/src/main/htmlModules/ModuleTag.java b/src/main/htmlModules/ModuleTag.java index bc46b39..eebac91 100644 --- a/src/main/htmlModules/ModuleTag.java +++ b/src/main/htmlModules/ModuleTag.java @@ -1,6 +1,7 @@ package main.htmlModules; import main.HtmlTagsEnum; +import main.htmlModules.attributeEnums.GlobalAttributeDraggableEnum; public class ModuleTag extends ModuleGeneric { public ModuleTag(){ @@ -15,16 +16,6 @@ public class ModuleTag extends ModuleGeneric { content.add(new ModuleComment(comment)); } - - - public void setID(String ID) { - this.globalAttributeId = ID; - } - - public String getID() { - return globalAttributeId; - } - public void setTag(HtmlTagsEnum tag) { this.tag = tag; } @@ -32,4 +23,105 @@ public class ModuleTag extends ModuleGeneric { public HtmlTagsEnum getTag() { return tag; } + + + /** + * The Accesskey-Attribute specifies a hotkey/shortcut key to activate or select an element. + * @param accesskeyAttribute single character (letter or digit) + */ + public void setAccesskeyAttribute(char accesskeyAttribute){ + this.globalAttributeAccesskey = accesskeyAttribute; + } + + /** + * The Accesskey-Attribute specifies a hotkey/shortcut key to activate or select an element. + * @return Single character (letter or digit) + */ + public char getAccesskeyAttribute(){ + return globalAttributeAccesskey; + } + + /** + * + * @param classAttribute + */ + public void setClassAttribute(String classAttribute){ + this.globalAttributeClass = classAttribute; + } + + public String getClassAttribute(){ + return globalAttributeClass; + } + + public void setContenteditableAttribute(Boolean contenteditableAttribute){ + this.globalAttributeContenteditable = contenteditableAttribute; + } + + public Boolean getContenteditableAttribute(){ + return globalAttributeContenteditable; + } + + public void setDataPrefixAttribute(String dataPrefixAttribute){ + this.globalAttributeDataPrefix = dataPrefixAttribute; + } + + public String getDataPrefixAttribute(){ + return globalAttributeDataPrefix; + } + + public void setDataValueAttribute(String dataValueAttribute){ + this.globalAttributeDataValue = dataValueAttribute; + } + + public String getDataValueAttribute(){ + return globalAttributeDataValue; + } + + public void setDirAttribute(String dirAttribute){ + this.globalAttributeDir = dirAttribute; + } + + public String getDirAttribute(){ + return globalAttributeDir; + } + + public void setDraggableAttribute(GlobalAttributeDraggableEnum draggableAttribute){ + this.globalAttributeDraggable = draggableAttribute; + } + + public GlobalAttributeDraggableEnum getDraggableAttribute(){ + return globalAttributeDraggable; + } + + public void setEnterkeyhintAttribute(String enterkeyhintAttribute){ + this.globalAttributeEnterkeyhint = enterkeyhintAttribute; + } + + public String getEnterkeyhintAttribute(){ + return globalAttributeEnterkeyhint; + } + + public void setHiddenAttribute(boolean hiddenAttribute){ + this.globalAttributeHidden = hiddenAttribute; + } + + public boolean getHiddenAttribute(){ + return globalAttributeHidden; + } + + public void setIDAttribute(String idAttribute) { + this.globalAttributeId = idAttribute; + } + + public String getIDAttribute() { + return globalAttributeId; + } + + public void setInertAttribute(boolean inertAttribute){ + this.globalAttributeInert = inertAttribute; + } + + public boolean getInertAttribute(){ + return globalAttributeInert; + } } diff --git a/src/main/htmlModules/attributeEnums/GlobalAttributeDraggableEnum.java b/src/main/htmlModules/attributeEnums/GlobalAttributeDraggableEnum.java new file mode 100644 index 0000000..e610f98 --- /dev/null +++ b/src/main/htmlModules/attributeEnums/GlobalAttributeDraggableEnum.java @@ -0,0 +1,15 @@ +package main.htmlModules.attributeEnums; + +public enum GlobalAttributeDraggableEnum { + TRUE("true"), + FALSE("false"), + AUTO("auto"); + + private String attribute; + public String getAttribute(){ + return this.attribute; + } + private GlobalAttributeDraggableEnum(String attribute){ + this.attribute = attribute; + } +}