本文整理了Java中com.google.gwt.user.client.ui.ListBox.isItemSelected()
方法的一些代码示例,展示了ListBox.isItemSelected()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListBox.isItemSelected()
方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.ListBox
类名称:ListBox
方法名:isItemSelected
[英]Determines whether an individual list item is selected.
[中]确定是否选择单个列表项。
代码示例来源:origin: kaaproject/kaa
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: GwtMaterialDesign/gwt-material
/**
* Determines whether an individual list item is selected.
*
* @param index the index of the item to be tested
* @return <code>true</code> if the item is selected
* @throws IndexOutOfBoundsException if the index is out of range
*/
public boolean isItemSelected(int index) {
return listBox.isItemSelected(index + getIndexOffset());
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material
/**
* Determines whether an individual list item is selected.
*
* @param index the index of the item to be tested
* @return <code>true</code> if the item is selected
* @throws IndexOutOfBoundsException if the index is out of range
*/
public boolean isItemSelected(int index) {
return listBox.isItemSelected(index + getIndexOffset());
}
代码示例来源:origin: salk31/RedQueryBuilder
@Override
public void onChange(ChangeEvent event) {
ListBox lb = getListBox();
Collection<T> newValue = new ArrayList<T>();
for (int i = 0; i < values.size(); i++) {
if (lb.isItemSelected(i)) {
newValue.add(values.get(i));
}
}
setValue(newValue, true);
}
});
代码示例来源:origin: GwtMaterialDesign/gwt-material
/**
* Returns all selected values of the list box, or empty array if none.
*
* @return the selected values of the list box
*/
public String[] getItemsSelected() {
List<String> selected = new LinkedList<>();
for (int i = getIndexOffset(); i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selected.add(listBox.getValue(i));
}
}
return selected.toArray(new String[selected.size()]);
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material
/**
* Returns all selected values of the list box, or empty array if none.
*
* @return the selected values of the list box
*/
public String[] getItemsSelected() {
List<String> selected = new LinkedList<>();
for (int i = getIndexOffset(); i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selected.add(listBox.getValue(i));
}
}
return selected.toArray(new String[selected.size()]);
}
代码示例来源:origin: fr.lteconsulting/hexa.binding.gwt
private void deselectItems() {
for(int i = 0; i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
listBox.setItemSelected(i, false);
}
}
}
代码示例来源:origin: ltearno/hexa.tools
private void deselectItems() {
for(int i = 0; i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
listBox.setItemSelected(i, false);
}
}
}
代码示例来源:origin: sk.seges.acris/acris-binding
private static List<String> getSelectedItemsText(ListBox list) {
assert list != null;
List<String> elements = new ArrayList<String>();
if (list.getSelectedIndex() == -1) {
return elements;
}
for (int i = 0, n = list.getItemCount(); i < n; ++i) {
if (list.isItemSelected(i)) {
elements.add(list.getItemText(i));
}
}
return elements;
}
代码示例来源:origin: sk.seges.acris/acris-binding
private static List<String> getSelectedItemsValue(ListBox list) {
assert list != null;
List<String> elements = new ArrayList<String>();
if (list.getSelectedIndex() == -1) {
return elements;
}
for (int i = 0, n = list.getItemCount(); i < n; ++i) {
if (list.isItemSelected(i)) {
elements.add(list.getValue(i));
}
}
return elements;
}
}
代码示例来源:origin: fr.lteconsulting/hexa.binding.gwt
@Override
public Object getValue() {
if(listBox.isMultipleSelect()) {
List<String> selectedItems = new ArrayList<>();
for (int i = 0; i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selectedItems.add(listBox.getValue(i));
}
}
return selectedItems;
}
else {
return listBox.getSelectedValue();
}
}
代码示例来源:origin: ltearno/hexa.tools
@Override
public Object getValue() {
if(listBox.isMultipleSelect()) {
List<String> selectedItems = new ArrayList<>();
for (int i = 0; i < listBox.getItemCount(); i++) {
if (listBox.isItemSelected(i)) {
selectedItems.add(listBox.getValue(i));
}
}
return selectedItems;
}
else {
return listBox.getSelectedValue();
}
}
代码示例来源:origin: sk.seges.acris/acris-binding
private static List<Object> getSelectedItems(ListBox list) {
assert list != null;
List<Object> elements = new ArrayList<Object>();
if (list.getSelectedIndex() == -1) {
return elements;
}
Object model = list.getElement().getPropertyObject("model");
if (model instanceof ListBindingManager) {
ListBindingManager lbm = (ListBindingManager) model;
for (int i = 0, n = list.getItemCount(); i < n; ++i) {
if (list.isItemSelected(i)) {
elements.add(lbm.getElement(i));
}
}
} else {
for (int i = 0, n = list.getItemCount(); i < n; ++i) {
if (list.isItemSelected(i)) {
elements.add(i);
}
}
}
return elements;
}
代码示例来源:origin: org.eagle-i/eagle-i-search-gwt
@Override
public void onClick(ClickEvent event) {
for (int i = 0 ; i < selectedPanel.getItemCount() ; i++) {
if (selectedPanel.isItemSelected(i)) {
EIURI uri = EIURI.create(selectedPanel.getValue(i));
selectedInstitutions.remove(uri);
}
}
removeButton.setEnabled(false);
if (selectedPanel.getItemCount() == 0) {
removeAllButton.setEnabled(false);
}
show( false );
}
内容来源于网络,如有侵权,请联系作者删除!