|
16 | 16 | */
|
17 | 17 | package com.jwebmp.core;
|
18 | 18 |
|
| 19 | +import com.guicedee.services.jsonrepresentation.json.StaticStrings; |
19 | 20 | import com.jwebmp.core.base.html.attributes.NoAttributes;
|
20 | 21 | import com.jwebmp.core.base.html.interfaces.GlobalChildren;
|
21 | 22 | import com.jwebmp.core.base.html.interfaces.GlobalFeatures;
|
22 | 23 | import com.jwebmp.core.base.html.interfaces.events.GlobalEvents;
|
23 |
| -import com.jwebmp.core.base.interfaces.IComponentHierarchyBase; |
24 | 24 | import com.jwebmp.core.base.servlets.enumarations.ComponentTypes;
|
25 |
| -import com.guicedee.services.jsonrepresentation.json.StaticStrings; |
26 |
| - |
| 25 | +import com.jwebmp.core.base.servlets.interfaces.ICSSComponent; |
27 | 26 | import jakarta.validation.constraints.NotNull;
|
28 | 27 |
|
29 | 28 | /**
|
30 | 29 | * Extention of a component with no HTML. Renders the ID and all references to it as a class name instead of ID form
|
31 | 30 | * <p>
|
32 | 31 | *
|
33 | 32 | * @param <J>
|
34 |
| - * |
35 | 33 | * @author GedMarc
|
36 | 34 | * @since 2015/04/24
|
37 | 35 | */
|
38 | 36 | public class CSSComponent<J extends CSSComponent<J>>
|
39 |
| - extends Component<GlobalChildren, NoAttributes, GlobalFeatures, GlobalEvents, J> |
40 |
| - implements GlobalChildren |
| 37 | + extends Component<GlobalChildren, NoAttributes, GlobalFeatures, GlobalEvents, J> |
| 38 | + implements GlobalChildren, ICSSComponent |
41 | 39 | {
|
42 |
| - /** |
43 |
| - * Constructs a new CSS Class with the given features and events associated |
44 |
| - * <p> |
45 |
| - * |
46 |
| - * @param className |
47 |
| - */ |
48 |
| - public CSSComponent(String className) |
49 |
| - { |
50 |
| - super(ComponentTypes.CSSClass); |
51 |
| - setID(className); |
52 |
| - } |
| 40 | + /** |
| 41 | + * Constructs a new CSS Class with the given features and events associated |
| 42 | + * <p> |
| 43 | + * |
| 44 | + * @param className |
| 45 | + */ |
| 46 | + public CSSComponent(String className) |
| 47 | + { |
| 48 | + super(ComponentTypes.CSSClass); |
| 49 | + setID(className); |
| 50 | + } |
53 | 51 |
|
54 |
| - /** |
55 |
| - * CSS Components don't render any HTML |
56 |
| - * |
57 |
| - * @param tabCount |
58 |
| - * |
59 |
| - * @return |
60 |
| - */ |
61 |
| - @Override |
62 |
| - @NotNull |
63 |
| - protected StringBuilder renderHTML(int tabCount) |
64 |
| - { |
65 |
| - return new StringBuilder(); |
66 |
| - } |
| 52 | + /** |
| 53 | + * CSS Components don't render any HTML |
| 54 | + * |
| 55 | + * @param tabCount |
| 56 | + * @return |
| 57 | + */ |
| 58 | + @Override |
| 59 | + @NotNull |
| 60 | + protected StringBuilder renderHTML(int tabCount) |
| 61 | + { |
| 62 | + return new StringBuilder(); |
| 63 | + } |
67 | 64 |
|
68 |
| - /** |
69 |
| - * Returns the component rendering for JQuery string Requires the rendering for component is set |
70 |
| - * <p> |
71 |
| - * |
72 |
| - * @return $(' # x '). |
73 |
| - */ |
74 |
| - @NotNull |
75 |
| - @Override |
76 |
| - public String getJQueryID() |
77 |
| - { |
78 |
| - return "$(\'" + getID(true) + "\')."; |
79 |
| - } |
| 65 | + /** |
| 66 | + * Returns the component rendering for JQuery string Requires the rendering for component is set |
| 67 | + * <p> |
| 68 | + * |
| 69 | + * @return $(' # x '). |
| 70 | + */ |
| 71 | + @NotNull |
| 72 | + @Override |
| 73 | + public String getJQueryID() |
| 74 | + { |
| 75 | + return "$(\'" + getID(true) + "\')."; |
| 76 | + } |
80 | 77 |
|
81 |
| - /** |
82 |
| - * Returns the ID with the . in the front of it |
83 |
| - * <p> |
84 |
| - * |
85 |
| - * @param jQueryHolder |
86 |
| - * Anything |
87 |
| - * <p> |
88 |
| - * |
89 |
| - * @return An ID starting with . |
90 |
| - */ |
91 |
| - @NotNull |
92 |
| - @Override |
93 |
| - public String getID(boolean jQueryHolder) |
94 |
| - { |
95 |
| - return StaticStrings.STRING_DOT + getID(); |
96 |
| - } |
| 78 | + /** |
| 79 | + * Returns the ID with the . in the front of it |
| 80 | + * <p> |
| 81 | + * |
| 82 | + * @param jQueryHolder Anything |
| 83 | + * <p> |
| 84 | + * @return An ID starting with . |
| 85 | + */ |
| 86 | + @NotNull |
| 87 | + @Override |
| 88 | + public String getID(boolean jQueryHolder) |
| 89 | + { |
| 90 | + return StaticStrings.STRING_DOT + getID(); |
| 91 | + } |
97 | 92 |
|
98 |
| - /** |
99 |
| - * Replaces the # with a . |
100 |
| - * |
101 |
| - * @return |
102 |
| - */ |
103 |
| - @NotNull |
104 |
| - @Override |
105 |
| - public String getID() |
106 |
| - { |
107 |
| - return super.getID() |
108 |
| - .replace(StaticStrings.CHAR_HASH, StaticStrings.CHAR_DOT); |
109 |
| - } |
| 93 | + /** |
| 94 | + * Replaces the # with a . |
| 95 | + * |
| 96 | + * @return |
| 97 | + */ |
| 98 | + @NotNull |
| 99 | + @Override |
| 100 | + public String getID() |
| 101 | + { |
| 102 | + return super.getID() |
| 103 | + .replace(StaticStrings.CHAR_HASH, StaticStrings.CHAR_DOT); |
| 104 | + } |
110 | 105 |
|
111 | 106 | }
|
0 commit comments