/** * Determines if a given string contains only explicitly listed locales. * If the given strin contains only explicitly listed locales (no regex patterns or masks), then returns * a string with a space-delimited list of locale tags of those locales. * If there's at least one mask or pattern, an empty string is returned. * @param string the given locale filter configuration string. See {@link #fromString} for details. * @return a string with a space-delimited list of locale tags allowed by this locale filter. */ public static String getExplicitLocaleIds(String string) { LocaleFilter filter = new LocaleFilter(string); return ListUtil.listAsString(filter.getExplicitLocaleIds(), " "); } }
String explicitLocales = LocaleFilter.getExplicitLocaleIds(langE.getText()); if (!Util.isEmpty(explicitLocales)) SWTUtil.setText(langE, explicitLocales);