public List<ConfigurationUIFactory> getConfigurationUIFactoriesForConfigurable(Configurable configurable) { List<ConfigurationUIFactory> result = new ArrayList<ConfigurationUIFactory>(); for (ConfigurationUIFactory factory : getConfigurationUIFactories()) { if (factory.canHandle(configurable.getUUID())) { result.add(factory); } } return result; }
for (ConfigurationUIFactory fac : ConfigurationUIRegistry.getInstance().getConfigurationUIFactories()) { String name=fac.getConfigurable().getDisplayName(); if (name!=null) {
@Test public void testFoundByRegistry() { List<ConfigurationUIFactory> list = ConfigurationUIRegistry.getInstance().getConfigurationUIFactories(); assertTrue("There should be at least 1 item in the list",list.size()>=1); boolean found=false; for (ConfigurationUIFactory f : list) { if (f instanceof WorkbenchConfigurationUIFactory) { found=true; break; } } assertTrue("The WorkbenchConfigurationUIFactory was not found",found); } }
@Test public void testFoundByRegistry() { List<ConfigurationUIFactory> list = ConfigurationUIRegistry.getInstance().getConfigurationUIFactories(); assertTrue("There should be at least 1 item in the list",list.size()>=1); boolean found=false; for (ConfigurationUIFactory f : list) { if (f instanceof WorkbenchConfigurationUIFactory) { found=true; break; } } assertTrue("The WorkbenchConfigurationUIFactory was not found",found); } }
@Test public void testGetAll() { List<ConfigurationUIFactory> list = ConfigurationUIRegistry.getInstance().getConfigurationUIFactories(); assertNotNull(list); assertTrue("There should be at least 2 ConfigurationUI's in the list",list.size()>=2); boolean found=false; for (ConfigurationUIFactory f : list) { if (f instanceof DummyUIFactory1) { found=true; break; } } assertTrue("There should be a DummyUIFactory1 in the list",found); found=false; for (ConfigurationUIFactory f : list) { if (f instanceof DummyUIFactory1) { found=true; break; } } assertTrue("There should be a DummyUIFactory2 in the list",found); }
@Test public void testGetAll() { List<ConfigurationUIFactory> list = ConfigurationUIRegistry.getInstance().getConfigurationUIFactories(); assertNotNull(list); assertTrue("There should be at least 2 ConfigurationUI's in the list",list.size()>=2); boolean found=false; for (ConfigurationUIFactory f : list) { if (f instanceof DummyUIFactory1) { found=true; break; } } assertTrue("There should be a DummyUIFactory1 in the list",found); found=false; for (ConfigurationUIFactory f : list) { if (f instanceof DummyUIFactory1) { found=true; break; } } assertTrue("There should be a DummyUIFactory2 in the list",found); }