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

net.sf.gluebooster.java.booster.basic.meta.Selectable Maven / Gradle / Ivy

package net.sf.gluebooster.java.booster.basic.meta;

/**
 * Metadata of a selectable object.
 * This class is a kind of decorator (but without implementing and delegating the methods of the original element).
 * @author christian.bauer
 *
 */
public class Selectable 
{

   /**
    * Index or level of the object compared to others
    */
   private int index;
   
   /**
    * Ist the element selected or not
    */
   private boolean selected;
   
   /**
    * The element
    */
   private Element element;
   
   /**
    * The path to the element.
    * May be the href or any other path to the selectable
    */
   private String path;
   
   /**
    * The breadcrumb path to the element.
    * May be the same as the path.
    */
   private String breadcrumb;

   public String getBreadcrumb() {
      return breadcrumb;
   }

   public void setBreadcrumb(String breadcrumb) {
      this.breadcrumb = breadcrumb;
   }

   /**
    * Getter of the index.
    * @return the index of the element
    */
   public int getIndex() {
      return index;
   }

   /**
    * Setter of the index
    * @param index the new index value
    */
   public void setIndex(int index) {
      this.index = index;
   }

   /**
    * Is the element selected?
    * @return the value set by setSelected.
    */
   public boolean isSelected() {
      return selected;
   }

   /**
    * Sets the selection status.
    * @param selected the new value
    */
   public void setSelected(boolean selected) {
      this.selected = selected;
   }

   /**
    * Getter of the element.
    * @return the value set by setElement
    */
   public Element getElement() {
      return element;
   }

   /**
    * Setter of the element
    * @param element the new value
    */
   public void setElement(Element element) {
      this.element = element;
   }
   
   @Override
   public String toString()
   {
      return "Selectable " + index + " is selected " + selected + " element: " + element;
   }

   public String getPath() {
      return path;
   }

   public void setPath(String path) {
      this.path = path;
   }

   
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy