/**
* Initializes registris.
*/
private void initRegistry() {
final ComponentSelector componentTreeViewer = this.gui.getComponentSelector();
try {
this.componentRegistry = new SystemComponentRegistry();
// This does not take time, so we can do it in the same thread.
this.systemComponentTree = this.componentRegistry.getComponentTree();
componentTreeViewer.addComponentTree(0, this.systemComponentTree);
componentTreeViewer.addComponentTree(1, new AmazonComponentRegistry().getComponentTree());
} catch (RuntimeException e) {
// This should not happen
e.printStackTrace();
getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
}
List<String> localRegistryPaths = this.configuration.getLocalRegistry();
for (String path : localRegistryPaths) {
try {
LocalComponentRegistry registry = new LocalComponentRegistry(path);
// XXX This might take time, so it's better to move to another
// thread.
ComponentTreeNode componentTree = registry.getComponentTree();
componentTreeViewer.addComponentTree(componentTree);
} catch (ComponentRegistryException e) {
getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
} catch (RuntimeException e) {
getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
}