本文整理了Java中com.google.gwt.user.client.ui.ListBox.clear()
方法的一些代码示例,展示了ListBox.clear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListBox.clear()
方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.ListBox
类名称:ListBox
方法名:clear
[英]Removes all items from the list box.
[中]从列表框中删除所有项目。
代码示例来源:origin: kaaproject/kaa
/**
* Set acceptable values.
*
* @param newValues the new values
*/
public void setAcceptableValues(Collection<T> newValues) {
values.clear();
valueKeyToIndex.clear();
ListBox listBox = getListBox();
listBox.clear();
for (T nextNewValue : newValues) {
addValue(nextNewValue);
}
updateListBox();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void setAcceptableValues(Collection<T> newValues) {
values.clear();
valueKeyToIndex.clear();
ListBox listBox = getListBox();
listBox.clear();
for (T nextNewValue : newValues) {
addValue(nextNewValue);
}
updateListBox();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private void setDate(Date date) {
if (getDatePicker().isYearAndMonthDropdownVisible()) {
// setup months dropdown
int month = date.getMonth();
monthSelect.setSelectedIndex(month);
// setup years dropdown
yearSelect.clear();
int year = date.getYear();
int startYear = year - getNoOfYearsToDisplayBefore();
int endYear = year + getNoOfYearsToDisplayAfter();
Date newDate = new Date();
for (int i = startYear; i <= endYear; i++) {
newDate.setYear(i);
yearSelect.addItem(getModel().getYearFormatter().format(newDate));
}
yearSelect.setSelectedIndex(year - startYear);
} else {
grid.setText(0, monthColumn, getModel().formatCurrentMonthAndYear());
}
}
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-git-ext-git
/** {@inheritDoc} */
@Override
public void setLocalBranches(@NotNull List<String> branches) {
this.localBranch.clear();
for (String branch : branches) {
this.localBranch.addItem(branch);
}
}
代码示例来源:origin: io.github.nibiruos.ui/org.nibiru.ui.gwt
@Override
protected void setValue(Iterable<V> value) {
this.value = value;
control.clear();
comboItems.clear();
for (V item : value) {
control.addItem(item.toString());
comboItems.add(item);
}
}
};
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-java-ext-lang-client
@Override
public void setTypes(List<JavaSourceFileType> types) {
sourceFileTypes.clear();
typeField.clear();
sourceFileTypes.addAll(types);
for (JavaSourceFileType type : sourceFileTypes) {
typeField.addItem(type.toString());
}
}
代码示例来源:origin: net.wetheinter/gwt-user
public void setAcceptableValues(Collection<T> newValues) {
values.clear();
valueKeyToIndex.clear();
ListBox listBox = getListBox();
listBox.clear();
for (T nextNewValue : newValues) {
addValue(nextNewValue);
}
updateListBox();
}
代码示例来源:origin: com.ebmwebsourcing.geasytools/model-manager
private void load(final List<T> options){
this.values = options;
this.listBox.clear();
if (options!=null) populateListItem();
if (value!=null) setValue(value, false);
//if we have only one element in the list => setValue
if (options!=null && value==null){
if (options.size()>=1) setValue(options.get(0), true);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void setMachines(List<? extends MachineImpl> machines) {
machinesList.clear();
machinesById.clear();
machines.forEach(
machine -> {
machinesById.put(machine.getName(), machine);
machinesList.addItem(machine.getName());
});
machinesList.setVisibleItemCount(machines.size());
machinesList.setSelectedIndex(0);
}
代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client
@Override
public void setupPatternList(final List<String> patterns) {
patternList.clear();
patternList.setEnabled(true);
patternList.addItem(translate(GuidedDecisionTableErraiConstants.PatternToDeletePageView_Choose));
patterns.forEach(patternList::addItem);
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
public void setBackgroundColorLocaleMap(Map<String, String> localeMap) {
backColors.clear();
backColors.addItem(localeMap.get(CubaRichTextAreaState.RICH_TEXT_AREA_BACKGROUND_LABEL));
backColors.addItem(localeMap.get(CubaRichTextAreaState.RICH_TEXT_AREA_WHITE_LABEL), "white");
backColors.addItem(localeMap.get(CubaRichTextAreaState.RICH_TEXT_AREA_BLACK_LABEL), "black");
backColors.addItem(localeMap.get(CubaRichTextAreaState.RICH_TEXT_AREA_RED_LABEL), "red");
backColors.addItem(localeMap.get(CubaRichTextAreaState.RICH_TEXT_AREA_GREEN_LABEL), "green");
backColors.addItem(localeMap.get(CubaRichTextAreaState.RICH_TEXT_AREA_YELLOW_LABEL), "yellow");
backColors.addItem(localeMap.get(CubaRichTextAreaState.RICH_TEXT_AREA_BLUE_LABEL), "blue");
backColors.setTabIndex(-1);
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void setCommandTypes(List<CommandType> commandTypes) {
typesList.clear();
commandTypesById.clear();
commandTypes.forEach(
commandType -> {
commandTypesById.put(commandType.getId(), commandType);
typesList.addItem(commandType.getDisplayName(), commandType.getId());
});
typesList.setVisibleItemCount(commandTypes.size());
typesList.setSelectedIndex(0);
}
代码示例来源:origin: org.kie.workbench.widgets/kie-wb-common-ui
@Override
public void setItems( final List<Pair<String, String>> items ) {
listItems.clear();
for ( Pair<String, String> item : items ) {
listItems.addItem( item.getK1(),
item.getK2() );
}
}
代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client
@Override
public void setupEmptyPatternList() {
patternList.clear();
patternList.setEnabled(false);
patternList.addItem(translate(GuidedDecisionTableErraiConstants.PatternToDeletePageView_None));
}
代码示例来源:origin: org.eagle-i/eagle-i-datatools-sweet-gwt
/**
* Need to do some additional clean up to really clear the list
*/
public void clear() {
super.clear();
// remove the option group elements
Element elm = getElement();
while (elm.hasChildNodes()) {
elm.removeChild(elm.getFirstChild());
}
groupMap.clear();
}
代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client
@Override
public void setupWorkItemList() {
workItems.clear();
workItems.setEnabled(true);
workItems.addItem(translate(GuidedDecisionTableErraiConstants.WorkItemPageView_Choose),
"");
}
代码示例来源:origin: org.kie.guvnor/guvnor-commons-ui
private void fillDates() {
setVisible( false );
dates.clear();
// Check month
int days = daysInMonth( months.getSelectedIndex() + 1 );
for ( int i = 1; i <= days; i++ ) {
dates.addItem( Integer.toString( i ) );
}
setVisible( true );
}
代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client
@Override
public void loadPluginList(final List<DecisionTableColumnPlugin> plugins) {
pluginsList.clear();
for (final DecisionTableColumnPlugin plugin : plugins) {
pluginsList.addItem(plugin.getTitle(),
plugin.getIdentifier());
}
pluginsList.setVisibleItemCount(pluginsList.getItemCount());
}
代码示例来源:origin: oVirt/ovirt-engine
private void updateBootSequenceItems() {
// Update list box
bootSequenceBox.clear();
bootSequenceBox.setVisibleItemCount(bootSequenceModel.getItems().size());
// Set items
for (EntityModel bootItem : bootSequenceModel.getItems()) {
bootSequenceBox.addItem(bootItem.getTitle());
updateItemAvailability(bootItem.getTitle(), bootItem.getIsChangable());
}
}
代码示例来源:origin: org.kuali.student.core/ks-common-ui
public void redraw(){
String selectedItem = getSelectedItem();
listBox.clear();
if(blankFirstItem){
listBox.addItem(EMPTY_ITEM);
}
for (String id: super.getListItems().getItemIds()){
listBox.addItem(super.getListItems().getItemText(id),id);
}
selectItem(selectedItem);
setInitialized(true);
}
内容来源于网络,如有侵权,请联系作者删除!