com.google.gwt.user.client.ui.ListBox.addChangeHandler()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(197)

本文整理了Java中com.google.gwt.user.client.ui.ListBox.addChangeHandler()方法的一些代码示例,展示了ListBox.addChangeHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListBox.addChangeHandler()方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.ListBox
类名称:ListBox
方法名:addChangeHandler

ListBox.addChangeHandler介绍

暂无

代码示例

代码示例来源:origin: kaaproject/kaa

/**
 * Instantiates a new MultiValueListBox.
 */
public MultiValueListBox(Renderer<T> renderer, ProvidesKey<T> keyProvider) {
 this.keyProvider = keyProvider;
 this.renderer = renderer;
 ListBox listBox = new ListBox();
 listBox.setMultipleSelect(true);
 initWidget(listBox);
 getListBox().addChangeHandler(new ChangeHandler() {
  public void onChange(ChangeEvent event) {
   List<T> newValue = new ArrayList<>();
   for (int i = 0; i < values.size(); i++) {
    if (getListBox().isItemSelected(i)) {
     newValue.add(values.get(i));
    }
   }
   setValue(newValue, true);
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

private ListBox createYearSelect() {
 final ListBox yearListBox = new ListBox();
 yearListBox.addChangeHandler(new ChangeHandler() {
  @Override
  public void onChange(ChangeEvent event) {
   int deltaYears = yearListBox.getSelectedIndex() - getNoOfYearsToDisplayBefore();
   addMonths(deltaYears * CalendarModel.MONTHS_IN_YEAR);
  }
 });
 return yearListBox;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

public ValueListBox(Renderer<? super T> renderer, ProvidesKey<T> keyProvider) {
 this.keyProvider = keyProvider;
 this.renderer = renderer;
 initWidget(new ListBox());
 getListBox().addChangeHandler(new ChangeHandler() {
  public void onChange(ChangeEvent event) {
   int selectedIndex = getListBox().getSelectedIndex();
   if (selectedIndex < 0) {
    return; // Not sure why this happens during addValue
   }
   T newValue = values.get(selectedIndex);
   setValue(newValue, true);
  }
 });
}

代码示例来源:origin: com.google.gwt/gwt-servlet

private ListBox createMonthSelect() {
 final ListBox monthListBox = new ListBox();
 for (int i = 0; i < CalendarModel.MONTHS_IN_YEAR; i++) {
  monthListBox.addItem(getModel().formatMonth(i));
 }
 monthListBox.addChangeHandler(new ChangeHandler() {
  @Override
  public void onChange(ChangeEvent event) {
   int previousMonth = getModel().getCurrentMonth().getMonth();
   int newMonth = monthListBox.getSelectedIndex();
   int delta = newMonth - previousMonth;
   addMonths(delta);
  }
 });
 return monthListBox;
}

代码示例来源:origin: fr.lteconsulting/hexa.binding.gwt

@Override
public Object registerPropertyChanged(final Action2<PropertyAdapter, Object> callback, final Object cookie) {
  return listBox.addChangeHandler(new ChangeHandler() {
    @Override
    public void onChange(ChangeEvent event) {
      callback.exec(ListBoxPropertyAdapter.this, cookie);
    }
  });
}

代码示例来源:origin: fr.lteconsulting/hexa.core

@Override
  protected void installRealHandler( Widget widget )
  {
    ((ListBox) widget).addChangeHandler( new com.google.gwt.event.dom.client.ChangeHandler()
    {
      public void onChange( ChangeEvent event )
      {
        signalChange( (ListBox) event.getSource() );
      }
    } );
  }
}

代码示例来源:origin: jqm4gwt/jqm4gwt

@Override
public HandlerRegistration addChangeHandler(ChangeHandler handler) {
  // May be it makes sense to create wrapper over passed handler to make ChangeEvent and
  // ValueChangeEvent to work the same way (currently inSetValue doesn't affect ChangeEvent).
  return select.addChangeHandler(handler);
}

代码示例来源:origin: ltearno/hexa.tools

@Override
public Object registerPropertyChanged(final Action2<PropertyAdapter, Object> callback, final Object cookie) {
  return listBox.addChangeHandler(new ChangeHandler() {
    @Override
    public void onChange(ChangeEvent event) {
      callback.exec(ListBoxPropertyAdapter.this, cookie);
    }
  });
}

代码示例来源:origin: ltearno/hexa.tools

@Override
  protected void installRealHandler( Widget widget )
  {
    ((ListBox) widget).addChangeHandler( new com.google.gwt.event.dom.client.ChangeHandler()
    {
      public void onChange( ChangeEvent event )
      {
        signalChange( (ListBox) event.getSource() );
      }
    } );
  }
}

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-library

@Override
public HandlerRegistration addChangeHandler(ChangeHandler handler) {
  // May be it makes sense to create wrapper over passed handler to make ChangeEvent and
  // ValueChangeEvent to work the same way (currently inSetValue doesn't affect ChangeEvent).
  return select.addChangeHandler(handler);
}

代码示例来源:origin: com.sksamuel.jqm4gwt/jqm4gwt-standalone

@Override
public HandlerRegistration addChangeHandler(ChangeHandler handler) {
  // May be it makes sense to create wrapper over passed handler to make ChangeEvent and
  // ValueChangeEvent to work the same way (currently inSetValue doesn't affect ChangeEvent).
  return select.addChangeHandler(handler);
}

代码示例来源:origin: org.jvnet.hudson.main/maven3-plugin

protected void onLoad()
{
  statePicker.addChangeHandler( new ChangeHandler()
  {
    public void onChange( ChangeEvent event )
    {
      presenter.buildStateSelected( statePicker.getSelectedIndex() );
    }
  });
}

代码示例来源:origin: net.wetheinter/gwt-user

private ListBox createYearSelect() {
 final ListBox yearListBox = new ListBox();
 yearListBox.addChangeHandler(new ChangeHandler() {
  @Override
  public void onChange(ChangeEvent event) {
   int deltaYears = yearListBox.getSelectedIndex() - getNoOfYearsToDisplayBefore();
   addMonths(deltaYears * CalendarModel.MONTHS_IN_YEAR);
  }
 });
 return yearListBox;
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

private ListBox createYearSelect() {
 final ListBox yearListBox = new ListBox();
 yearListBox.addChangeHandler(new ChangeHandler() {
  @Override
  public void onChange(ChangeEvent event) {
   int deltaYears = yearListBox.getSelectedIndex() - getNoOfYearsToDisplayBefore();
   addMonths(deltaYears * CalendarModel.MONTHS_IN_YEAR);
  }
 });
 return yearListBox;
}

代码示例来源:origin: fr.lteconsulting/hexa.core

public ListBoxEx()
{
  initWidget( listBox );
  listBox.addChangeHandler( this );
}

代码示例来源:origin: ltearno/hexa.tools

public ListBoxEx()
{
  initWidget( listBox );
  listBox.addChangeHandler( this );
}

代码示例来源:origin: org.dashbuilder/dashbuilder-displayer-client

@Override
public void init(final RendererSelector presenter) {
  this.presenter = presenter;
  initWidget(uiBinder.createAndBindUi(this));
  listBox.addChangeHandler(new ChangeHandler() {
    public void onChange(ChangeEvent event) {
      presenter.onRendererSelected();
    }
  });
}

代码示例来源:origin: org.kuali.student.core/ks-common-ui

protected void init() {
  listBox = new ListBox(false);
  this.initWidget(listBox);
  setupDefaultStyle();
  listBox.addChangeHandler(new ChangeHandler(){
    public void onChange(ChangeEvent event) {
      fireChangeEvent(true);
    }
  });
}

代码示例来源:origin: org.vaadin.addons/aceeditor

private void createChoiceList() {
  choiceList = new ListBox();
  choiceList.setStyleName("list");
  choiceList.addKeyDownHandler(this);
  choiceList.addDoubleClickHandler(this);
  choiceList.addChangeHandler(this);
  choiceList.setStylePrimaryName("aceeditor-suggestpopup-list");
  setWidget(choiceList);
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

protected void createChoiceList() {
  choiceList = new ListBox();
  choiceList.setStyleName("list");
  choiceList.addKeyDownHandler(this);
  choiceList.addDoubleClickHandler(this);
  choiceList.addChangeHandler(this);
  choiceList.setStylePrimaryName("aceeditor-suggestpopup-list");
  setWidget(choiceList);
}

相关文章