Java Code Examples for com.google.gwt.user.client.ui.ListBox

The following are top voted examples for showing how to use com.google.gwt.user.client.ui.ListBox. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: unitimes   File: CourseNumbersSuggestBox.java   Source Code and License 6 votes vote down vote up
private String getConfiguration() {
	String conf = iConfiguration;
	for (MatchResult matcher = iRegExp.exec(conf); matcher != null; matcher = iRegExp.exec(conf)) {
		Element element = DOM.getElementById(matcher.getGroup(1));
		String value = "";
		if ("select".equalsIgnoreCase(element.getTagName())) {
			ListBox list = ListBox.wrap(element);
			for (int i = 0; i < list.getItemCount(); i++) {
				if (list.isItemSelected(i))
					value += (value.isEmpty() ? "" : ",") + list.getValue(i);
			}
		} else if ("input".equalsIgnoreCase(element.getTagName())) {
			TextBox text = TextBox.wrap(element);
			value = text.getText();
		} else {
			Hidden hidden = Hidden.wrap(element);
			value = hidden.getValue();
		}
		conf = conf.replace("${" + matcher.getGroup(1) + "}", value);
	}
	return conf;
}
 
Example 2
Project: LAS   File: ComparisonAxisSelector.java   Source Code and License 6 votes vote down vote up
public ComparisonAxisSelector(String width) {
        // The the other widgets have flextable layouts.  Without it, this one doesn't line up.
		layout = new FlexTable();
		axes = new ListBox();
		flex = new FlexTable();
		// It looks funny without some sort of label on the same line.
		HTML html = new HTML("Axis: ");
		flex.setWidget(0, 0, html);
		flex.setWidget(0, 1, axes);
		disPanel = new DisclosurePanel("Compare");
		disPanel.add(flex);
		disPanel.setOpen(true);
		
//		if ( width != null && !width.equals("") ) {
//		    disPanel.setWidth(width);
//		}
		layout.setWidget(0, 0, disPanel);
		initWidget(layout);
	}
 
Example 3
Project: LAS   File: DateTimeWidget.java   Source Code and License 6 votes vote down vote up
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));
	}
}
 
Example 4
Project: LAS   File: DateTimeWidget.java   Source Code and License 6 votes vote down vote up
public void loadAndSetDayHour(ListBox day_list, HourListBox hour_list, ListBox minute_list, int year, int month, int day, int hour, int min) {
	// Load the valid days for this month (which as set above) and year.
	days(day_list, year, month);

	if ( day < Integer.valueOf(day_list.getValue(0)).intValue() ) {
		day_list.setSelectedIndex(0);
	} else if ( day > Integer.valueOf(day_list.getValue(day_list.getItemCount() - 1)).intValue() ) {
		day_list.setSelectedIndex(day_list.getItemCount() - 1);
	} else {

		for (int i = 0; i < day_list.getItemCount(); i++) {
			String v = day_list.getValue(i);
			if ( v.equals(GeoUtil.format_two(day)) ) {
				day_list.setSelectedIndex(i);
			}
		}
	}
	
	loadAndSetHour(hour_list, minute_list, year, month, Integer.valueOf(day_list.getValue(day_list.getSelectedIndex())).intValue(), hour, min);
	
}
 
Example 5
Project: LAS   File: DateTimeWidget.java   Source Code and License 6 votes vote down vote up
public void loadAndSetHour(HourListBox hour_list, ListBox minute_list, int year, int month, int day, int hour, int min) {
	int start_year = lo.getYear();
	int start_month = lo.getMonthOfYear();
	int start_day = lo.getDayOfMonth();
	int start_hour = lo.getHourOfDay();
	int start_min = lo.getMinuteOfHour();
	
	int end_year = hi.getYear();
	int end_month = hi.getMonthOfYear();
	int end_day = hi.getDayOfMonth();
	int end_hour = hi.getHourOfDay();
	int end_min = hi.getMinuteOfHour();
	if ( start_year == year && start_month == month && start_day == day ) {
		hours(hour_list, start_hour, start_min, 24, 0);
	} else if ( end_year == year && end_month == month && end_day == day ) {
		hours(hour_list, 0, 0, end_hour, end_min);
	} else {
		hours(hour_list, 0, 0, 24, 0);
	}
	if ( hasMinute ) {
		loadAndSetMinute(minute_list, year, month, day, hour, min);
	}
}
 
Example 6
Project: LAS   File: DateTimeWidget.java   Source Code and License 6 votes vote down vote up
public void loadAndSetMinute(ListBox minute_list, int year, int month, int day, int hour, int min) {
	int start_year = lo.getYear();
	int start_month = lo.getMonthOfYear();
	int start_day = lo.getDayOfMonth();
	int start_hour = lo.getHourOfDay();
	int start_min = lo.getMinuteOfHour();
	
	int end_year = hi.getYear();
	int end_month = hi.getMonthOfYear();
	int end_day = hi.getDayOfMonth();
	int end_hour = hi.getHourOfDay();
	int end_min = hi.getMinuteOfHour();
	if ( start_year == year && start_month == month && start_day == day && start_hour == hour ) {
		minutes(minute_list, start_min, 59);
	} else if (  end_year == year && end_month == month && end_day == day && end_hour == hour ) {
		minutes(minute_list, 0, end_hour);
	} else {
		minutes(minute_list, 0, 59);
	}
	
}
 
Example 7
Project: LAS   File: OptionsWidget.java   Source Code and License 6 votes vote down vote up
public Map<String, String> getState() {
	Map<String, String> state = new HashMap<String, String>();
	for (Iterator widIt = widgets.iterator(); widIt.hasNext();) {
		Widget w = (Widget) widIt.next();
		if (w instanceof TextBox) {
			TextBox t = (TextBox) w;
			if (t.getText() != null && !t.getText().equals("")) {
				state.put(t.getName(), t.getText());
			}
		} else if (w instanceof ListBox) {
			ListBox l = (ListBox) w;
			state.put(l.getName(), l.getValue(l.getSelectedIndex()));
		}
	}
	return state;
}
 
