本文整理匯總了Java中com.google.gwt.user.client.ui.ListBox.clear方法的典型用法代碼示例。如果您正苦於以下問題:Java ListBox.clear方法的具體用法?Java ListBox.clear怎麽用?Java ListBox.clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.ListBox
的用法示例。
在下文中一共展示了ListBox.clear方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: days
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private void days(ListBox day, int year, int month) {
day.clear();
int lo_year = lo.getYear();
int hi_year = hi.getYear();
int lo_month = lo.getMonthOfYear();
int hi_month = hi.getMonthOfYear();
int start = 1;
int end = maxDays(year, month);
if ( lo_year == year && lo_month == month ) {
start = lo.getDayOfMonth();
end = maxDays(year, month);
}
// If it starts and ends in the same month replace with the day of the high month.
if ( hi_year == year && hi_month == month ) {
end = hi.getDayOfMonth();
}
for ( int i = start; i <= end; i++) {
day.addItem(GeoUtil.format_two(i), GeoUtil.format_two(i));
}
}
示例2: moveAllItems
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private Set<String> moveAllItems(ListBox source, ListBox target) {
final Set<String> movedItems = new HashSet<String>();
int size = source.getItemCount();
for (int i = 0; i < size; i++) {
movedItems.add(source.getValue(i));
final String text = source.getItemText(i);
final String value = source.getValue(i);
target.addItem(text, value);
target.setItemSelected(target.getItemCount() - 1, true);
}
target.setFocus(true);
if (source.getItemCount() > 0) {
target.setSelectedIndex(0);
}
source.clear();
return movedItems;
}
示例3: setRunes
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private void setRunes(Anchor anchor2, ListBox list2, ActiveSkill skill) {
list2.clear();
if (skill != null) {
for (Rune r : skill.getRunes()) {
list2.addItem(r.getLongName(), r.name());
}
} else {
list2.addItem("None", Rune.None.name());
}
list2.setSelectedIndex(0);
setRuneAnchor(skill, anchor2, Rune.None);
}
示例4: populateRunes
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private void populateRunes(ListBox list, ActiveSkill skill) {
list.clear();
if (skill == null) {
list.addItem(Rune.None.getLongName(), Rune.None.name());
} else {
list.addItem(Rune.All_Runes.getLongName(), Rune.All_Runes.name());
if (skill != ActiveSkill.Any) {
for (Rune r : skill.getRunes()) {
list.addItem(r.getLongName(), r.name());
}
}
}
list.setSelectedIndex(0);
}
示例5: minutes
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private void minutes(ListBox mins, int start_minute, int end_minute) {
mins.clear();
for (int min = start_minute; min <= end_minute; min++) {
mins.addItem(GeoUtil.format_two(min), GeoUtil.format_two(min));
}
}
示例6: months
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private void months(ListBox month, int year) {
month.clear();
int lo_year = lo.getYear();
int hi_year = hi.getYear();
int start = 1;
int end = 12;
if ( lo_year == year ) {
start = lo.getMonthOfYear();
}
if ( hi_year == year ) {
end = hi.getMonthOfYear();
}
// DateTime startDate = new DateTime(year, start, 1, 0, 0, DateTimeZone.UTC).withChronology(chrono);
// DateTime endDate = new DateTime(year, end, 1, 0, 0, DateTimeZone.UTC).withChronology(chrono);
DateTime startDate = lo.withYear(year).withMonthOfYear(start).withDayOfMonth(1).withHourOfDay(0).withMinuteOfHour(0);
DateTime endDate = hi.withYear(year).withMonthOfYear(end).withDayOfMonth(1).withHourOfDay(0).withMinuteOfHour(0);
while (startDate.isBefore(endDate.getMillis()) || startDate.equals(endDate)) {
month.addItem(monthFormat.print(startDate.getMillis()));
startDate = startDate.plusMonths(1);
}
}
示例7: years
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private void years(DateTime lo, DateTime hi, ListBox year) {
year.clear();
int start = lo.getYear();
int end = hi.getYear();
for ( int y = start; y <= end; y++ ) {
year.addItem(GeoUtil.format_four(y), GeoUtil.format_four(y));
}
}
示例8: populateListBoxWithValues
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
public void populateListBoxWithValues(ListBox listBox, List<String> values) {
listBox.clear();
if (values != null) {
int index = 0;
for (String value : values) {
listBox.addItem(value);
listBox.getElement().getElementsByTagName(OPTION).getItem(index++).setTitle(value);
}
}
}
示例9: populateListBoxWithValuesMap
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
public void populateListBoxWithValuesMap(ListBox listBox, Map<Integer, String> values) {
listBox.clear();
if (values != null) {
for (Entry<Integer, String> pluginEntry : values.entrySet()) {
listBox.addItem(pluginEntry.getValue(), pluginEntry.getKey().toString());
}
}
}
示例10: populateListBoxWithValues
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
public void populateListBoxWithValues(ListBox listBox, List<String> values) {
listBox.clear();
if (values != null) {
for (String value : values) {
listBox.addItem(value);
}
}
}
示例11: populateListBoxWithValuesMap
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
public void populateListBoxWithValuesMap(ListBox listBox, Map<Integer, String> values) {
listBox.clear();
if (values != null) {
int index = 0;
for (Entry<Integer, String> pluginEntry : values.entrySet()) {
listBox.addItem(pluginEntry.getValue(), pluginEntry.getKey().toString());
listBox.getElement().getElementsByTagName(CustomWorkflowConstants.OPTION).getItem(index++).setTitle(
pluginEntry.getValue());
}
}
}
示例12: setZoomOptions
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
public void setZoomOptions(List<Integer> newZoomOptions) {
ListBox zoomSelection = zoomPanel.selection;
int previousIndex = zoomSelection.getSelectedIndex();
zoomSelection.clear();
for (int i : newZoomOptions) {
zoomSelection.addItem(i + "%");
}
zoomSelection.addItem(DjvuContext.getString("label_fitWidth", "Fit width"));
zoomSelection.addItem(DjvuContext.getString("label_fitPage", "Fit page"));
if (previousIndex >= zoomOptions.size()) {
// either "fit with" or "fit page" was selected
zoomSelection.setSelectedIndex(newZoomOptions.size() + (zoomOptions.size() - previousIndex));
} else {
int zoom = pageLayout != null ? pageLayout.getZoom() : 100;
int newSelected = Arrays.binarySearch(newZoomOptions.toArray(), zoom, Collections.reverseOrder());
if (newSelected >= 0) {
zoomSelection.setSelectedIndex(Math.min(newSelected, newZoomOptions.size() - 1));
zoomOptions = newZoomOptions;
zoomSelectionChanged();
} else {
zoomSelection.setSelectedIndex(-1);
zoomOptions = newZoomOptions;
}
}
zoomPanel.updateButtons();
}
示例13: setPageCount
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
public void setPageCount(int pagesCount) {
this.pagesCount = pagesCount;
ListBox pageSelection = pagePanel.selection;
pageSelection.clear();
for (int i = 1; i <= pagesCount; i++) {
pageSelection.addItem(i + "");
}
pagePanel.updateButtons();
}
示例14: populateSkills
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
private void populateSkills(int i) {
ListBox list = skills[i];
list.clear();
list.addItem(ActiveSkill.Any.getLongName(), ActiveSkill.Any.name());
list.addItem("None", "");
for (ActiveSkill a : spenders)
list.addItem(a.getLongName(), a.name());
list.setSelectedIndex(0);
}
示例15: populateComboBox
import com.google.gwt.user.client.ui.ListBox; //導入方法依賴的package包/類
public static void populateComboBox(ListBox box, EnumFieldDef cols) {
box.clear();
for (EnumFieldDef.Item item : cols.getEnumValues()) {
box.addItem(item.getTitle(), item.getName());
}
}