protected List<CmsSelectWidgetOption> parseSelectOptions(
        CmsObject cms,
        I_CmsWidgetDialog widgetDialog,
        I_CmsWidgetParameter param,
        boolean allRemoved) {

        String path = getResourcePath(cms, widgetDialog);
        try {
            cms = OpenCms.initCmsObject(cms);
            cms.getRequestContext().setSiteRoot("");
            CmsADEConfigData adeConfig = OpenCms.getADEManager().lookupConfiguration(cms, path);
            if (adeConfig.parent() != null) {
                adeConfig = adeConfig.parent();
            }
            Set<String> added = new HashSet<String>();
            List<CmsSelectWidgetOption> options = Lists.newArrayList();
            options.add(new CmsSelectWidgetOption("", true, getMessage(cms, Messages.GUI_FORMATTER_EMPTY_SELECTION_0)));
            List<CmsSelectWidgetOption> formatterOptions = getFormatterOptions(cms, adeConfig, path, allRemoved);
            options.addAll(formatterOptions);
            List<CmsSelectWidgetOption> typeOptions = getTypeOptions(cms, adeConfig, allRemoved);
            options.addAll(typeOptions);
            for (CmsSelectWidgetOption option : options) {
                added.add(option.getValue());
            }
            try {
                CmsResource content = cms.readResource(path);
                CmsFile contentFile = cms.readFile(content);
                CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(cms, contentFile);
                CmsConfigurationReader reader = new CmsConfigurationReader(cms);
                Set<String> selected = getSelectedInFile(reader, xmlContent);
                for (String formatterKey : selected) {
                    if (CmsUUID.isValidUUID(formatterKey)) {
                        CmsFormatterConfigurationCacheState cacheState = OpenCms.getADEManager().getCachedFormatters(
                            cms.getRequestContext().getCurrentProject().isOnlineProject());
                        CmsUUID mapKey = new CmsUUID(formatterKey);
                        I_CmsFormatterBean formatter = cacheState.getFormatters().get(mapKey);
                        if (formatter != null) {
                            try {
                                CmsSelectWidgetOption option = A_CmsFormatterWidget.getWidgetOptionForFormatter(
                                    cms,
                                    formatter);

                                if (!added.contains(option.getValue())) {
                                    options.add(option);
                                }
                            } catch (Exception e) {
                                LOG.error(e.getLocalizedMessage(), e);
                            }
                        }
                    }

                }

            } catch (CmsException e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
            return options;
        } catch (CmsException e) {
            // should never happen
            LOG.error(e.getLocalizedMessage(), e);
            return null;
        }
    }
protected List < CmsSelectWidgetOption > parseSelectOptions ( CmsObject cms , I_CmsWidgetDialog widgetDialog , I_CmsWidgetParameter param , boolean allRemoved ) { String path = getResourcePath ( cms , widgetDialog ) ; try { cms = OpenCms . initCmsObject ( cms ) ; cms . getRequestContext ( ) . setSiteRoot ( "" ) ; CmsADEConfigData adeConfig = OpenCms . getADEManager ( ) . lookupConfiguration ( cms , path ) ; if ( adeConfig . parent ( ) != null ) { adeConfig = adeConfig . parent ( ) ; } Set < String > added = new HashSet < String > ( ) ; List < CmsSelectWidgetOption > options = Lists . newArrayList ( ) ; options . add ( new CmsSelectWidgetOption ( "" , true , getMessage ( cms , Messages . GUI_FORMATTER_EMPTY_SELECTION_0 ) ) ) ; List < CmsSelectWidgetOption > formatterOptions = getFormatterOptions ( cms , adeConfig , path , allRemoved ) ; options . addAll ( formatterOptions ) ; List < CmsSelectWidgetOption > typeOptions = getTypeOptions ( cms , adeConfig , allRemoved ) ; options . addAll ( typeOptions ) ; for ( CmsSelectWidgetOption option : options ) { added . add ( option . getValue ( ) ) ; } try { CmsResource content = cms . readResource ( path ) ; CmsFile contentFile = cms . readFile ( content ) ; CmsXmlContent xmlContent = CmsXmlContentFactory . unmarshal ( cms , contentFile ) ; CmsConfigurationReader reader = new CmsConfigurationReader ( cms ) ; Set < String > selected = getSelectedInFile ( reader , xmlContent ) ; for ( String formatterKey : selected ) { if ( CmsUUID . isValidUUID ( formatterKey ) ) { CmsFormatterConfigurationCacheState cacheState = OpenCms . getADEManager ( ) . getCachedFormatters ( cms . getRequestContext ( ) . getCurrentProject ( ) . isOnlineProject ( ) ) ; CmsUUID mapKey = new CmsUUID ( formatterKey ) ; I_CmsFormatterBean formatter = cacheState . getFormatters ( ) . get ( mapKey ) ; if ( formatter != null ) { try { CmsSelectWidgetOption option = A_CmsFormatterWidget . getWidgetOptionForFormatter ( cms , formatter ) ; if ( ! added . contains ( option . getValue ( ) ) ) { options . add ( option ) ; } } catch ( Exception e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } } } } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } return options ; } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; return null ; } }
Returns the list of configured select options, parsing the configuration String if required.<p>

The list elements are of type <code>{@link CmsSelectWidgetOption}</code>.
The configuration String is parsed only once and then stored internally.<p>

@param cms the current users OpenCms context
@param widgetDialog the dialog of this widget
@param param the widget parameter of this dialog
@param allRemoved flag, indicating if all inheritedly available formatters should be disabled

@return the list of select options

@see CmsSelectWidgetOption