Example 8
Project: cuba   File: CubaTwinColSelectWidget.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 9
Project: dhcalc   File: PassivesPanel.java   Source Code and License 6 votes vote down vote up
protected void checkDuplicate(ListBox lb) {
	int selected = lb.getSelectedIndex();
	
	boolean prev = disableListeners;
	disableListeners = true;

	for (int i = 0; i < NUM_PASSIVES; i++) {
		ListBox l = listBoxes.get(i);
		
		if ((l != lb) && (l.getSelectedIndex() == selected)) {
			l.setSelectedIndex(0);
			setTooltip(anchors.get(i), null);
		}
	}

	disableListeners = prev;
}
 
Example 10
Project: x-cure-chat   File: FontSelectorPanelUI.java   Source Code and License 6 votes vote down vote up
/**
 * Initializes the list box that allows to select styles
 * @param listBox the list box to initialize
 * @param dataToName the mapping from the style ID to the human readable name of the style
 * @param dataToStyleName the mapping from the style ID to the CSS style name
 * @param defaultValue the default style ID that should be set as selected
 */
public void initializeListBox( final ListBox listBox, final Map<Integer, String> dataToName,
							   final Map<Integer, String> dataToStyleName, final int defaultValue) {
	//Initialize the list box with data
	Iterator< Entry<Integer,String> > entrySetIter = dataToName.entrySet().iterator();
	while( entrySetIter.hasNext() ) {
		Entry<Integer, String> entry = entrySetIter.next();
		listBox.addItem( entry.getValue(), dataToStyleName.get( entry.getKey() ) );
	}
	listBox.setVisibleItemCount( 1 );
	
	//Set the default value as being selected
	setListBoxStyleID( listBox, defaultValue, dataToStyleName );
	
	//Add the change listener
	listBox.addChangeHandler(new ChangeHandler() {
		public void onChange(ChangeEvent e) {
			//Update the sample view
			updateSampleViewStyles();
		}
	});
}
 
Example 11
Project: ephesoft   File: EditBoxExporterView.java   Source Code and License 6 votes vote down vote up
private void setValueOfDocFieldWidget(String name, String value) {
	for (EditableWidgetStorage editableWidgetStorage : docFieldWidgets) {
		if (editableWidgetStorage.getData().getName().equals(name)) {
			if (editableWidgetStorage.isListBox) {
				ListBox listBoxwidget = editableWidgetStorage.getListBoxwidget();
				if (listBoxwidget != null) {
					for (int i = 0; i < listBoxwidget.getItemCount(); i++) {
						String listBoxValue = listBoxwidget.getValue(i);
						if (listBoxValue.equals(value)) {
							listBoxwidget.setSelectedIndex(i);
							break;
						}
					}
				}
			} else {
				ValidatableWidget<TextBox> textBoxWidget = editableWidgetStorage.getTextBoxWidget();
				if (textBoxWidget != null) {
					textBoxWidget.getWidget().setValue(value);
				}
			}
			break;
		}
	}
}
 
Example 12
Project: ephesoft   File: EditBoxExporterView.java   Source Code and License 6 votes vote down vote up
/**
 * To get Value Of Document Field Widget.
 * 
 * @param name String
 * @return String
 */
public String getValueOfDocFieldWidget(String name) {
	String value = null;
	for (EditableWidgetStorage editableWidgetStorage : docFieldWidgets) {
		String nameOfWidget = editableWidgetStorage.getData().getName();
		if (nameOfWidget.equals(name)) {
			if (editableWidgetStorage.isListBox) {
				ListBox listBoxwidget = editableWidgetStorage.getListBoxwidget();
				if (listBoxwidget != null) {
					value = listBoxwidget.getValue(listBoxwidget.getSelectedIndex());
				}
			} else {
				ValidatableWidget<TextBox> textBoxWidget = editableWidgetStorage.getTextBoxWidget();
				if (textBoxWidget != null) {
					value = textBoxWidget.getWidget().getValue();
				}
			}
			break;
		}
	}
	return value;
}
 
Example 13
Project: ephesoft   File: AdvancedKVExtractionView.java   Source Code and License 6 votes vote down vote up
private void setKeyPatternPanelView() {
	keyPatternText = new TextBox();
	keyPatternText.addStyleName(AdminConstants.GWT_ADVANCED_KV_TEXT_BOX);
	keyPatternField = new ListBox();
	keyPatternField.setWidth("98%");
	keyPatternPanel.add(keyPatternText);
	useExistingKey.setValue(Boolean.FALSE);
	useExistingKey.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

		@Override
		public void onValueChange(ValueChangeEvent<Boolean> arg0) {
			if (arg0.getValue().equals(Boolean.TRUE)) {
				keyPatternValidateButton.setEnabled(Boolean.FALSE);
				keyPatternPanel.remove(keyPatternText);
				keyPatternPanel.add(keyPatternField);
			} else {
				keyPatternValidateButton.setEnabled(Boolean.TRUE);
				keyPatternPanel.remove(keyPatternField);
				keyPatternPanel.add(keyPatternText);
			}
		}
	});
}
 
Example 14
Project: ephesoft   File: EditScannerView.java   Source Code and License 6 votes vote down vote up
/**
 * To add Drop Down.
 * 
 * @param row int
 * @param sampleValueList List<String>
 * @param selectedValue String
 * @param htmlID String
 * @param elementMap Map<String, Widget>
 * @return ListBox
 */
public ListBox addDropDown(int row, List<String> sampleValueList, String selectedValue, String htmlID,
		Map<String, Widget> elementMap) {
	ListBox fieldValue = new ListBox();
	elementMap.put(htmlID, fieldValue);
	fieldValue.getElement().setId(htmlID);
	fieldValue.setVisibleItemCount(1);
	for (String item : sampleValueList) {
		fieldValue.addItem(item);
	}
	if (selectedValue == null) {
		fieldValue.setItemSelected(0, true);
	} else {
		fieldValue.setItemSelected(sampleValueList.indexOf(selectedValue), true);
	}

	return fieldValue;
}
 
