test_class.declarator: radioListView
test_class.modifier: @Mock
test_class.original_string: @Mock
      RendererSelector.RadioListView radioListView;
test_class.type: RendererSelector.RadioListView
test_class.var_name: radioListView
test_class.declarator: tabListView
test_class.modifier: @Mock
test_class.original_string: @Mock
      RendererSelector.TabListView tabListView;
test_class.type: RendererSelector.TabListView
test_class.var_name: tabListView
test_class.declarator: listBoxView
test_class.modifier: @Mock
test_class.original_string: @Mock
      RendererSelector.ListBoxView listBoxView;
test_class.type: RendererSelector.ListBoxView
test_class.var_name: listBoxView
test_class.declarator: rendererManager
test_class.modifier: @Mock
test_class.original_string: @Mock
      RendererManager rendererManager;
test_class.type: RendererManager
test_class.var_name: rendererManager
test_class.declarator: selectCommand
test_class.modifier: @Mock
test_class.original_string: @Mock
      Command selectCommand;
test_class.type: Command
test_class.var_name: selectCommand
test_class.declarator: gwtLib = new RendererLibMock("gwt")
test_class.original_string: RendererLibMock gwtLib = new RendererLibMock("gwt");
test_class.type: RendererLibMock
test_class.var_name: gwtLib
test_class.declarator: d3Lib = new RendererLibMock("d3")
test_class.original_string: RendererLibMock d3Lib = new RendererLibMock("d3");
test_class.type: RendererLibMock
test_class.var_name: d3Lib
test_class.declarator: lienzoLib = new RendererLibMock("lienzo")
test_class.original_string: RendererLibMock lienzoLib = new RendererLibMock("lienzo");
test_class.type: RendererLibMock
test_class.var_name: lienzoLib
test_class.declarator: settings = DisplayerSettingsFactory
              .newPieChartSettings()
              .renderer("d3")
              .buildSettings()
test_class.original_string: DisplayerSettings settings = DisplayerSettingsFactory
              .newPieChartSettings()
              .renderer("d3")
              .buildSettings();
test_class.type: DisplayerSettings
test_class.var_name: settings
test_class.declarator: presenter
test_class.original_string: RendererSelector presenter;
test_class.type: RendererSelector
test_class.var_name: presenter
test_class.file: dashbuilder-client/dashbuilder-displayer-client/src/test/java/org/dashbuilder/displayer/client/widgets/RendererSelectorTest.java
test_class.identifier: RendererSelectorTest
test_case.body: @Test
      public void testMultipleRenderers() {
          List<RendererLibrary> rendererLibs = Arrays.asList((RendererLibrary) gwtLib, d3Lib, lienzoLib);
          when(rendererManager.getRenderersForType(any(DisplayerType.class), any(DisplayerSubType.class))).thenReturn(rendererLibs);
          when(rendererManager.getRendererForDisplayer(settings)).thenReturn(d3Lib);
  
          presenter.init(settings, RendererSelector.SelectorType.LIST, 300, selectCommand);
  
          verify(listBoxView).setVisible(true);
          verify(listBoxView).setWidth(300);
          verify(listBoxView).clearRendererSelector();
          verify(listBoxView).addRendererItem("gwt");
          verify(listBoxView).addRendererItem("d3");
          verify(listBoxView).addRendererItem("lienzo");
          verify(listBoxView).setSelectedRendererIndex(1);
  
          verifyZeroInteractions(tabListView, radioListView);
      }
