class RendererSelector implements IsWidget {

    public void init(DisplayerSettings displayerSettings,
                     SelectorType selectorType, int width,
                     Command onSelectCommand) {

        // Choose the target view
        switch (selectorType) {
            case LIST:
                view = listBoxView;
                break;
            case RADIO:
                view = radioListView;
                break;
            case TAB:
                view = tabListView;
                break;
        }

        this.view.init(this);
        this.selectCommand = onSelectCommand;

        RendererLibrary rendererLibrary = rendererManager.getRendererForDisplayer(displayerSettings);
        List<RendererLibrary> renderers = rendererManager.getRenderersForType(displayerSettings.getType(), displayerSettings.getSubtype());
        if (renderers != null && renderers.size() > 1) {

            view.setVisible(true);
            view.setWidth(width);
            view.clearRendererSelector();

            // Build the selector
            for (int i=0; i<renderers.size(); i++) {
                RendererLibrary rendererLib = renderers.get(i);
                view.addRendererItem(rendererLib.getName());

                if (rendererLibrary != null && rendererLib.equals(rendererLibrary)) {
                    view.setSelectedRendererIndex(i);
                }
            }
        }
        // If there is only one renderer in the list, do not show the selector.
        else {
            view.setVisible(false);
        }
    }

    @Inject public  RendererSelector(TabListView tabListView,
                            ListBoxView listBoxView,
                            RadioListView radioListView,
                            RendererManager rendererManager);

}