Example 15
Project: ephesoft   File: EditPluginPresenter.java   Source Code and License 6 votes vote down vote up
private void enableCreateMultipageOptimizationProps(final ListBox fieldValue) {
	if (fieldValue != null) {
		for (EditableWidgetStorage editableWidgetStorage : docFieldWidgets) {
			if (fieldValue.getItemText(fieldValue.getSelectedIndex()).equalsIgnoreCase(PluginNameConstants.ON_STRING)) {
				if (editableWidgetStorage != null
						&& editableWidgetStorage.getTextBoxWidget() != null
						&& editableWidgetStorage.getTextBoxWidget().getWidget() != null
						&& editableWidgetStorage.getTextBoxWidget().getWidget().getName().equals(
								PluginNameConstants.CREATE_MULTIPAGE_PDF_OPTIMIZATION_PARAMETERS)) {
					editableWidgetStorage.widget.getWidget().setEnabled(true);
				}
			} else {
				if (editableWidgetStorage != null
						&& editableWidgetStorage.getTextBoxWidget() != null
						&& editableWidgetStorage.getTextBoxWidget().getWidget() != null
						&& editableWidgetStorage.getTextBoxWidget().getWidget().getName().equals(
								PluginNameConstants.CREATE_MULTIPAGE_PDF_OPTIMIZATION_PARAMETERS)) {
					editableWidgetStorage.widget.getWidget().setEnabled(false);
				}
			}
		}
	}

}
 
Example 16
Project: ephesoft   File: EditPluginPresenter.java   Source Code and License 6 votes vote down vote up
private void enableTabbedPdfOptimizationProps(final ListBox fieldValue) {
	if (fieldValue != null) {
		for (EditableWidgetStorage editableWidgetStorage : docFieldWidgets) {
			if (fieldValue.getItemText(fieldValue.getSelectedIndex()).equalsIgnoreCase(PluginNameConstants.ON_STRING)) {
				if (editableWidgetStorage != null
						&& editableWidgetStorage.getTextBoxWidget() != null
						&& editableWidgetStorage.getTextBoxWidget().getWidget() != null
						&& editableWidgetStorage.getTextBoxWidget().getWidget().getName().equals(
								PluginNameConstants.TABBED_PDF_OPTIMIZATION_PARAMETERS)) {
					editableWidgetStorage.widget.getWidget().setEnabled(true);
				}
			} else {
				if (editableWidgetStorage != null
						&& editableWidgetStorage.getTextBoxWidget() != null
						&& editableWidgetStorage.getTextBoxWidget().getWidget() != null
						&& editableWidgetStorage.getTextBoxWidget().getWidget().getName().equals(
								PluginNameConstants.TABBED_PDF_OPTIMIZATION_PARAMETERS)) {
					editableWidgetStorage.widget.getWidget().setEnabled(false);
				}
			}
		}
	}

}
 
Example 17
Project: ephesoft   File: ConfigureModulePluginsPresenter.java   Source Code and License 6 votes vote down vote up
private void addSelectedPlugin() {
	int selectedIndex = view.getMultipleSelectTwoSidedListBox().getLeftHandSideListBox().getSelectedIndex();
	if (selectedIndex != -1) {
		String selectedValue = view.getMultipleSelectTwoSidedListBox().getLeftHandSideListBox().getItemText(selectedIndex);
		String selectedValueKey = BatchClassManagementConstants.EMPTY_STRING;
		ListBox toList = view.getMultipleSelectTwoSidedListBox().getRightHandSideListBox();
		Map<String, String> pluginIdentifierToNameMap = view.getMultipleSelectTwoSidedListBox().getAllValuesMapFromList(toList);
		do {

			selectedValueKey = BatchClassManagementConstants.NEW + newIdentifier++;
		} while (pluginIdentifierToNameMap.keySet().contains(selectedValueKey));
		toList.addItem(selectedValue, selectedValueKey);
		int newIndex = toList.getItemCount() - 1;
		toList.getElement().getElementsByTagName("option").getItem(newIndex).setTitle(selectedValue);
	}
}
 
Example 18
Project: djvu-html5   File: Toolbar.java   Source Code and License 6 votes vote down vote up
protected void zoomSelectionChanged() {
	if (pageLayout == null)
		return;
	ListBox zoomSelection = zoomPanel.selection;
	int index = zoomSelection.getSelectedIndex();
	if (index < zoomOptions.size()) {
		pageLayout.setZoom(zoomOptions.get(index));
	} else {
		switch (index - zoomOptions.size()) {
		case 0:
			pageLayout.zoomToFitWidth();
			break;
		case 1:
			pageLayout.zoomToFitPage();
			break;
		default:
			throw new RuntimeException();
		}
	}
	zoomPanel.textBox.setText(zoomSelection.getSelectedItemText());
	zoomSelection.setFocus(false);
}
 
Example 19
Project: ephesoft   File: ConfigureModulePresenter.java   Source Code and License 6 votes vote down vote up
private void addSelectedModule() {
	ListBox fromList = view.getMultipleSelectTwoSidedListBox().getLeftHandSideListBox();
	List<Integer> selectedIndexes = view.getMultipleSelectTwoSidedListBox().getAllSelectedIndexes(fromList);

	for (Integer selectedIndex : selectedIndexes) {
		if (selectedIndex != -1) {
			String selectedValue = fromList.getItemText(selectedIndex);
			String selectedValueKey = BatchClassManagementConstants.EMPTY_STRING;
			ListBox toList = view.getMultipleSelectTwoSidedListBox().getRightHandSideListBox();
			Map<String, String> moduleIdentifierToNameMap = view.getMultipleSelectTwoSidedListBox()
					.getAllValuesMapFromList(toList);
			do {
				selectedValueKey = BatchClassManagementConstants.NEW + newIdentifier++;
			} while (moduleIdentifierToNameMap.containsKey(selectedValueKey));
			toList.addItem(selectedValue, selectedValueKey);
			int newIndex = toList.getItemCount() - 1;
			toList.getElement().getElementsByTagName("option").getItem(newIndex).setTitle(selectedValue);
		}
	}
}
 