test_case.class_method_signature: RendererSelectorTest.testMultipleRenderers()
test_case.full_signature: @Test public void testMultipleRenderers()
test_case.identifier: testMultipleRenderers
test_case.invocations: asList thenReturn when getRenderersForType any any thenReturn when getRendererForDisplayer init setVisible verify setWidth verify clearRendererSelector verify addRendererItem verify addRendererItem verify addRendererItem verify setSelectedRendererIndex verify verifyZeroInteractions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMultipleRenderers()
focal_class.declarator: tabListView
focal_class.original_string: View tabListView;
focal_class.type: View
focal_class.var_name: tabListView
focal_class.declarator: listBoxView
focal_class.original_string: View listBoxView;
focal_class.type: View
focal_class.var_name: listBoxView
focal_class.declarator: radioListView
focal_class.original_string: View radioListView;
focal_class.type: View
focal_class.var_name: radioListView
focal_class.declarator: view
focal_class.original_string: View view;
focal_class.type: View
focal_class.var_name: view
focal_class.declarator: rendererManager
focal_class.original_string: RendererManager rendererManager;
focal_class.type: RendererManager
focal_class.var_name: rendererManager
focal_class.declarator: rendererLibrary
focal_class.original_string: RendererLibrary rendererLibrary;
focal_class.type: RendererLibrary
focal_class.var_name: rendererLibrary
focal_class.declarator: selectCommand
focal_class.original_string: Command selectCommand;
focal_class.type: Command
focal_class.var_name: selectCommand
focal_class.file: dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/widgets/RendererSelector.java
focal_class.identifier: RendererSelector
focal_class.interfaces: implements IsWidget
focal_class.class_method_signature: RendererSelector.RendererSelector(TabListView tabListView,
                              ListBoxView listBoxView,
                              RadioListView radioListView,
                              RendererManager rendererManager)
focal_class.full_signature: @Inject public  RendererSelector(TabListView tabListView,
                              ListBoxView listBoxView,
                              RadioListView radioListView,
                              RendererManager rendererManager)
focal_class.identifier: RendererSelector
focal_class.modifiers: @Inject public
focal_class.parameters: (TabListView tabListView,
                              ListBoxView listBoxView,
                              RadioListView radioListView,
                              RendererManager rendererManager)
focal_class.signature:  RendererSelector(TabListView tabListView,
                              ListBoxView listBoxView,
                              RadioListView radioListView,
                              RendererManager rendererManager)
focal_class.class_method_signature: RendererSelector.asWidget()
focal_class.full_signature: @Override public Widget asWidget()
focal_class.identifier: asWidget
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Widget
focal_class.signature: Widget asWidget()
focal_class.class_method_signature: RendererSelector.getRendererLibrary()
focal_class.full_signature: public RendererLibrary getRendererLibrary()
focal_class.identifier: getRendererLibrary
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: RendererLibrary
focal_class.signature: RendererLibrary getRendererLibrary()
focal_class.class_method_signature: RendererSelector.init(DisplayerSettings displayerSettings,
                       SelectorType selectorType, int width,
                       Command onSelectCommand)
focal_class.full_signature: public void init(DisplayerSettings displayerSettings,
                       SelectorType selectorType, int width,
                       Command onSelectCommand)
focal_class.identifier: init
focal_class.modifiers: public
focal_class.parameters: (DisplayerSettings displayerSettings,
                       SelectorType selectorType, int width,
                       Command onSelectCommand)
focal_class.return: void
focal_class.signature: void init(DisplayerSettings displayerSettings,
                       SelectorType selectorType, int width,
                       Command onSelectCommand)
focal_class.class_method_signature: RendererSelector.onRendererSelected()
focal_class.full_signature:  void onRendererSelected()
focal_class.identifier: onRendererSelected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onRendererSelected()
focal_method.body: 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);
          }
      }
focal_method.class_method_signature: RendererSelector.init(DisplayerSettings displayerSettings,
                       SelectorType selectorType, int width,
                       Command onSelectCommand)
focal_method.full_signature: public void init(DisplayerSettings displayerSettings,
                       SelectorType selectorType, int width,
                       Command onSelectCommand)
focal_method.identifier: init
focal_method.invocations: init getRendererForDisplayer getRenderersForType getType getSubtype size setVisible setWidth clearRendererSelector size get addRendererItem getName equals setSelectedRendererIndex setVisible
focal_method.modifiers: public
focal_method.parameters: (DisplayerSettings displayerSettings,
                       SelectorType selectorType, int width,
                       Command onSelectCommand)
focal_method.return: void
focal_method.signature: void init(DisplayerSettings displayerSettings,
                       SelectorType selectorType, int width,
                       Command onSelectCommand)