added Attributes getter and setter with descriptions and corresponding Enums(unfinished)

This commit is contained in:
LegitCheetah 2024-03-12 03:17:49 +01:00
parent 3de9ba2867
commit 2d232a4c71
4 changed files with 120 additions and 12 deletions

View File

@ -5,7 +5,7 @@ import main.htmlSites.SiteGeneric;
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {
SiteGeneric site = new SiteGeneric(); SiteGeneric site = new SiteGeneric();
site.setID("1"); site.setIDAttribute("1");
System.out.println(site.build()); System.out.println(site.build());
} }
} }

View File

@ -1,6 +1,7 @@
package main.htmlModules; package main.htmlModules;
import main.HtmlTagsEnum; import main.HtmlTagsEnum;
import main.htmlModules.attributeEnums.GlobalAttributeDraggableEnum;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -19,7 +20,7 @@ public class ModuleGeneric {
protected String globalAttributeDataPrefix; //used with dataValue protected String globalAttributeDataPrefix; //used with dataValue
protected String globalAttributeDataValue; //used with dataPrefix protected String globalAttributeDataValue; //used with dataPrefix
protected String globalAttributeDir; protected String globalAttributeDir;
protected Enum globalAttributeDraggable; protected GlobalAttributeDraggableEnum globalAttributeDraggable;
protected String globalAttributeEnterkeyhint; protected String globalAttributeEnterkeyhint;
protected boolean globalAttributeHidden; protected boolean globalAttributeHidden;
protected String globalAttributeId; protected String globalAttributeId;

View File

@ -1,6 +1,7 @@
package main.htmlModules; package main.htmlModules;
import main.HtmlTagsEnum; import main.HtmlTagsEnum;
import main.htmlModules.attributeEnums.GlobalAttributeDraggableEnum;
public class ModuleTag extends ModuleGeneric { public class ModuleTag extends ModuleGeneric {
public ModuleTag(){ public ModuleTag(){
@ -15,16 +16,6 @@ public class ModuleTag extends ModuleGeneric {
content.add(new ModuleComment(comment)); content.add(new ModuleComment(comment));
} }
public void setID(String ID) {
this.globalAttributeId = ID;
}
public String getID() {
return globalAttributeId;
}
public void setTag(HtmlTagsEnum tag) { public void setTag(HtmlTagsEnum tag) {
this.tag = tag; this.tag = tag;
} }
@ -32,4 +23,105 @@ public class ModuleTag extends ModuleGeneric {
public HtmlTagsEnum getTag() { public HtmlTagsEnum getTag() {
return tag; 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;
}
} }

View File

@ -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;
}
}