Example 20
Project: dhcalc   File: ItemPanel.java   Source Code and License 6 votes vote down vote up
private void setItem(Slot slot, SpecialItemType type) {
	
	ListBox list = listBoxes.get(slot);
	
	if (list != null) {
		if (type == null) {
			list.setSelectedIndex(0);
			
			anchors.get(slot).setHref("javascript:void(0)");
		} else {
			int n = list.getItemCount();
			anchors.get(slot).setHref(type.getUrl());
			
			for (int i = 0; i < n; i++) {
				if (list.getValue(i).equals(type.name())) {
					list.setSelectedIndex(i);
					return;
				}
			}
		}
	}
}
 
Example 21
Project: dhcalc   File: BasePanel.java   Source Code and License 6 votes vote down vote up
protected void setFieldValue(ListBox field, String value) {
	try {
		for (int i = 0; i < field.getItemCount(); i++) {
			String v = field.getValue(i);

			if (v.equals(value)) {
				field.setSelectedIndex(i);
				return;
			}
		}

		field.setSelectedIndex(0);

	} catch (Exception e) {
		field.setSelectedIndex(0);
	}
}
 
Example 22
Project: ephesoft   File: ValidatePanel.java   Source Code and License 6 votes vote down vote up
public DocFieldWidget(String parentDocumentIdentifier, Label fieldLabel, Field field, ValidatableWidget<SuggestionBox> widget,
		ValidatableWidget<ListBox> lWidget, ValidatableWidget<TextArea> textAreaWidget, boolean isReadOnly) {
	this.parentDocumentIdentifier = parentDocumentIdentifier;
	this.fieldLabel = fieldLabel;
	this.field = field;
	this.textAreaWidget = textAreaWidget;
	this.widget = widget;
	this.lWidget = lWidget;
	this.isReadOnly = isReadOnly;
	// enabling or disabling the widgets based on 'readonly' flag
	if (lWidget != null) {
		this.lWidget.getWidget().setEnabled(!isReadOnly);
	}
	if (widget != null) {
		this.widget.getWidget().getTextBox().setEnabled(!isReadOnly);
	}
	if (textAreaWidget != null) {
		this.textAreaWidget.getWidget().setReadOnly(isReadOnly);
	}

	setForceReviewOfValidatableWidget();
}
 
Example 23
Project: dhcalc   File: StatsPanel.java   Source Code and License 6 votes vote down vote up
private void selectSkill(ListBox list, ActiveSkill skill) {

		for (int i = 0; i < list.getItemCount(); i++) {
			String value = list.getValue(i);

			if (skill != null) {
				if (value.equals(skill.name())) {
					list.setSelectedIndex(i);
					return;
				}
			} else {
				if ((value == null) || (value.trim().length() == 0)) {
					list.setSelectedIndex(i);
					return;
				}
			}

		}

		list.setSelectedIndex(0);
	}
 
Example 24
Project: gerrit   File: DownloadBox.java   Source Code and License 6 votes vote down vote up
DownloadBox(ChangeInfo change, String revision, PatchSet.Id psId) {
  this.change = change;
  this.revision = revision;
  this.psId = psId;
  this.commandTable = new FlexTable();
  this.scheme = new ListBox();
  this.scheme.addChangeHandler(
      new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
          renderCommands();
          if (Gerrit.isSignedIn()) {
            saveScheme();
          }
        }
      });

  setStyleName(Gerrit.RESOURCES.css().downloadBox());
  commandTable.setStyleName(Gerrit.RESOURCES.css().downloadBoxTable());
  scheme.setStyleName(Gerrit.RESOURCES.css().downloadBoxScheme());
  add(commandTable);
}
 
Example 25
Project: jolie   File: Echoes.java   Source Code and License 6 votes vote down vote up
private void addVolumeMenuItems( ListBox volumeMenu )
{
	volumeMenu.addItem( "0%", "0" );
	volumeMenu.addItem( "5%", "5" );
	volumeMenu.addItem( "10%", "10" );
	volumeMenu.addItem( "15%", "15" );
	volumeMenu.addItem( "20%", "20" );
	volumeMenu.addItem( "25%", "25" );
	volumeMenu.addItem( "30%", "30" );
	volumeMenu.addItem( "35%", "35" );
	volumeMenu.addItem( "40%", "40" );
	volumeMenu.addItem( "45%", "45" );
	volumeMenu.addItem( "50%", "50" );
	volumeMenu.addItem( "55%", "55" );
	volumeMenu.addItem( "60%", "60" );
	volumeMenu.addItem( "65%", "65" );
	volumeMenu.addItem( "70%", "70" );
	volumeMenu.addItem( "75%", "75" );
	volumeMenu.addItem( "80%", "80" );
	volumeMenu.addItem( "85%", "85" );
	volumeMenu.addItem( "90%", "90" );
	volumeMenu.addItem( "95%", "95" );
	volumeMenu.addItem( "100%", "100" );
}
 
Example 26
Project: dhcalc   File: SkillsPanel.java   Source Code and License 6 votes vote down vote up
private void selectRune(ActiveSkill skill, Anchor anchor2, ListBox list2,
		Rune rune) {

	if (rune == null) {
		list2.setSelectedIndex(0);
	} else {
		int n = list2.getItemCount();

		for (int i = 0; i < n; i++) {
			String value = list2.getValue(i);

			if (value.equals(rune.name())) {
				list2.setSelectedIndex(i);
				break;
			}
		}
	}

	this.setRuneAnchor(skill, anchor2, rune);
}
 
Example 27
Project: firefly   File: CatddPanel.java   Source Code and License 6 votes vote down vote up
private ListBox createListBox() {
    List<EnumFieldDef.Item> listItems = new ArrayList<EnumFieldDef.Item>();
    listItems.add(new EnumFieldDef.Item("short", "Short Form"));
    listItems.add(new EnumFieldDef.Item("long", "Long Form"));
    EnumFieldDef list = new EnumFieldDef("Lists");
    list.addItems(listItems);
    list.setNullAllow(false);
    list.setErrMsg("This field is required. Select one from list");
    lists = GwtUtil.createComboBox(list);
    lists.addChangeHandler((new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            formToSelect = lists.getValue(lists.getSelectedIndex());
            changePanel(formToSelect);
        }
    }));


    return lists;
}
 
