PerspectiveTreeProvider implements PermissionTreeProvider { public String getPerspectiveName(String perspectiveId) { if (perspectiveNameMap.containsKey(perspectiveId)) { return perspectiveNameMap.get(perspectiveId); } SyncBeanDef<Activity> beanDef = activityBeansCache.getActivity(perspectiveId); if (beanDef != null) { Activity activity = beanDef.getInstance(); if (activity != null && !(activity instanceof AbstractWorkbenchPerspectiveActivity)) { return perspectiveId; } } int lastDot = perspectiveId.lastIndexOf("."); return lastDot != -1 ? perspectiveId.substring(lastDot + 1) : perspectiveId; } PerspectiveTreeProvider(); @Inject  PerspectiveTreeProvider(ActivityBeansCache activityBeansCache,
                                   PermissionManager permissionManager,
                                   PermissionTreeI18n i18n); boolean isActive(); void setActive(boolean active); String getResourceName(); void setResourceName(String resourceName); String getRootNodeName(); void setRootNodeName(String rootNodeName); int getRootNodePosition(); void setRootNodePosition(int rootNodePosition); void excludePerspectiveId(String perspectiveId); Set<String> getPerspectiveIdsExcluded(); @Override PermissionNode buildRootNode(); @Override void loadChildren(PermissionNode parent,
                             LoadOptions options,
                             LoadCallback callback); String getPerspectiveName(String perspectiveId); void setPerspectiveName(String perspectiveId,
                                   String name);  }
@Test public void testPerspectiveName() { String name = provider.getPerspectiveName("Perspective1"); assertEquals(name, "A nice perspective"); name = provider.getPerspectiveName("Perspective2"); assertEquals(name, "Another nice perspective"); name = provider.getPerspectiveName("org.Perspective3"); assertEquals(name, "org.Perspective3"); name = provider.getPerspectiveName("org.Perspective4"); assertEquals(name, "Perspective4"); }