src/main/java/com/spinyowl/legui/component/SelectBox.java
public void addElement(T element) {
    lock.lock();
    try {
      if (!elements.contains(element)) {

        SelectBoxElement<T> boxElement = createSelectBoxElement(element);
        if (elements.isEmpty()) {
          selectedElement = element;
          selectionButton.getTextState().setText(element == null ? NULL : element.toString());
        }
        elements.add(element);
        selectBoxElements.add(boxElement);
        selectionListPanel.getContainer().add(boxElement);
        selectionListPanel.getContainer().getSize().y = selectBoxElements.size() * elementHeight;
      }
    } finally {
      lock.unlock();
    }
  }
/**
   * Used to add element to selectbox.
   *
   * @param element element to add.
   */
Used to add element to selectbox.
@param element element to add.
Used to add element to selectbox . @param element element to add .
public void addElement(T element) {
    lock.lock();
    try {
      if (!elements.contains(element)) {
        SelectBoxElement<T> boxElement = createSelectBoxElement(element);
        if (elements.isEmpty()) {
          selectedElement = element;
          selectionButton.getTextState().setText(element == null ? NULL : element.toString());
        }
        elements.add(element);
        selectBoxElements.add(boxElement);
        selectionListPanel.getContainer().add(boxElement);
        selectionListPanel.getContainer().getSize().y = selectBoxElements.size() * elementHeight;
      }
    } finally {
      lock.unlock();
    }
  }
public void addElement ( T element ) { lock . lock ( ) ; try { if ( ! elements . contains ( element ) ) { SelectBoxElement < T > boxElement = createSelectBoxElement ( element ) ; if ( elements . isEmpty ( ) ) { selectedElement = element ; selectionButton . getTextState ( ) . setText ( element == null ? NULL : element . toString ( ) ) ; } elements . add ( element ) ; selectBoxElements . add ( boxElement ) ; selectionListPanel . getContainer ( ) . add ( boxElement ) ; selectionListPanel . getContainer ( ) . getSize ( ) . y = selectBoxElements . size ( ) * elementHeight ; } } finally { lock . unlock ( ) ; } }
Used to add element to selectbox.
Used to add element to selectbox .