Example 28
Project: unitimes   File: UniTimeWidget.java   Source Code and License 5 votes vote down vote up
@Deprecated
public void clear() {
	if (getWidget() instanceof ListBox)
		((ListBox)getWidget()).clear();
	if (getWidget() instanceof Panel)
		((Panel)getWidget()).clear();
}
 
Example 29
Project: unitimes   File: EventAdd.java   Source Code and License 5 votes vote down vote up
@Override
public List<RelatedObjectInterface> getValue() {
	List<RelatedObjectInterface> objects = new ArrayList<RelatedObjectInterface>();
	for (int row = 1; row < getRowCount(); row ++) {
		CourseRelatedObjectLine line = getData(row);
		ListBox subject = (ListBox)getWidget(row, 0);
		RelatedObjectLookupRpcResponse rSubject = (subject.getSelectedIndex() < 0 ? null : line.getSubject(subject.getValue(subject.getSelectedIndex())));
		ListBox course = (ListBox)getWidget(row, 1);
		RelatedObjectLookupRpcResponse rCourse = (course.getSelectedIndex() < 0 ? null : line.getCourse(course.getValue(course.getSelectedIndex())));
		ListBox subpart = (ListBox)getWidget(row, 2);
		RelatedObjectLookupRpcResponse rSubpart = (subpart.getSelectedIndex() < 0 ? null : line.getSubpart(subpart.getValue(subpart.getSelectedIndex())));
		ListBox clazz = (ListBox)getWidget(row, 3);
		RelatedObjectLookupRpcResponse rClazz = (clazz.getSelectedIndex() < 0 ? null : line.getClass(clazz.getValue(clazz.getSelectedIndex())));
		if (rClazz != null && rClazz.getRelatedObject() != null) {
			objects.add(rClazz.getRelatedObject()); continue;
		}
		if (rSubpart != null && rSubpart.getRelatedObject() != null) {
			objects.add(rSubpart.getRelatedObject()); continue;
		}
		if (rCourse != null && rCourse.getRelatedObject() != null) {
			objects.add(rCourse.getRelatedObject()); continue;
		}
		if (rSubject != null && rSubject.getRelatedObject() != null) {
			objects.add(rSubject.getRelatedObject()); continue;
		}
	}
	return objects;
}
 
Example 30
Project: unitimes   File: ReservationEdit.java   Source Code and License 5 votes vote down vote up
private void select(ListBox l, String value) {
	for (int i = 0; i < l.getItemCount(); i++) {
		if (l.getValue(i).equals(value)) {
			l.setSelectedIndex(i);
			return;
		}
	}
}
 
Example 31
Project: appinventor-extensions   File: TemplateUploadWizard.java   Source Code and License 5 votes vote down vote up
/**
 * Creates a drop down menu for selecting Template repositories.
 * @return the drop down menu of repository Urls.
 */
private ListBox makeTemplatesMenu() {
  final ListBox templatesMenu = new ListBox();
  templatesMenu.addItem(MESSAGES.templateUploadNewUrlCaption());
  templatesMenu.addItem(MIT_TEMPLATES);

  for (int k = 0; k < dynamicTemplateUrls.size(); k++) { // Dynamically added Urls
    templatesMenu.addItem(dynamicTemplateUrls.get(k));
  }
  templatesMenu.setSelectedIndex(MIT_TEMPLATES_INDEX);
  templatesMenu.addChangeHandler(new ChangeHandler() {
      public void onChange(ChangeEvent event) {
        int selectedIndex = templatesMenu.getSelectedIndex();

        if (selectedIndex == 0) {
          templatesMenu.setSelectedIndex(lastSelectedIndex);
          usingExternalTemplate = true; // MIT templates at index 1
          removeButton.setVisible(false);
          new InputTemplateUrlWizard(instance).center();     // This will do a callback
        } else if (selectedIndex == 1) {
          removeButton.setVisible(false);          lastSelectedIndex = selectedIndex;
          usingExternalTemplate = false; // MIT templates at index 1
          templateHostUrl = "";
          retrieveSelectedTemplates(templatesMenu.getValue(selectedIndex));  // may do callback
        } else {
          removeButton.setVisible(true);         lastSelectedIndex = selectedIndex;
          usingExternalTemplate = true; // MIT templates at index 1
          templateHostUrl = templatesMenu.getValue(selectedIndex);
          retrieveSelectedTemplates(templatesMenu.getValue(selectedIndex));  // may do callback
        }
      }
    });
  templatesMenu.setVisibleItemCount(1);  // Turns menu into a drop-down list).
  return templatesMenu;
}
 
Example 32
Project: appinventor-extensions   File: MockSpinner.java   Source Code and License 5 votes vote down vote up
/**
 * Creates a new MockSpinner component.
 *
 * @param editor editor of source file the component belongs to
 */
public MockSpinner(SimpleEditor editor) {
  super(editor, TYPE, images.spinner());

  // Initialize mock label UI
  spinnerWidget = new ListBox();
  spinnerWidget.addItem(MESSAGES.MockSpinnerAddItems());
  spinnerWidget.setStylePrimaryName("ode-SimpleMockComponent");
  spinnerWidget.addStyleName("spinnerComponentStyle");
  initComponent(spinnerWidget);
  refreshForm();
}
 
Example 33
Project: essence   File: EndpointListBoxV3.java   Source Code and License 5 votes vote down vote up
static public void copyListItemsToListBox(ListBox lb) {
	if (lb == null)
		return;
	for (int i=0; i<EndpointTypesListItems.length; i++) {
		lb.addItem(EndpointTypesListItems[i][1], EndpointTypesListItems[i][0]);
	}		
}
 
Example 34
Project: essence   File: EndpointListBoxV5.java   Source Code and License 5 votes vote down vote up
static public void copyListItemsToListBox(ListBox lb) {
	if (lb == null)
		return;
	for (int i=0; i<EndpointTypesListItems.length; i++) {
		lb.addItem(EndpointTypesListItems[i][1], EndpointTypesListItems[i][0]);
	}		
}
 
Example 35
Project: LAS   File: DateTimeWidget.java   Source Code and License 5 votes vote down vote up
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));
	}
	
}
 
Example 36
Project: LAS   File: DateTimeWidget.java   Source Code and License 5 votes vote down vote up
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);
		}
	}
 
