All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nasdanika.html.bootstrap.impl.FloatImpl Maven / Gradle / Ivy

There is a newer version: 2024.10.0
Show newest version
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;
	}

}