}
} else if (addedUris.size() > 0 && display != null) {
display.asyncExec(new Runnable() {
@Override
public void run() {
CommonViewer viewer = null;
try {
IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(viewerId);
if (view instanceof CommonNavigator) {
CommonNavigator navigator = (CommonNavigator) view;
viewer = navigator.getCommonViewer();
}
} catch (PartInitException e) {
}
if (viewer != null) {
Object[] addedArray = addedUris.toArray();
for (int ac = 0; ac < addedArray.length; ac++) {
String uri = (String) addedArray[ac];
HDFSServer server = HDFSManager.INSTANCE.getServer(uri);
if (server != null) {
try {
URI relativeURI = org.eclipse.core.runtime.URIUtil.makeRelative(new URI(uri), new URI(server.getUri()));
if (relativeURI != null) {
String projectName = HDFSManager.INSTANCE.getProjectName(server);
if (projectName != null) {
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(
new Path(projectName + "/" + relativeURI.toString()));
if (file != null) {
viewer.refresh(file, true);
if (logger.isDebugEnabled())
logger.debug("EMF listener: Refreshed [" + file.getFullPath() + "]");
IContainer parent = file.getParent();
while (parent != null) {
viewer.refresh(parent, true);
parent = parent.getParent();
}
}
}
}