Package de.lessvoid.nifty.controls.listbox

Examples of de.lessvoid.nifty.controls.listbox.ListBoxControl


    Element panel = getElement().findElementByName("#panel");
    panel.setConstraintX(new SizeValue(dropDownControl.getElement().getX() + "px"));
    panel.setConstraintWidth(new SizeValue(dropDownControl.getWidth() + "px"));
    getElement().layoutElements();

    ListBoxControl listBox = getElement().findNiftyControl("#listBox", ListBoxControl.class);
    listBox.ensureWidthConstraints();

    panel.setConstraintHeight(new SizeValue(listBox.getHeight() + "px"));

    if ((dropDownControl.getElement().getY() + listBox.getHeight()) > nifty.getRenderEngine().getHeight()) {
      panel.setConstraintY(new SizeValue(dropDownControl.getElement().getY() - listBox.getHeight() + "px"));
      updateMoveEffect(listBox, 1);
    } else {
      panel.setConstraintY(new SizeValue(dropDownControl.getElement().getY() + dropDownControl.getHeight() + "px"));
      updateMoveEffect(listBox, -1);
    }
View Full Code Here


  @SuppressWarnings("unchecked")
  @Override
  public void onEvent(final String topic, final ListBoxSelectionChangedEvent data) {
    final Object selectedItem = getSelectedItem(data.getSelection());

    ListBoxControl listBoxControl = (ListBoxControl) listBox;
    listBoxControl.getViewConverter().display(dropDown.getElement().findElementByName("#text"), selectedItem);

    final int selectedItemIndex = getSelectedIndex(data);
    if (screen.isActivePopup(popupInstance)) {
      dropDown.getElement().getControl(DropDownControl.class).close(new EndNotify() {
        @Override
View Full Code Here

  @SuppressWarnings("rawtypes")
  public void onStartScreen() {
    updateEnabled();

    ListBoxControl listBoxControl = (ListBoxControl) listBox;
    listBoxControl.getViewConverter().display(getElement().findElementByName("#text"), getSelection());

    nifty.subscribe(screen, listBox.getId(), ListBoxSelectionChangedEvent.class,
        new DropDownListBoxSelectionChangedEventSubscriber(nifty, screen, listBox, this, popup));
  }
View Full Code Here

TOP

Related Classes of de.lessvoid.nifty.controls.listbox.ListBoxControl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.