Example 37
Project: LAS   File: DateTimeWidget.java   Source Code and License 5 votes vote down vote up
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));
	}
}
 
Example 38
Project: LAS   File: DateTimeWidget.java   Source Code and License 5 votes vote down vote up
private void loadAndSetMonthDayHour(ListBox month_list, ListBox day_list, HourListBox hour_list, ListBox minute_list, int year, int month, int day, int hour, int min) {
	// Load the valid months for this year.
	months(month_list, year);

	int low_month_number = monthToInt(month_list.getValue(0));
	int hi_month_number = monthToInt(month_list.getValue(month_list.getItemCount() - 1));
	
	DateTime requested_instance = new DateTime(year, month, day, hour, min, chrono).withZone(DateTimeZone.UTC);
	String month_name = monthFormat.print(requested_instance.getMillis());

	if ( month < low_month_number ) {
		// If the current month is before the first month in the list
		// set to the first month.
		month_list.setSelectedIndex(0);
	} else if ( month > hi_month_number) {
		// If the current month is after the last month in the list
		// set to the last month.
		month_list.setSelectedIndex(month_list.getItemCount() - 1);
	} else {
		// Else set to that month
		for (int i = 0; i < month_list.getItemCount(); i++) {
			String v = month_list.getValue(i);
			if ( v.equals(month_name) ) {
				month_list.setSelectedIndex(i);
			}
		}
	}

	
	int selected_month = monthToInt(month_list.getValue(month_list.getSelectedIndex()));
	loadAndSetDayHour(day_list, hour_list, minute_list, year, selected_month, day, hour, min);	
}
 
Example 39
Project: LAS   File: UI.java   Source Code and License 5 votes vote down vote up
@Override
public void onChange(ChangeEvent event) {
    if (xAnalysisWidget.isActive()) {
        eventBus.fireEventFromSource(new WidgetSelectionChangeEvent(false), event.getSource());
        ListBox analysisAxis = (ListBox) event.getSource();
        String v = analysisAxis.getValue(analysisAxis.getSelectedIndex());
        setAnalysisAxes(v);
    }
}
 
Example 40
Project: autorest-nominatim-example   File: ExampleEntryPoint.java   Source Code and License 5 votes vote down vote up
public void onModuleLoad() {
    PublishSubject<String> query = PublishSubject.create();

    TextBox text = new TextBox(); RootPanel.get().add(text);
    text.addValueChangeHandler(e -> query.onNext(e.getValue()));

    Button search = new Button("search"); RootPanel.get().add(search);
    search.addClickHandler(e -> query.onNext(text.getValue()));

    ListBox url = new ListBox(); RootPanel.get().add(url);
    url.addItem(NOMINATIM_OPENSTREETMAP);
    url.addItem("http://localhost:8080/");
    url.addChangeHandler(e -> query.onNext(text.getValue()));

    FlowPanel results = new FlowPanel(); RootPanel.get().add(results);

    // remember last selected server
    Storage storage = Storage.getLocalStorageIfSupported();
    if (storage != null) {
        try {
            url.setSelectedIndex(Integer.valueOf(storage.getItem("nominatim.url")));
        } catch (Exception ignore) {}
        url.addChangeHandler(c -> storage.setItem("nominatim.url", Integer.toString(url.getSelectedIndex())));
    }

    // on each tick, re-configure root resource and fire new request
    query.switchMap(q -> {
        results.clear();
        if (q == null || q.isEmpty()) return Observable.empty();
        Nominatim nominatim = new Nominatim_RestServiceModel(() -> osm(url.getSelectedItemText()));
        return nominatim.search(q, "json").doOnNext(n -> results.add(new Label(
                "[" + (int) (n.importance * 10.) + "] " + n.display_name + " (" + n.lon + "," + n.lat + ")")));
    }).retry((cnt, err) -> {
        GWT.log("request error: " + err, err); return true;
    }).subscribe();

     // fires initial search
    text.setValue("Málaga,España", true);
}
 
Example 41
Project: gwt-cs   File: Labels.java   Source Code and License 5 votes vote down vote up
@Override
public void buildPanel() {
    csVPanel = new ViewerPanel();
    addLabel();

    ListBox labelsLBox = new ListBox();
    labelsLBox.addItem("Add label", "0");
    labelsLBox.addItem("Set font", "1");
    labelsLBox.addItem("Set properties", "2");
    labelsLBox.addItem("Offset label by distance", "3");
    labelsLBox.addItem("Fade label by distance", "4");
    labelsLBox.addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
            ListBox source = (ListBox) event.getSource();
            reset();
            switch (source.getSelectedValue()) {
                case "0": addLabel(); break;
                case "1": setFont(); break;
                case "2": setProperties(); break;
                case "3": offsetByDistance(); break;
                case "4": fadeByDistance(); break;
                default: break;
            }
        }
    });

    AbsolutePanel aPanel = new AbsolutePanel();
    aPanel.add(csVPanel);
    aPanel.add(labelsLBox, 20, 20);

    contentPanel.add(new HTML("<p>Create Labels</p>"));
    contentPanel.add(aPanel);

    initWidget(contentPanel);
}
 
Example 42
Project: x-cure-chat   File: FontSelectorPanelUI.java   Source Code and License 5 votes vote down vote up
/**
 * Allows to set the style name as selected in the list box
 * @param listBox the list box to set the value in
 * @param styleName the style which we want to set as selected
 */
public void setListBoxStyleName( final ListBox listBox, final String styleName ) {
	//First set the selected element
	for( int index = 0; index < listBox.getItemCount(); index++ ) {
		if( listBox.getValue( index ).equals( styleName ) ) {
			listBox.setSelectedIndex( index );
			break;
		}
	}
	//Second, update the sample view
	updateSampleViewStyles();
}
 
Example 43
Project: x-cure-chat   File: FontSelectorPanelUI.java   Source Code and License 5 votes vote down vote up
/**
 * Allows to retrieve the selected style name from the list box
 * @param listBox the list box to get the selected style from
 * @return the style selected by the user in this box
 */
