public DomainChart newDomainChart(Domain domain) { DomainChart result = null; DomainUI domainUI = getDomainUI(domain.getType()); try { result = (DomainChart) domainUI .getRegistry() .getConfiguration() .createExecutableExtension(EDomainUIElements.chart.toString()); } catch (CoreException e) { e.printStackTrace(); return null; } return result; }
private DomainUI initializeDomainUI(String domain) { try { DomainUI domainUI = new DomainUI(); DomainUIRegistryExtension domainUIRegistry = getRegistry(domain); domainUI.setDomain(domain); String plugin = domainUIRegistry.getConfiguration().getContributor().getName(); String pathIcon = domainUIRegistry.getElement(EDomainUIElements.icon); domainUI.setIcon(plugin, pathIcon); domainUI.setRegistry(domainUIRegistry); _domainUIs.put(domain, domainUI); return domainUI; } catch (Exception e) { return null; } }