org.nasdanika.html.bootstrap.impl.FloatImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bootstrap Show documentation
Show all versions of bootstrap Show documentation
Classes for generating Bootstrap UI.
package org.nasdanika.html.bootstrap.impl;
import org.nasdanika.html.bootstrap.BootstrapElement;
import org.nasdanika.html.bootstrap.Breakpoint;
import org.nasdanika.html.bootstrap.Float;
public class FloatImpl> implements org.nasdanika.html.bootstrap.Float {
private B bootstrapElement;
public FloatImpl(B bootstrapElement) {
this.bootstrapElement = bootstrapElement;
}
@Override
public B toBootstrapElement() {
return bootstrapElement;
}
@Override
public Float right() {
bootstrapElement.toHTMLElement().addClass("float-right");
return this;
}
@Override
public Float right(Breakpoint breakpoint) {
if (breakpoint == Breakpoint.DEFAULT) {
return right();
}
bootstrapElement.toHTMLElement().addClass("float-"+breakpoint.code+"-right");
return this;
}
@Override
public Float left() {
bootstrapElement.toHTMLElement().addClass("float-left");
return this;
}
@Override
public Float left(Breakpoint breakpoint) {
if (breakpoint == Breakpoint.DEFAULT) {
return left();
}
bootstrapElement.toHTMLElement().addClass("float-"+breakpoint.code+"-left");
return this;
}
@Override
public Float none() {
bootstrapElement.toHTMLElement().addClass("float-none");
return this;
}
@Override
public Float none(Breakpoint breakpoint) {
if (breakpoint == Breakpoint.DEFAULT) {
return none();
}
bootstrapElement.toHTMLElement().addClass("float-"+breakpoint.code+"-none");
return this;
}
}