private ComboBox createSiteSelect(CmsObject cms) {

        final IndexedContainer availableSites = CmsVaadinUtils.getAvailableSitesContainer(cms, SITE_CAPTION);
        ComboBox combo = new ComboBox(null, availableSites);
        combo.setTextInputAllowed(true);
        combo.setNullSelectionAllowed(false);
        combo.setWidth("200px");
        combo.setInputPrompt(
            Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_CLICK_TO_EDIT_0));
        combo.setItemCaptionPropertyId(SITE_CAPTION);
        combo.select(cms.getRequestContext().getSiteRoot());
        combo.setFilteringMode(FilteringMode.CONTAINS);
        combo.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                String value = (String)event.getProperty().getValue();
                if (availableSites.containsId(value)) {
                    changeSite(value, null);
                    m_appContext.updateOnChange();
                    availableSites.removeAllContainerFilters();
                }
            }
        });
        if (Page.getCurrent().getBrowserWindowHeight() > 650) {
            combo.setPageLength(20);
        }
        return combo;
    }
private ComboBox createSiteSelect ( CmsObject cms ) { final IndexedContainer availableSites = CmsVaadinUtils . getAvailableSitesContainer ( cms , SITE_CAPTION ) ; ComboBox combo = new ComboBox ( null , availableSites ) ; combo . setTextInputAllowed ( true ) ; combo . setNullSelectionAllowed ( false ) ; combo . setWidth ( "200px" ) ; combo . setInputPrompt ( Messages . get ( ) . getBundle ( UI . getCurrent ( ) . getLocale ( ) ) . key ( Messages . GUI_EXPLORER_CLICK_TO_EDIT_0 ) ) ; combo . setItemCaptionPropertyId ( SITE_CAPTION ) ; combo . select ( cms . getRequestContext ( ) . getSiteRoot ( ) ) ; combo . setFilteringMode ( FilteringMode . CONTAINS ) ; combo . addValueChangeListener ( new ValueChangeListener ( ) { private static final long serialVersionUID = 1L ; public void valueChange ( ValueChangeEvent event ) { String value = ( String ) event . getProperty ( ) . getValue ( ) ; if ( availableSites . containsId ( value ) ) { changeSite ( value , null ) ; m_appContext . updateOnChange ( ) ; availableSites . removeAllContainerFilters ( ) ; } } } ) ; if ( Page . getCurrent ( ) . getBrowserWindowHeight ( ) > 650 ) { combo . setPageLength ( 20 ) ; } return combo ; }
Creates the site selector combo box.<p>

@param cms the current cms context

@return the combo box