eu.cedarsoft.utils.springrcp.selection.Selection Maven / Gradle / Ivy
package com.cedarsoft.utils.springrcp.selection;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
/**
* The actual selection
*
* Date: 22.08.2006
* Time: 20:00:27
*
* @author Johannes Schneider -
* Xore Systems
*/
public interface Selection {
/**
* Whether the current selection is empty
*
* @return Wheter the current selection is empty
*/
boolean isEmty();
/**
* Whether a single element is selected
*
* @return true if a single element is selected, false otherwise.
*/
boolean isSingleSelection();
/**
* Whether at least one element is selected
*
* @return Whether at least one element is selected
*/
boolean isMultiSelection();
/**
* Return the selected element.
* This method throws an {@link IllegalStateException} when {@link #isSingleSelection()} does not
* return true.
*
* @return the selected element
*/
@NotNull
T getSingleSelection();
/**
* Returns the selected elements
*
* @return the selected elements
*/
@NotNull
Collection getMultiSelection();
/**
* Returns the type of the selection
*
* @return the type
*/
@NotNull
Class getType();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy