test_class.declarator: PERSPECTIVE_ID = "Persp1"
test_class.modifier: private static final
test_class.original_string: private static final String PERSPECTIVE_ID = "Persp1";
test_class.type: String
test_class.var_name: PERSPECTIVE_ID
test_class.declarator: TEST_NAV_TREE = new NavTreeBuilder()
              .item(PERSPECTIVE_ID, "name1", "description1", true, perspective(PERSPECTIVE_ID))
              .build()
test_class.modifier: private static final
test_class.original_string: private static final NavTree TEST_NAV_TREE = new NavTreeBuilder()
              .item(PERSPECTIVE_ID, "name1", "description1", true, perspective(PERSPECTIVE_ID))
              .build();
test_class.type: NavTree
test_class.var_name: TEST_NAV_TREE
test_class.declarator: navigationManager
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private NavigationManager navigationManager;
test_class.type: NavigationManager
test_class.var_name: navigationManager
test_class.declarator: clientTypeRegistry
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ClientTypeRegistry clientTypeRegistry;
test_class.type: ClientTypeRegistry
test_class.var_name: clientTypeRegistry
test_class.declarator: pluginServices
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private PerspectivePluginServices pluginServices;
test_class.type: PerspectivePluginServices
test_class.var_name: pluginServices
test_class.declarator: perspectiveChangedEvent
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Event<PerspectivePluginsChangedEvent> perspectiveChangedEvent;
test_class.type: Event<PerspectivePluginsChangedEvent>
test_class.var_name: perspectiveChangedEvent
test_class.declarator: pluginAddedEvent
test_class.modifier: private
test_class.original_string: private PluginAdded pluginAddedEvent;
test_class.type: PluginAdded
test_class.var_name: pluginAddedEvent
test_class.declarator: pluginSavedEvent
test_class.modifier: private
test_class.original_string: private PluginSaved pluginSavedEvent;
test_class.type: PluginSaved
test_class.var_name: pluginSavedEvent
test_class.declarator: pluginRenamedEvent
test_class.modifier: private
test_class.original_string: private PluginRenamed pluginRenamedEvent;
test_class.type: PluginRenamed
test_class.var_name: pluginRenamedEvent
test_class.declarator: pluginDeletedEvent
test_class.modifier: private
test_class.original_string: private PluginDeleted pluginDeletedEvent;
test_class.type: PluginDeleted
test_class.var_name: pluginDeletedEvent
test_class.declarator: perspectivePlugin
test_class.modifier: private
test_class.original_string: private Plugin perspectivePlugin;
test_class.type: Plugin
test_class.var_name: perspectivePlugin
test_class.declarator: perspectiveRenamedPlugin
test_class.modifier: private
test_class.original_string: private Plugin perspectiveRenamedPlugin;
test_class.type: Plugin
test_class.var_name: perspectiveRenamedPlugin
test_class.declarator: testedPluginManager
test_class.modifier: private
test_class.original_string: private PerspectivePluginManager testedPluginManager;
test_class.type: PerspectivePluginManager
test_class.var_name: testedPluginManager
test_class.file: dashbuilder-client/dashbuilder-navigation-client/src/test/java/org/dashbuilder/client/navigation/plugin/PerspectivePluginManagerTest.java
test_class.identifier: PerspectivePluginManagerTest
test_case.body: @Test
      public void testPluginRenamed() {
          NavTree tree = TEST_NAV_TREE.cloneTree();
          List<NavItem> items = tree.searchItems(NavWorkbenchCtx.perspective(PERSPECTIVE_ID));
  
          assertThat((items).get(0).getName()).isEqualTo("name1");
          assertThat((items).get(0).getContext()).contains("resourceId=" + PERSPECTIVE_ID);
  
          when(navigationManager.getNavTree()).thenReturn(tree);
          testedPluginManager.onPlugInRenamed(pluginRenamedEvent);
  
          assertThat(tree.searchItems(NavWorkbenchCtx.perspective(PERSPECTIVE_ID))).isEmpty();
          assertThat(tree.searchItems(NavWorkbenchCtx.perspective(perspectiveRenamedPlugin.getName())).get(0).getContext()).contains("resourceId=" + perspectiveRenamedPlugin.getName());
  
          ArgumentCaptor<Command> argumentCaptor = ArgumentCaptor.forClass(Command.class);
  
          verify(navigationManager, times(1)).saveNavTree(anyObject(), argumentCaptor.capture());
          verify(perspectiveChangedEvent).fire(anyObject());
      }
test_case.class_method_signature: PerspectivePluginManagerTest.testPluginRenamed()
test_case.full_signature: @Test public void testPluginRenamed()
test_case.identifier: testPluginRenamed
test_case.invocations: cloneTree searchItems perspective isEqualTo assertThat getName get contains assertThat getContext get thenReturn when getNavTree onPlugInRenamed isEmpty assertThat searchItems perspective contains assertThat getContext get searchItems perspective getName getName forClass saveNavTree verify times anyObject capture fire verify anyObject
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPluginRenamed()
focal_class.declarator: clientTypeRegistry
focal_class.modifier: private
focal_class.original_string: private ClientTypeRegistry clientTypeRegistry;
focal_class.type: ClientTypeRegistry
focal_class.var_name: clientTypeRegistry
focal_class.declarator: layoutGenerator
focal_class.modifier: private
focal_class.original_string: private LayoutGenerator layoutGenerator;
focal_class.type: LayoutGenerator
focal_class.var_name: layoutGenerator
focal_class.declarator: navigationManager
focal_class.modifier: private
focal_class.original_string: private NavigationManager navigationManager;
focal_class.type: NavigationManager
focal_class.var_name: navigationManager
focal_class.declarator: pluginServices
focal_class.modifier: private
focal_class.original_string: private Caller<PerspectivePluginServices> pluginServices;
focal_class.type: Caller<PerspectivePluginServices>
focal_class.var_name: pluginServices
focal_class.declarator: perspectivesChangedEvent
focal_class.modifier: private
focal_class.original_string: private Event<PerspectivePluginsChangedEvent> perspectivesChangedEvent;
focal_class.type: Event<PerspectivePluginsChangedEvent>
focal_class.var_name: perspectivesChangedEvent
focal_class.declarator: pluginMap = new HashMap<>()
focal_class.modifier: private
focal_class.original_string: private Map<String, Plugin> pluginMap = new HashMap<>();
focal_class.type: Map<String, Plugin>
focal_class.var_name: pluginMap
focal_class.declarator: pluginsLoaded = false
focal_class.modifier: private
focal_class.original_string: private boolean pluginsLoaded = false;
focal_class.type: boolean
focal_class.var_name: pluginsLoaded
focal_class.declarator: navGroupStack = new Stack<>()
focal_class.modifier: private
focal_class.original_string: private Stack<NavGroup> navGroupStack = new Stack<>();
focal_class.type: Stack<NavGroup>
focal_class.var_name: navGroupStack
focal_class.file: dashbuilder-client/dashbuilder-navigation-client/src/main/java/org/dashbuilder/client/navigation/plugin/PerspectivePluginManager.java
focal_class.identifier: PerspectivePluginManager
focal_class.class_method_signature: PerspectivePluginManager.PerspectivePluginManager(ClientTypeRegistry clientTypeRegistry,
                                      LayoutGenerator layoutGenerator,
                                      NavigationManager navigationManager,
                                      Caller<PerspectivePluginServices> pluginServices,
                                      Event<PerspectivePluginsChangedEvent> perspectivesChangedEvent)
focal_class.full_signature: @Inject public  PerspectivePluginManager(ClientTypeRegistry clientTypeRegistry,
                                      LayoutGenerator layoutGenerator,
                                      NavigationManager navigationManager,
                                      Caller<PerspectivePluginServices> pluginServices,
                                      Event<PerspectivePluginsChangedEvent> perspectivesChangedEvent)
