Skip to content

Commit 9587e48

Browse files
committed
Web Awesome Pro - Page Component
1 parent 119518c commit 9587e48

File tree

10 files changed

+413
-499
lines changed

10 files changed

+413
-499
lines changed

src/main/java/com/jwebmp/core/Page.java

Lines changed: 86 additions & 151 deletions
Large diffs are not rendered by default.

src/main/java/com/jwebmp/core/base/ComponentHTMLAttributeBase.java

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@
5151
* @since 23 Apr 2016
5252
*/
5353
@Log
54-
public class ComponentHTMLAttributeBase<A extends Enum<?> & AttributeDefinitions, F extends GlobalFeatures, E extends GlobalEvents, J extends ComponentHTMLAttributeBase<A, F, E, J>> extends
55-
ComponentHTMLOptionsBase<F, E, J> implements
56-
IComponentHTMLAttributeBase<A, J>
54+
public class ComponentHTMLAttributeBase<A extends Enum<?> & AttributeDefinitions,
55+
F extends GlobalFeatures, E extends GlobalEvents, J extends ComponentHTMLAttributeBase<A, F, E, J>>
56+
extends ComponentHTMLOptionsBase<F, E, J>
57+
implements IComponentHTMLAttributeBase<A, J>
5758
{
5859
/**
5960
* The current stored attribute lists
@@ -122,9 +123,9 @@ protected StringBuilder renderAttributes(@NotNull StringBuilder sb)
122123
String property = e.getKey();
123124
String v = e.getValue();
124125
stylesString.append(property)
125-
.append(StaticStrings.STRING_DOUBLE_COLON)
126-
.append(v)
127-
.append(StaticStrings.STRING_SEMICOLON);
126+
.append(StaticStrings.STRING_DOUBLE_COLON)
127+
.append(v)
128+
.append(StaticStrings.STRING_SEMICOLON);
128129
}
129130

130131
if (!getStyles().isEmpty())
@@ -148,8 +149,7 @@ protected StringBuilder renderAttributes(@NotNull StringBuilder sb)
148149
if (isInvertColonRender())
149150
{
150151
value = value.replaceAll(StaticStrings.STRING_SINGLE_QUOTES, StaticStrings.STRING_DOUBLE_QUOTES);
151-
}
152-
else
152+
} else
153153
{
154154
value = value.replaceAll(StaticStrings.STRING_DOUBLE_QUOTES, StaticStrings.STRING_SINGLE_QUOTES);
155155
}
@@ -159,30 +159,28 @@ protected StringBuilder renderAttributes(@NotNull StringBuilder sb)
159159
if (isInvertColonRender())
160160
{
161161
sb.append(key)
162-
.append(StaticStrings.STRING_EQUALS_SINGLE_QUOTES)
163-
.append(value)
164-
.append(StaticStrings.STRING_SINGLE_QUOTES_SPACE);
165-
}
166-
else
162+
.append(StaticStrings.STRING_EQUALS_SINGLE_QUOTES)
163+
.append(value)
164+
.append(StaticStrings.STRING_SINGLE_QUOTES_SPACE);
165+
} else
167166
{
168167
sb.append(key)
169-
.append(StaticStrings.STRING_EQUALS_DOUBLE_QUOTES)
170-
.append(value)
171-
.append(StaticStrings.STRING_DOUBLE_QUOTES_SPACE);
168+
.append(StaticStrings.STRING_EQUALS_DOUBLE_QUOTES)
169+
.append(value)
170+
.append(StaticStrings.STRING_DOUBLE_QUOTES_SPACE);
172171
}
173-
}
174-
else
172+
} else
175173
{
176174
sb.append(key)
177-
.append(StaticStrings.STRING_SPACE);
175+
.append(StaticStrings.STRING_SPACE);
178176
}
179177
}
180178
if (!getAttributes().isEmpty())
181179
{
182180
sb.deleteCharAt(sb.lastIndexOf(StaticStrings.STRING_SPACE));
183181
}
184182
sb = new StringBuilder(sb.toString()
185-
.toLowerCase());
183+
.toLowerCase());
186184
return sb;
187185
}
188186

@@ -197,8 +195,7 @@ protected void preConfigure()
197195
if (isRenderIDAttibute())
198196
{
199197
addAttribute(GlobalAttributes.ID, getID());
200-
}
201-
else
198+
} else
202199
{
203200
removeAttribute(GlobalAttributes.ID);
204201
}
@@ -218,8 +215,7 @@ public boolean isRenderIDAttibute()
218215
if (!renderIDAttibute || NoIDTag.class.isAssignableFrom(getClass()))
219216
{
220217
return false;
221-
}
222-
else
218+
} else
223219
{
224220
return renderIDAttibute;
225221
}
@@ -442,8 +438,7 @@ public final Integer getAttribute(@NotNull GlobalAttributes attribute, @NotNull
442438
try
443439
{
444440
return Integer.parseInt(getAttributes().get(attribute.toString()));
445-
}
446-
catch (NumberFormatException | NullPointerException nfe)
441+
} catch (NumberFormatException | NullPointerException nfe)
447442
{
448443
ComponentHTMLAttributeBase.log.log(Level.FINE, "Invalid Global Attribute Reference [" + getClass().getSimpleName() + "] - [" + attribute + "]. Ignoring.", nfe);
449444
return bop;
@@ -626,8 +621,7 @@ public J setID(String id)
626621
{
627622
removeAttribute(GlobalAttributes.ID);
628623
setRenderIDAttribute(false);
629-
}
630-
else
624+
} else
631625
{
632626
addAttribute(GlobalAttributes.ID, id);
633627
setRenderIDAttribute(true);
@@ -767,8 +761,7 @@ public J setName(String name)
767761
if (!Strings.isNullOrEmpty(name))
768762
{
769763
addAttribute("name", name);
770-
}
771-
else
764+
} else
772765
{
773766
removeAttribute("name");
774767
}

src/main/java/com/jwebmp/core/base/html/Body.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,19 @@
1717
package com.jwebmp.core.base.html;
1818

1919
import com.jwebmp.core.Component;
20-
import com.jwebmp.core.Page;
2120
import com.jwebmp.core.base.html.attributes.BodyAttributes;
2221
import com.jwebmp.core.base.html.interfaces.ContainerType;
23-
import com.jwebmp.core.base.html.interfaces.GlobalFeatures;
2422
import com.jwebmp.core.base.html.interfaces.LayoutHandler;
2523
import com.jwebmp.core.base.html.interfaces.children.BodyChildren;
2624
import com.jwebmp.core.base.html.interfaces.children.BodyFeatures;
2725
import com.jwebmp.core.base.html.interfaces.children.HtmlChildren;
2826
import com.jwebmp.core.base.html.interfaces.children.PageChildren;
2927
import com.jwebmp.core.base.html.interfaces.events.BodyEvents;
30-
import com.jwebmp.core.base.html.interfaces.events.NoEvents;
3128
import com.jwebmp.core.base.servlets.enumarations.ComponentTypes;
29+
import com.jwebmp.core.services.IBody;
3230
import com.jwebmp.core.services.IPage;
3331
import jakarta.validation.constraints.NotNull;
3432

35-
import java.util.Objects;
36-
3733
/**
3834
* Browser Support<p>
3935
* <p>
@@ -65,7 +61,7 @@
6561
*/
6662
public class Body<F extends BodyFeatures, J extends Body<F, J>>
6763
extends Component<BodyChildren, BodyAttributes, F, BodyEvents, J>
68-
implements PageChildren, HtmlChildren, LayoutHandler, ContainerType {
64+
implements PageChildren, HtmlChildren, LayoutHandler, ContainerType, IBody<F, J> {
6965

7066
/**
7167
* If this body has rendered the scripts on itself
@@ -93,9 +89,9 @@ public Body(IPage<?> page) {
9389

9490
}
9591

96-
@NotNull
9792
@SuppressWarnings("unchecked")
98-
public J setFullScreen() {
93+
@Override
94+
public @NotNull J setFullScreen() {
9995
addStyle("width:100%;height:100%;margin:0px;");
10096
getPage().addStyle("width:100%;height:100%;margin:0px;");
10197
return (J) this;
@@ -106,7 +102,8 @@ public J setFullScreen() {
106102
*
107103
* @return
108104
*/
109-
protected boolean isRenderedScripts() {
105+
@Override
106+
public boolean isRenderedScripts() {
110107
return renderedScripts;
111108
}
112109

@@ -116,8 +113,9 @@ protected boolean isRenderedScripts() {
116113
* @param renderedScripts
117114
* @return
118115
*/
119-
protected Body<?, ?> setRenderedScripts(boolean renderedScripts) {
116+
@Override
117+
public J setRenderedScripts(boolean renderedScripts) {
120118
this.renderedScripts = renderedScripts;
121-
return this;
119+
return (J) this;
122120
}
123121
}

src/main/java/com/jwebmp/core/base/html/Head.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,15 @@
1818

1919
import com.jwebmp.core.base.ComponentHierarchyBase;
2020
import com.jwebmp.core.base.html.attributes.NoAttributes;
21-
import com.jwebmp.core.base.html.interfaces.GlobalChildren;
2221
import com.jwebmp.core.base.html.interfaces.NoClassAttribute;
2322
import com.jwebmp.core.base.html.interfaces.NoFeatures;
2423
import com.jwebmp.core.base.html.interfaces.NoIDTag;
2524
import com.jwebmp.core.base.html.interfaces.children.HeadChildren;
2625
import com.jwebmp.core.base.html.interfaces.children.HtmlChildren;
2726
import com.jwebmp.core.base.html.interfaces.children.PageChildren;
2827
import com.jwebmp.core.base.html.interfaces.events.NoEvents;
29-
import com.jwebmp.core.base.interfaces.IComponentHierarchyBase;
3028
import com.jwebmp.core.base.servlets.enumarations.ComponentTypes;
31-
32-
import java.util.TreeSet;
29+
import com.jwebmp.core.services.IHead;
3330

3431
/**
3532
* The head tag for HTML
@@ -77,13 +74,11 @@
7774
*/
7875
public class Head<J extends Head<J>>
7976
extends ComponentHierarchyBase<HeadChildren, NoAttributes, NoFeatures, NoEvents, J>
80-
implements NoIDTag, HtmlChildren, NoClassAttribute, PageChildren
81-
{
77+
implements NoIDTag, HtmlChildren, NoClassAttribute, PageChildren, IHead {
8278
/**
8379
* Constructs a new Head Tag
8480
*/
85-
public Head()
86-
{
81+
public Head() {
8782
super(ComponentTypes.Head);
8883
}
8984
}

0 commit comments

Comments
 (0)