}
@Override
public boolean performDrop( Object data ) {
IServiceFactory serviceFactory = CatalogPlugin.getDefault().getServiceFactory();
IRepository local = CatalogPlugin.getDefault().getLocal();
if (data instanceof URL) {
URL url = (URL) data;
try {
local.acquire( url, null ); // add to catalog if needed
} catch (IOException e) {
CatalogUIPlugin.log( "Drag and Drop "+url, e);
}
//List<IService> candidates = serviceFactory.createService((URL) data);
} else if (data instanceof java.util.Map) {
java.util.Map<String, Serializable> connectionParams = (java.util.Map<String, Serializable>) data;
try {
local.acquire(connectionParams, null);
} catch (IOException e) {
CatalogUIPlugin.log( "Drag and Drop "+connectionParams, e);
}
//List<IService> candidates = serviceFactory.createService( connectionParams );
} else if (data instanceof String || data instanceof String[]) {
List<URL> urls = null;
if (data instanceof String) {
urls = CorePlugin.stringsToURLs((String) data);
} else {
urls = CorePlugin.stringsToURLs((String[]) data);
}
for( URL url : urls ) {
List<IService> services = serviceFactory
.createService(url);
for( IService service : services ) {
CatalogPlugin.getDefault().getLocalCatalog().add(service);
}
}