Java Code Examples for com.smartgwt.client.widgets.form.fields.RadioGroupItem#setShowTitle()

The following examples show how to use com.smartgwt.client.widgets.form.fields.RadioGroupItem#setShowTitle() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Simple yes/no radio button. yes=true, no=false
 * 
 * @param name name of the item
 * @param label label of the item(optional)
 * 
 * @return the new item
 */
public static RadioGroupItem newYesNoRadioItem(String name, String label) {
	RadioGroupItem item = new RadioGroupItem(filterItemName(name), I18N.message(label));
	item.setVertical(false);
	item.setShowTitle(true);
	item.setWrap(false);
	item.setWrapTitle(false);

	LinkedHashMap<String, String> values = new LinkedHashMap<String, String>();
	values.put("true", I18N.message("yes"));
	values.put("false", I18N.message("no"));
	item.setValueMap(values);
	item.setValue("true");

	return item;
}
 
Example 2
Source File: StationSelector.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
FormItem createFilterCategorySelectionGroup(String serviceUrl) {
	if (stationFilterGroups.containsKey(serviceUrl)) {
		RadioGroupItem selector = stationFilterGroups.get(serviceUrl);
		return selector;
	}
	RadioGroupItem radioGroup = new RadioGroupItem("sosDataSource");
	radioGroup.setShowTitle(false);
	radioGroup.addChangedHandler(new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			Object value = event.getValue();
			if (value != null) {
				hideInfoWindow();
				controller.setStationFilter(value.toString());
				controller.updateContentUponStationFilter();
			}
		}
	});

	stationFilterGroups.put(serviceUrl, radioGroup);
	return radioGroup;
}
 
Example 3
Source File: DigitalObjectSearchView.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
private DynamicForm createFilter() {
    DynamicForm form = new DynamicForm();
    form.setBrowserSpellCheck(false);
    form.setValidateOnExit(true);
    form.setSaveOnEnter(true);
    form.setAutoHeight();
    form.setWidth100();
    form.setNumCols(6);

    final RadioGroupItem filterType = new RadioGroupItem(DigitalObjectResourceApi.SEARCH_TYPE_PARAM);
    filterType.setVertical(false);
    filterType.setShowTitle(false);
    filterType.setWrap(false);
    // setRedrawOnChange(true) enforces evaluation of other FormItem.setShowIfCondition
    filterType.setRedrawOnChange(true);
    filterType.setColSpan(5);
    final LinkedHashMap<String, String> filterMap = new LinkedHashMap<String, String>();
    filterMap.put(FILTER_ALPHABETICAL, i18n.DigitalObjectSearchView_FilterGroupAlphabetical_Title());
    filterMap.put(FILTER_LAST_CREATED, i18n.DigitalObjectSearchView_FilterGroupLastCreated_Title());
    filterMap.put(FILTER_LAST_MODIFIED, i18n.DigitalObjectSearchView_FilterGroupLastModified_Title());
    if (!Editor.getInstance().hasPermission("proarc.permission.repository.search.groupOwner")) {
        filterMap.put(FILTER_PHRASE, i18n.DigitalObjectSearchView_FilterGroupPhrase_Title());
    }
    filterMap.put(FILTER_QUERY, i18n.DigitalObjectSearchView_FilterGroupAdvanced_Title());
    if (Editor.getInstance().hasPermission("proarc.permission.admin")) {
        filterMap.put(FILTER_DELETED, i18n.DigitalObjectSearchView_FilterGroupDeleted_Title());
    }
    filterType.setValueMap(filterMap);
    filterType.setValue(FILTER_LAST_CREATED);

    FormItemIfFunction showIfAdvanced = new StringMatchFunction(filterType, FILTER_QUERY, FILTER_DELETED);
    FormItemIfFunction showIfPhrase = new StringMatchFunction(filterType, FILTER_PHRASE);
    FormItemIfFunction showIfCreatedModifiedQuery = new StringMatchFunction(filterType, FILTER_LAST_CREATED, FILTER_LAST_MODIFIED, FILTER_QUERY, FILTER_DELETED, FILTER_ALPHABETICAL);
    FormItemIfFunction showIfAplhabetical = new StringMatchFunction(filterType, FILTER_LAST_CREATED, FILTER_LAST_MODIFIED, FILTER_ALPHABETICAL);

    final TextItem phrase = createAdvancedItem(DigitalObjectResourceApi.SEARCH_PHRASE_PARAM,
            i18n.DigitalObjectSearchView_FilterPhrase_Title(), showIfPhrase);
    phrase.setValidators(new RequiredIfValidator(new RequiredIfFunction() {

        @Override
        public boolean execute(FormItem formItem, Object value) {
            return FILTER_PHRASE.equals(filterType.getValueAsString());
        }
    }), new LengthRangeValidator() {{
        setMax(1000);
    }});

    SubmitItem submit = new SubmitItem("search", i18n.DigitalObjectSearchView_FilterSearchButton_Title());

    form.setFields(filterType, createSpacerItem("100%", null),
            phrase,
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_QUERY_TITLE_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedTitle_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_QUERY_IDENTIFIER_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedIdentifier_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_QUERY_CREATOR_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedCreator_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_QUERY_LABEL_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedLabel_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_OWNER_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedOwner_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createModelItem(i18n.DigitalObjectSearchView_FilterAdvancedModel_Title(), showIfCreatedModifiedQuery),
            createSortItem(i18n.DigitalObjectSearchView_FilterSort_Title(), showIfAplhabetical),
            createRememberModelItem(i18n.DigitalObjectSearchView_FilterAdvancedModel_Remember_Title(), showIfCreatedModifiedQuery),
            createSpacerItem("100%", showIfCreatedModifiedQuery),
            submit);
    
    form.addSubmitValuesHandler(new SubmitValuesHandler() {

        @Override
        public void onSubmitValues(SubmitValuesEvent event) {
            if (filters.validate(false)) {
                filter();
            }
        }
    });
    return form;
}