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

org.wicketstuff.datatables.options.SelectOptions Maven / Gradle / Ivy

There is a newer version: 10.3.0
Show newest version
package org.wicketstuff.datatables.options;

import de.agilecoders.wicket.jquery.AbstractConfig;
import de.agilecoders.wicket.jquery.IKey;
import de.agilecoders.wicket.jquery.Key;

import java.util.Locale;

/**
 * https://datatables.net/extensions/select
 */
public class SelectOptions extends AbstractConfig {

	public enum Style {
		Api,
		Single,
		Multi,
		OS
	}

	public enum Items {
		Row,
		Column,
		Cell
	}

	/**
	 * https://datatables.net/reference/option/select.style
	 */
	private static final IKey _Style = new Key<>("style", null);

	/**
	 * https://datatables.net/reference/option/select.items
	 */
	private static final IKey _Items = new Key<>("items", Items.Row.name().toLowerCase(Locale.ENGLISH));

	/**
	 * https://datatables.net/reference/option/select.blurable
	 */
	private static final IKey Blurable = new Key<>("blurable", false);

	/**
	 * https://datatables.net/reference/option/select.selector
	 */
	private static final IKey Selector = new Key<>("selector", "th, td");

	/**
	 * https://datatables.net/reference/option/scroller.serverWait
	 * https://datatables.net/extensions/scroller/examples/initialisation/server-side_processing.html
	 */
	private static final IKey ServerWait = new Key<>("serverWait", 200);

	public SelectOptions style(Style style) {
		put(_Style, style.name().toLowerCase(Locale.ENGLISH));
		return this;
	}

	public SelectOptions blurable(boolean blurable) {
		put(Blurable, blurable);
		return this;
	}

	public SelectOptions items(Items items) {
		put(_Items, items.name().toLowerCase(Locale.ENGLISH));
		return this;
	}

	public SelectOptions selector(String selector) {
		put(Selector, selector);
		return this;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy