@Override protected void handleChildResourceChange(IResourceDelta delta) { final String name = delta.getResource().getName(); if (name.startsWith(DBPDataSourceRegistry.CONFIG_FILE_PREFIX) && name.endsWith(DBPDataSourceRegistry.CONFIG_FILE_EXT)) { // DS registry configuration changed getDatabases().getDataSourceRegistry().refreshConfig(); } else { super.handleChildResourceChange(delta); } }
public DBNResource findResource(IResource resource) { List<IResource> path = new ArrayList<>(); for (IResource parent = resource; !(parent instanceof IProject); parent = parent.getParent()) { path.add(0, parent); } DBNResource resNode = this; for (IResource res : path) { try { resNode.getChildren(VoidProgressMonitor.INSTANCE); } catch (DBException e) { log.error(e); } resNode = resNode.getChild(res); if (resNode == null) { return null; } } return resNode; }
@Override protected void dispose(boolean reflect) { IProject project = getProject(); super.dispose(reflect); getModel().getApplication().getProjectManager().removeProject(project); }