focal_class.identifier: PerspectivePluginManager
focal_class.modifiers: @Inject public
focal_class.parameters: (ClientTypeRegistry clientTypeRegistry,
                                      LayoutGenerator layoutGenerator,
                                      NavigationManager navigationManager,
                                      Caller<PerspectivePluginServices> pluginServices,
                                      Event<PerspectivePluginsChangedEvent> perspectivesChangedEvent)
focal_class.signature:  PerspectivePluginManager(ClientTypeRegistry clientTypeRegistry,
                                      LayoutGenerator layoutGenerator,
                                      NavigationManager navigationManager,
                                      Caller<PerspectivePluginServices> pluginServices,
                                      Event<PerspectivePluginsChangedEvent> perspectivesChangedEvent)
focal_class.class_method_signature: PerspectivePluginManager.init()
focal_class.full_signature: @PostConstruct private void init()
focal_class.identifier: init
focal_class.modifiers: @PostConstruct private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: PerspectivePluginManager.getPerspectivePlugins(ParameterizedCommand<Collection<Plugin>> callback)
focal_class.full_signature: public void getPerspectivePlugins(ParameterizedCommand<Collection<Plugin>> callback)
focal_class.identifier: getPerspectivePlugins
focal_class.modifiers: public
focal_class.parameters: (ParameterizedCommand<Collection<Plugin>> callback)
focal_class.return: void
focal_class.signature: void getPerspectivePlugins(ParameterizedCommand<Collection<Plugin>> callback)
focal_class.class_method_signature: PerspectivePluginManager.loadPlugins(ParameterizedCommand<Collection<Plugin>> callback)
focal_class.full_signature: private void loadPlugins(ParameterizedCommand<Collection<Plugin>> callback)
focal_class.identifier: loadPlugins
focal_class.modifiers: private
focal_class.parameters: (ParameterizedCommand<Collection<Plugin>> callback)
focal_class.return: void
focal_class.signature: void loadPlugins(ParameterizedCommand<Collection<Plugin>> callback)
focal_class.class_method_signature: PerspectivePluginManager.isRuntimePerspective(Plugin plugin)
focal_class.full_signature: public boolean isRuntimePerspective(Plugin plugin)
focal_class.identifier: isRuntimePerspective
focal_class.modifiers: public
focal_class.parameters: (Plugin plugin)
focal_class.return: boolean
focal_class.signature: boolean isRuntimePerspective(Plugin plugin)
focal_class.class_method_signature: PerspectivePluginManager.isRuntimePerspective(NavItem navItem)
focal_class.full_signature: public boolean isRuntimePerspective(NavItem navItem)
focal_class.identifier: isRuntimePerspective
focal_class.modifiers: public
focal_class.parameters: (NavItem navItem)
focal_class.return: boolean
focal_class.signature: boolean isRuntimePerspective(NavItem navItem)
focal_class.class_method_signature: PerspectivePluginManager.isRuntimePerspective(String perspectiveId)
focal_class.full_signature: public boolean isRuntimePerspective(String perspectiveId)
focal_class.identifier: isRuntimePerspective
focal_class.modifiers: public
focal_class.parameters: (String perspectiveId)
focal_class.return: boolean
focal_class.signature: boolean isRuntimePerspective(String perspectiveId)
focal_class.class_method_signature: PerspectivePluginManager.getRuntimePerspectiveId(NavItem navItem)
focal_class.full_signature: public String getRuntimePerspectiveId(NavItem navItem)
focal_class.identifier: getRuntimePerspectiveId
focal_class.modifiers: public
focal_class.parameters: (NavItem navItem)
focal_class.return: String
focal_class.signature: String getRuntimePerspectiveId(NavItem navItem)
focal_class.class_method_signature: PerspectivePluginManager.existsPerspectivePlugin(String perspectiveName)
focal_class.full_signature: public boolean existsPerspectivePlugin(String perspectiveName)
focal_class.identifier: existsPerspectivePlugin
focal_class.modifiers: public
focal_class.parameters: (String perspectiveName)
focal_class.return: boolean
focal_class.signature: boolean existsPerspectivePlugin(String perspectiveName)
focal_class.class_method_signature: PerspectivePluginManager.buildPerspectiveWidget(String perspectiveName, ParameterizedCommand<IsWidget> afterBuild, ParameterizedCommand<LayoutRecursionIssue> onInfiniteRecursion)
focal_class.full_signature: public void buildPerspectiveWidget(String perspectiveName, ParameterizedCommand<IsWidget> afterBuild, ParameterizedCommand<LayoutRecursionIssue> onInfiniteRecursion)
focal_class.identifier: buildPerspectiveWidget
focal_class.modifiers: public
focal_class.parameters: (String perspectiveName, ParameterizedCommand<IsWidget> afterBuild, ParameterizedCommand<LayoutRecursionIssue> onInfiniteRecursion)
focal_class.return: void
focal_class.signature: void buildPerspectiveWidget(String perspectiveName, ParameterizedCommand<IsWidget> afterBuild, ParameterizedCommand<LayoutRecursionIssue> onInfiniteRecursion)
focal_class.class_method_signature: PerspectivePluginManager.getLayoutTemplateInfo(String perspectiveName, ParameterizedCommand<LayoutTemplateInfo> callback)
focal_class.full_signature: public void getLayoutTemplateInfo(String perspectiveName, ParameterizedCommand<LayoutTemplateInfo> callback)
focal_class.identifier: getLayoutTemplateInfo
focal_class.modifiers: public
focal_class.parameters: (String perspectiveName, ParameterizedCommand<LayoutTemplateInfo> callback)
focal_class.return: void
focal_class.signature: void getLayoutTemplateInfo(String perspectiveName, ParameterizedCommand<LayoutTemplateInfo> callback)
focal_class.class_method_signature: PerspectivePluginManager.getLayoutTemplateInfo(LayoutTemplate layoutTemplate, ParameterizedCommand<LayoutTemplateInfo> callback)
focal_class.full_signature: public void getLayoutTemplateInfo(LayoutTemplate layoutTemplate, ParameterizedCommand<LayoutTemplateInfo> callback)
focal_class.identifier: getLayoutTemplateInfo
focal_class.modifiers: public
focal_class.parameters: (LayoutTemplate layoutTemplate, ParameterizedCommand<LayoutTemplateInfo> callback)
focal_class.return: void
focal_class.signature: void getLayoutTemplateInfo(LayoutTemplate layoutTemplate, ParameterizedCommand<LayoutTemplateInfo> callback)
focal_class.class_method_signature: PerspectivePluginManager.buildPerspectiveWidget(String perspectiveName, LayoutTemplateContext layoutCtx, ParameterizedCommand<IsWidget> afterBuild, ParameterizedCommand<LayoutRecursionIssue> onInfiniteRecursion)
focal_class.full_signature: public void buildPerspectiveWidget(String perspectiveName, LayoutTemplateContext layoutCtx, ParameterizedCommand<IsWidget> afterBuild, ParameterizedCommand<LayoutRecursionIssue> onInfiniteRecursion)
focal_class.identifier: buildPerspectiveWidget
focal_class.modifiers: public
focal_class.parameters: (String perspectiveName, LayoutTemplateContext layoutCtx, ParameterizedCommand<IsWidget> afterBuild, ParameterizedCommand<LayoutRecursionIssue> onInfiniteRecursion)
focal_class.return: void
focal_class.signature: void buildPerspectiveWidget(String perspectiveName, LayoutTemplateContext layoutCtx, ParameterizedCommand<IsWidget> afterBuild, ParameterizedCommand<LayoutRecursionIssue> onInfiniteRecursion)
focal_class.class_method_signature: PerspectivePluginManager.getLastBuildPerspectiveNavGroup()
focal_class.full_signature: public NavGroup getLastBuildPerspectiveNavGroup()
focal_class.identifier: getLastBuildPerspectiveNavGroup
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: NavGroup
focal_class.signature: NavGroup getLastBuildPerspectiveNavGroup()
focal_class.class_method_signature: PerspectivePluginManager.onPlugInAdded(@Observes final PluginAdded event)
focal_class.full_signature: public void onPlugInAdded(@Observes final PluginAdded event)
focal_class.identifier: onPlugInAdded
focal_class.modifiers: public
focal_class.parameters: (@Observes final PluginAdded event)
focal_class.return: void
focal_class.signature: void onPlugInAdded(@Observes final PluginAdded event)
focal_class.class_method_signature: PerspectivePluginManager.onPlugInSaved(@Observes final PluginSaved event)
focal_class.full_signature: public void onPlugInSaved(@Observes final PluginSaved event)
focal_class.identifier: onPlugInSaved
focal_class.modifiers: public
focal_class.parameters: (@Observes final PluginSaved event)
focal_class.return: void
focal_class.signature: void onPlugInSaved(@Observes final PluginSaved event)
focal_class.class_method_signature: PerspectivePluginManager.onPlugInRenamed(@Observes final PluginRenamed event)
focal_class.full_signature: public void onPlugInRenamed(@Observes final PluginRenamed event)
focal_class.identifier: onPlugInRenamed
focal_class.modifiers: public
focal_class.parameters: (@Observes final PluginRenamed event)
focal_class.return: void
focal_class.signature: void onPlugInRenamed(@Observes final PluginRenamed event)
focal_class.class_method_signature: PerspectivePluginManager.onPlugInDeleted(@Observes final PluginDeleted event)
focal_class.full_signature: public void onPlugInDeleted(@Observes final PluginDeleted event)
focal_class.identifier: onPlugInDeleted
focal_class.modifiers: public
focal_class.parameters: (@Observes final PluginDeleted event)
focal_class.return: void
focal_class.signature: void onPlugInDeleted(@Observes final PluginDeleted event)
focal_method.body: public void onPlugInRenamed(@Observes final PluginRenamed event) {
          Plugin plugin = event.getPlugin();
          if (isRuntimePerspective(plugin)) {
              pluginMap.remove(event.getOldPluginName());
              pluginMap.put(plugin.getName(), plugin);
  
              NavWorkbenchCtx ctx = NavWorkbenchCtx.perspective(event.getOldPluginName());
              NavWorkbenchCtx newCtx = NavWorkbenchCtx.perspective(event.getPlugin().getName());
              List<NavItem> itemsToRename = navigationManager.getNavTree().searchItems(ctx);
              for (NavItem navItem : itemsToRename) {
                  navItem.setContext(newCtx.toString());
              }
              if (!itemsToRename.isEmpty()) {
                  navigationManager.saveNavTree(navigationManager.getNavTree(), () -> {});
              }
              perspectivesChangedEvent.fire(new PerspectivePluginsChangedEvent());
          }
      }
focal_method.class_method_signature: PerspectivePluginManager.onPlugInRenamed(@Observes final PluginRenamed event)
focal_method.full_signature: public void onPlugInRenamed(@Observes final PluginRenamed event)
focal_method.identifier: onPlugInRenamed
focal_method.invocations: getPlugin isRuntimePerspective remove getOldPluginName put getName perspective getOldPluginName perspective getName getPlugin searchItems getNavTree setContext toString isEmpty saveNavTree getNavTree fire
focal_method.modifiers: public
focal_method.parameters: (@Observes final PluginRenamed event)
focal_method.return: void
focal_method.signature: void onPlugInRenamed(@Observes final PluginRenamed event)