public String getListBoxSelectedStyleName( final ListBox listBox ) {
	final int selectedIndex = listBox.getSelectedIndex();
	if( selectedIndex == -1 ) {
		//Nothing is selected yet, return the fist element in the list
		return listBox.getValue( 0 );
	} else {
		//An item is selected, get its value
		return listBox.getValue( selectedIndex );
	}
}
 
Example 44
Project: blogwt   File: UiHelper.java   Source Code and License 5 votes vote down vote up
public static void select (ListBox cbo, String value) {
	int count = cbo.getItemCount();
	for (int i = 0; i < count; i++) {
		if (cbo.getValue(i).equals(value)) {
			cbo.setSelectedIndex(i);
			break;
		}
	}
}
 
Example 45
Project: ephesoft   File: EditPluginView.java   Source Code and License 5 votes vote down vote up
/**
 * To add Multiple Select List Box.
 * 
 * @param row int
 * @param sampleValueList List<String>
 * @param MAX_VISIBLE_ITEM_COUNT int
 * @param value String
 * @return ListBox
 */
public ListBox addMultipleSelectListBox(int row, List<String> sampleValueList, int MAX_VISIBLE_ITEM_COUNT, String value) {
	ListBox fieldValue = new ListBox(true);
	fieldValue.setVisibleItemCount(MAX_VISIBLE_ITEM_COUNT);
	for (String item : sampleValueList) {
		fieldValue.addItem(item);
	}
	String[] selectedValue = value.split(";");
	for (String string : selectedValue) {
		fieldValue.setItemSelected(sampleValueList.indexOf(string), true);
	}
	return fieldValue;
}
 
Example 46
Project: ephesoft   File: EditPluginView.java   Source Code and License 5 votes vote down vote up
/**
 * To add drop down.
 * 
 * @param row int
 * @param sampleValueList List<String>
 * @param selectedValue String
 * @return ListBox
 */
public ListBox addDropDown(int row, List<String> sampleValueList, String selectedValue) {
	ListBox fieldValue = new ListBox();
	fieldValue.setVisibleItemCount(1);
	for (String item : sampleValueList) {
		fieldValue.addItem(item);
	}
	fieldValue.setItemSelected(sampleValueList.indexOf(selectedValue), true);
	return fieldValue;
}
 
Example 47
Project: ephesoft   File: KV_PP_EditView.java   Source Code and License 5 votes vote down vote up
/**
 * To add drop down.
 * 
 * @param row int
 * @param sampleValueList List<String>
 * @param selectedValue String
 * @return ListBox
 */
public ListBox addDropDown(int row, List<String> sampleValueList, String selectedValue) {
	ListBox fieldValue = new ListBox();
	fieldValue.setVisibleItemCount(1);
	for (String item : sampleValueList) {
		fieldValue.addItem(item);
	}
	fieldValue.setItemSelected(sampleValueList.indexOf(selectedValue), true);
	return fieldValue;
}
 
Example 48
Project: dhcalc   File: MainPanel.java   Source Code and License 5 votes vote down vote up
@Override
protected void setFieldValue(ListBox field, String value) {
	if (field == this.heroList) {
		setHeroList(value);
	} else
		super.setFieldValue(field, value);
}
 
Example 49
Project: dhcalc   File: MainPanel.java   Source Code and License 5 votes vote down vote up
private ActiveSkill getSkill(ListBox skills) {
	int index = skills.getSelectedIndex();

	if (index < 0)
		return null;

	String value = skills.getValue(index);

	if (value.length() == 0)
		return null;
	else
		return ActiveSkill.valueOf(value);
}
 
Example 50
Project: ephesoft   File: EditPluginPresenter.java   Source Code and License 5 votes vote down vote up
/**
 * Constructor.
 * 
 * @param widget ValidatableWidget<TextBox>
 * @param listBox boolean
 * @param listBoxwidget ListBox
 * @param validatable boolean
 * @param mandatory boolean
 */
public EditableWidgetStorage(ValidatableWidget<TextBox> widget, boolean listBox, ListBox listBoxwidget, boolean validatable,
		boolean mandatory) {
	super();
	this.widget = widget;
	this.listBox = listBox;
	this.listBoxwidget = listBoxwidget;
	this.validatable = validatable;
	this.mandatory = mandatory;
}
 
Example 51
Project: ephesoft   File: ConfigureModulePluginsPresenter.java   Source Code and License 5 votes vote down vote up
private Integer getIndexForValueFromList(ListBox listBox, String dependencyName) {
	int valueIndex = -1;

	for (int index = 0; index < listBox.getItemCount(); index++) {
		if (listBox.getItemText(index).equals(dependencyName)) {
			valueIndex = index;
			listBox.getElement().getElementsByTagName(BatchClassManagementConstants.OPTION).getItem(valueIndex).addClassName(
					BatchClassManagementConstants.DEPENDENCY_COLOR);
			break;
		}
	}
	return valueIndex;
}
 
Example 52
Project: gerrit   File: MyPreferencesScreen.java   Source Code and License 5 votes vote down vote up
private <T extends Enum<?>> T getListBox(ListBox f, T defaultValue, T[] all) {
  final int idx = f.getSelectedIndex();
  if (0 <= idx) {
    String v = f.getValue(idx);
    if ("".equals(v)) {
      return defaultValue;
    }
    for (T t : all) {
      if (t.name().equals(v)) {
        return t;
      }
    }
  }
  return defaultValue;
}
 
Example 53
Project: ephesoft   File: MultipleSelectTwoSidedListBox.java   Source Code and License 5 votes vote down vote up
public List<Integer> getAllSelectedIndexes(ListBox fromList) {
	List<Integer> selectedValuesList = new ArrayList<Integer>(0);
	final int LIST_LENGTH = fromList.getItemCount();
	if (LIST_LENGTH > 0) {
		// populate all selected indexes from the list
		for (int index = 0; index < LIST_LENGTH; index++) {
			if (fromList.isItemSelected(index)) {
				selectedValuesList.add(index);
			}
		}
	}
	return selectedValuesList;
}
 
