AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(RedmineCorePlugin.REPOSITORY_KIND);
if(connector instanceof RedmineRepositoryConnector) {
RedmineRepositoryConnector redmineConnector = (RedmineRepositoryConnector)connector;
redmineConnector.setTaskRepositoryLocationFactory(new TaskRepositoryLocationUiFactory());
TasksUi.getRepositoryManager().addListener(redmineConnector.getClientManager());
TasksUi.getRepositoryManager().addListener(RedmineCorePlugin.getDefault().getExtensionManager());
RedmineCorePlugin.getDefault().setConnector(redmineConnector);
}