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

net.officefloor.eclipse.configurer.InputBuilder Maven / Gradle / Ivy

/*
 * OfficeFloor - http://www.officefloor.net
 * Copyright (C) 2005-2018 Daniel Sagenschneider
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see .
 */
package net.officefloor.eclipse.configurer;

import java.util.Properties;
import java.util.function.Function;

import javafx.collections.ObservableList;
import net.officefloor.compile.properties.PropertyList;

/**
 * Builder of the inputs.
 * 
 * @author Daniel Sagenschneider
 */
public interface InputBuilder extends ItemBuilder {

	/**
	 * Builds choices in configuration.
	 * 
	 * @param label
	 *            Label for the choices.
	 * @return {@link ChoiceBuilder}.
	 */
	ChoiceBuilder choices(String label);

	/**
	 * Configures a list of items.
	 * 
	 * @param 
	 *            Item type.
	 * @param label
	 *            Label for the items.
	 * @param itemType
	 *            Item type.
	 * @return {@link ListBuilder}.
	 */
	 ListBuilder list(String label, Class itemType);

	/**
	 * Configures multiple items.
	 *
	 * @param 
	 *            Item type.
	 * @param label
	 *            Label for the items.
	 * @param itemType
	 *            Item type.
	 * @return {@link MultipleBuilder}.
	 */
	 MultipleBuilder multiple(String label, Class itemType);

	/**
	 * Configures {@link PropertyList}.
	 * 
	 * @param label
	 *            Label for the {@link Properties}.
	 * @return {@link PropertiesBuilder}.
	 */
	PropertiesBuilder properties(String label);

	/**
	 * Configures a mapping of name to name.
	 * 
	 * @param label
	 *            Label for the mapping.
	 * @param getSources
	 *            {@link Function} to extract the sources.
	 * @param getTargets
	 *            {@link Function} to extract the targets.
	 * @return {@link MappingBuilder}.
	 */
	MappingBuilder map(String label, Function> getSources,
			Function> getTargets);

	/**
	 * Adds a {@link Class} property to be configured.
	 * 
	 * @param label
	 *            Label.
	 * @return {@link ClassBuilder}.
	 */
	ClassBuilder clazz(String label);

	/**
	 * Adds a resource property to be configured.
	 * 
	 * @param label
	 *            Label.
	 * @return {@link ResourceBuilder}.
	 */
	ResourceBuilder resource(String label);

}