Example 54
Project: ephesoft   File: MultipleSelectTwoSidedListBox.java   Source Code and License 5 votes vote down vote up
public void moveValuesOnIndexFromOneListToAnother(Set<Integer> indexes, ListBox fromList, ListBox toList) {
	for (Integer index : indexes) {
		int fromListIndex = index;
		String value = fromList.getItemText(fromListIndex);
		toList.addItem(value);
		// fromList.removeItem(fromListIndex);
		int newIndex = toList.getItemCount() - 1;
		toList.getElement().getElementsByTagName(OPTION).getItem(newIndex).setTitle(value);
	}
}
 
Example 55
Project: ephesoft   File: MultipleSelectTwoSidedListBox.java   Source Code and License 5 votes vote down vote up
public Map<String, String> getAllValuesMapFromList(ListBox listBox) {
	Map<String, String> selectedValues = new LinkedHashMap<String, String>(0);
	for (int index = 0; index < listBox.getItemCount(); index++) {
		selectedValues.put(listBox.getValue(index), listBox.getItemText(index));
	}
	return selectedValues;
}
 
Example 56
Project: unitime   File: EventAdd.java   Source Code and License 5 votes vote down vote up
@Override
public List<RelatedObjectInterface> getValue() {
	List<RelatedObjectInterface> objects = new ArrayList<RelatedObjectInterface>();
	for (int row = 1; row < getRowCount(); row ++) {
		CourseRelatedObjectLine line = getData(row);
		ListBox subject = (ListBox)getWidget(row, 0);
		RelatedObjectLookupRpcResponse rSubject = (subject.getSelectedIndex() < 0 ? null : line.getSubject(subject.getValue(subject.getSelectedIndex())));
		ListBox course = (ListBox)getWidget(row, 1);
		RelatedObjectLookupRpcResponse rCourse = (course.getSelectedIndex() < 0 ? null : line.getCourse(course.getValue(course.getSelectedIndex())));
		ListBox subpart = (ListBox)getWidget(row, 2);
		RelatedObjectLookupRpcResponse rSubpart = (subpart.getSelectedIndex() < 0 ? null : line.getSubpart(subpart.getValue(subpart.getSelectedIndex())));
		ListBox clazz = (ListBox)getWidget(row, 3);
		RelatedObjectLookupRpcResponse rClazz = (clazz.getSelectedIndex() < 0 ? null : line.getClass(clazz.getValue(clazz.getSelectedIndex())));
		if (rClazz != null && rClazz.getRelatedObject() != null) {
			objects.add(rClazz.getRelatedObject()); continue;
		}
		if (rSubpart != null && rSubpart.getRelatedObject() != null) {
			objects.add(rSubpart.getRelatedObject()); continue;
		}
		if (rCourse != null && rCourse.getRelatedObject() != null) {
			objects.add(rCourse.getRelatedObject()); continue;
		}
		if (rSubject != null && rSubject.getRelatedObject() != null) {
			objects.add(rSubject.getRelatedObject()); continue;
		}
	}
	return objects;
}
 
Example 57
Project: firefly   File: FilterPanel.java   Source Code and License 5 votes vote down vote up
private static boolean exists(ListBox lb, String val) {
    for (int i = 0; i < lb.getItemCount(); i++) {
        if (lb.getValue(i).equals(val)) {
            return true;
        }
    }
    return false;
}
 
Example 58
Project: ephesoft   File: GWTListBoxControl.java   Source Code and License 5 votes vote down vote up
public static ValidatableWidget<ListBox> createGWTListControl(String type, String actualValue, final String fieldName,
		List<String> regexPatterns, List<String> values) {
	
	ListBox optionList = new ListBox();
	ValidatableWidget<ListBox> optionListWidget = new ValidatableWidget<ListBox>(optionList);
	if (regexPatterns != null && !regexPatterns.isEmpty()) {
		optionListWidget.addValidator(new ListBoxPatternValidator(optionList, regexPatterns));
	}
	optionList.setName(fieldName != null ? fieldName : "");
	String item = "";
	int selectedIndex = -1;
	for (int itemIndex = 0; itemIndex < values.size(); itemIndex++) {
		item = values.get(itemIndex).trim();
		if (!item.isEmpty()) {
			optionList.addItem(item);
			if (!actualValue.trim().isEmpty() && item.equalsIgnoreCase(actualValue)) {
				selectedIndex = itemIndex;
			}
		}
	}

	if (selectedIndex > -1) {
		optionList.getElement().setAttribute("isActualValueFound", Boolean.TRUE.toString());
		optionList.setSelectedIndex(selectedIndex);
	} else {
		optionList.getElement().setAttribute("isActualValueFound", Boolean.FALSE.toString());
	}

	return optionListWidget;
}
 
Example 59
Project: ephesoft   File: ReviewValidateTable.java   Source Code and License 5 votes vote down vote up
private ListBox createPriorityListBox() {
	ListBox priorityListBox = new ListBox();
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.LABEL_TABLE_ALL), "0");
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.BATCH_PRIORITY_URGENT),
			BatchPriority.URGENT.getLowerLimit().toString());
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.BATCH_PRIORITY_HIGH), BatchPriority.HIGH
			.getLowerLimit().toString());
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.BATCH_PRIORITY_MEDIUM),
			BatchPriority.MEDIUM.getLowerLimit().toString());
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.BATCH_PRIORITY_LOW), BatchPriority.LOW
			.getLowerLimit().toString());
	return priorityListBox;
}
 
Example 60
Project: ephesoft   File: LandingView.java   Source Code and License 5 votes vote down vote up
/**
 * To get Priority List Box.
 * 
 * @return ListBox
 */
public ListBox getPriorityListBox() {
	ListBox priorityListBox = new ListBox();
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.LABEL_TABLE_ALL), "0");
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.BATCH_PRIORITY_URGENT),
			BatchPriority.URGENT.getLowerLimit().toString());
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.BATCH_PRIORITY_HIGH), BatchPriority.HIGH
			.getLowerLimit().toString());
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.BATCH_PRIORITY_MEDIUM),
			BatchPriority.MEDIUM.getLowerLimit().toString());
	priorityListBox.addItem(LocaleDictionary.get().getConstantValue(BatchListConstants.BATCH_PRIORITY_LOW), BatchPriority.LOW
			.getLowerLimit().toString());
	return priorityListBox;
}